Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions drivers/libshut.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ void setline(int upsfd, int set)
int shut_synchronise(int upsfd)
{
int retCode = 0;
u_char c = SHUT_SYNC_OFF, reply;
unsigned char c = SHUT_SYNC_OFF, reply;
int try;

upsdebugx (2, "entering shut_synchronise()");
Expand Down Expand Up @@ -672,10 +672,10 @@ int shut_synchronise(int upsfd)
/*!
* Compute a SHUT checksum for the packet "buf"
*/
u_char shut_checksum(const u_char *buf, int bufsize)
unsigned char shut_checksum(const unsigned char *buf, int bufsize)
{
int i;
u_char chk=0;
unsigned char chk=0;

for(i=0; i<bufsize; i++)
chk^=buf[i];
Expand All @@ -685,14 +685,14 @@ u_char shut_checksum(const u_char *buf, int bufsize)
}


int shut_packet_recv(int upsfd, u_char *Buf, int datalen)
int shut_packet_recv(int upsfd, unsigned char *Buf, int datalen)
{
u_char Start[2];
u_char Frame[8];
u_char Chk[1];
u_short Size=8;
u_short Pos=0;
u_char Retry=0;
unsigned char Start[2];
unsigned char Frame[8];
unsigned char Chk[1];
unsigned short Size=8;
unsigned short Pos=0;
unsigned char Retry=0;
int recv;
/* FIXME: use this
* shut_data_t sdata; */
Expand Down Expand Up @@ -845,7 +845,7 @@ int shut_get_string_simple(int upsfd, int index,
*********************************************************************/

/**********************************************************************
* shut_get_descriptor(int desctype, u_char *pkt)
* shut_get_descriptor(int desctype, unsigned char *pkt)
*
* get descriptor specified by DescType and return it in Buf
*
Expand Down Expand Up @@ -994,7 +994,7 @@ int shut_control_msg(int upsfd, int requesttype, int request,
int shut_wait_ack(int upsfd)
{
int retCode = -1;
u_char c = '\0';
unsigned char c = '\0';

ser_get_char(upsfd, &c, SHUT_TIMEOUT/1000, 0);
if (c == SHUT_OK)
Expand Down
8 changes: 4 additions & 4 deletions drivers/riello_ser.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ static int char_read (char *bytes, int size, int read_timeout)
* returns 0 on success, -1 on error, -2 on timeout
*
**********************************************************************/
int serial_read (int read_timeout, u_char *readbuf)
int serial_read (int read_timeout, unsigned char *readbuf)
{
static u_char cache[512];
static u_char *cachep = cache;
static u_char *cachee = cache;
static unsigned char cache[512];
static unsigned char *cachep = cache;
static unsigned char *cachee = cache;
int recv;
*readbuf = '\0';

Expand Down
6 changes: 3 additions & 3 deletions drivers/snmp-ups.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ void nut_snmp_init(const char *type, const char *hostname)
if(g_snmp_sess.securityLevel != SNMP_SEC_LEVEL_NOAUTH) {
if (generate_Ku(g_snmp_sess.securityAuthProto,
g_snmp_sess.securityAuthProtoLen,
(u_char *) authPassword, strlen(authPassword),
(unsigned char *) authPassword, strlen(authPassword),
g_snmp_sess.securityAuthKey,
&g_snmp_sess.securityAuthKeyLen) !=
SNMPERR_SUCCESS) {
Expand All @@ -604,7 +604,7 @@ void nut_snmp_init(const char *type, const char *hostname)
g_snmp_sess.securityPrivKeyLen = USM_PRIV_KU_LEN;
if (generate_Ku(g_snmp_sess.securityAuthProto,
g_snmp_sess.securityAuthProtoLen,
(u_char *) privPassword, strlen(privPassword),
(unsigned char *) privPassword, strlen(privPassword),
g_snmp_sess.securityPrivKey,
&g_snmp_sess.securityPrivKeyLen) !=
SNMPERR_SUCCESS) {
Expand Down Expand Up @@ -790,7 +790,7 @@ static bool_t decode_str(struct snmp_pdu *pdu, char *buf, size_t buf_len, info_l
buf_len - 1 : pdu->variables->val_len;
/* Test for hexadecimal values */
int hex = 0, x;
u_char *cp;
unsigned char *cp;
for(cp = pdu->variables->val.string, x = 0; x < (int)pdu->variables->val_len; x++, cp++) {
if (!(isprint(*cp) || isspace(*cp))) {
hex = 1;
Expand Down
2 changes: 1 addition & 1 deletion tools/nut-scanner/scan_eaton_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ unsigned char calc_checksum(const unsigned char *buf)
int shut_synchronise(int upsfd)
{
int try;
u_char reply = '\0';
unsigned char reply = '\0';

/* Sync with the UPS according to notification */
for (try = 0; try < MAX_TRY; try++) {
Expand Down
6 changes: 3 additions & 3 deletions tools/nut-scanner/scan_snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static int (*nut_snmp_oid_compare) (const oid *in_name1, size_t len1,
const oid *in_name2, size_t len2);
static void (*nut_snmp_free_pdu) (netsnmp_pdu *pdu);
static int (*nut_generate_Ku)(const oid * hashtype, u_int hashtype_len,
u_char * P, size_t pplen, u_char * Ku, size_t * kulen);
unsigned char * P, size_t pplen, unsigned char * Ku, size_t * kulen);
static char* (*nut_snmp_out_toggle_options)(char *options);
static const char * (*nut_snmp_api_errstring) (int snmp_errnumber);
static int (*nut_snmp_errno);
Expand Down Expand Up @@ -511,7 +511,7 @@ static int init_session(struct snmp_session * snmp_sess, nutscan_snmp_t * sec)
* our passphrase (must be at least 8 characters long) */
if ((*nut_generate_Ku)(snmp_sess->securityAuthProto,
snmp_sess->securityAuthProtoLen,
(u_char *) sec->authPassword,
(unsigned char *) sec->authPassword,
strlen(sec->authPassword),
snmp_sess->securityAuthKey,
&snmp_sess->securityAuthKeyLen)
Expand Down Expand Up @@ -553,7 +553,7 @@ static int init_session(struct snmp_session * snmp_sess, nutscan_snmp_t * sec)
snmp_sess->securityPrivKeyLen = USM_PRIV_KU_LEN;
if ((*nut_generate_Ku)(snmp_sess->securityAuthProto,
snmp_sess->securityAuthProtoLen,
(u_char *) sec->privPassword,
(unsigned char *) sec->privPassword,
strlen(sec->privPassword),
snmp_sess->securityPrivKey,
&snmp_sess->securityPrivKeyLen)
Expand Down