diff --git a/adat/adat.c b/adat/adat.c index 6a720eccf..5c40b4406 100644 --- a/adat/adat.c +++ b/adat/adat.c @@ -594,7 +594,7 @@ size_t trimwhitespace( char *out, size_t len, const char *str ) } // Trim leading space - while(isspace(*str)) str++; + while(isspace((int)*str)) str++; if(*str == 0) // All spaces? { @@ -605,7 +605,7 @@ size_t trimwhitespace( char *out, size_t len, const char *str ) // Trim trailing space end = (char *)(str + strlen(str) - 1); - while(end > str && isspace(*end)) + while(end > str && isspace((int)*end)) { *end = '\0'; end--; @@ -732,7 +732,7 @@ int adat_parse_freq( char *pcStr, // Get Freq Value from response string - while(( isalpha( *pcEnd ) == 0 ) || + while(( isalpha( (int)*pcEnd ) == 0 ) || ( *pcEnd == '.' )) { acValueBuf[ nI++ ] = *pcEnd; @@ -748,7 +748,7 @@ int adat_parse_freq( char *pcStr, // Get Freq Unit from response string nI = 0; - while( isalpha( *pcEnd ) != 0 ) + while( isalpha( (int)*pcEnd ) != 0 ) { acUnitBuf[ nI++ ] = *pcEnd; pcEnd += sizeof( char ); diff --git a/kenwood/ic10.c b/kenwood/ic10.c index 1adaa13b4..69e079170 100644 --- a/kenwood/ic10.c +++ b/kenwood/ic10.c @@ -53,7 +53,7 @@ int ic10_cmd_trim (char *data, int data_len) { __func__, data_len); /* suck up additional spaces at end of the data buffer */ - for (i=data_len; !isdigit(data[i-1]); i--) { + for (i=data_len; !isdigit((int)data[i-1]); i--) { data_len = data_len-1; rig_debug(RIG_DEBUG_TRACE,"%s: data['%d'] is '%c'\n", __func__, i-1, data[i-1]); diff --git a/kenwood/kenwood.c b/kenwood/kenwood.c index a1ace6495..bcac1ddf0 100644 --- a/kenwood/kenwood.c +++ b/kenwood/kenwood.c @@ -1297,7 +1297,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (lvlbuf[2] == '0') val->i = 0; - else if (isdigit(lvlbuf[2])) { + else if (isdigit((int)lvlbuf[2])) { lvl = lvlbuf[2]-'0'; for (i=0; istate.preamp[i] == 0) { diff --git a/rotorez/rotorez.c b/rotorez/rotorez.c index 758d4d7e0..5f68b3139 100644 --- a/rotorez/rotorez.c +++ b/rotorez/rotorez.c @@ -420,7 +420,7 @@ static int rotorez_rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *e } else if (err == AZ_READ_LEN && az[0] == ';') { /* Check if remaining chars are digits if az[0] == ';' */ for (p = az + 1;p < az + 4; p++) - if (isdigit(*p)) + if (isdigit((int)*p)) continue; else err = -RIG_EINVAL; @@ -493,14 +493,14 @@ static int erc_rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *eleva /* Check if remaining chars are digits if az[3] == ';' */ if (az[3] == ';') { for (p = az; p < az + 3; p++) - if (isdigit(*p)) + if (isdigit((int)*p)) continue; else err = -RIG_EINVAL; } else if (az[0] == ';') { /* Check if remaining chars are digits if az[0] == ';' */ for (p = az + 1;p < az + 4; p++) - if (isdigit(*p)) + if (isdigit((int)*p)) continue; else err = -RIG_EINVAL; diff --git a/src/parallel.c b/src/parallel.c index bdb6fa219..1da21daf4 100644 --- a/src/parallel.c +++ b/src/parallel.c @@ -124,7 +124,9 @@ int par_open(hamlib_port_t *port) { int fd; +#ifdef HAVE_LINUX_PPDEV_H int mode; +#endif if (!port->pathname) return -RIG_EINVAL; diff --git a/tentec/orion.c b/tentec/orion.c index 3225305bd..8ca1eaa4a 100644 --- a/tentec/orion.c +++ b/tentec/orion.c @@ -918,7 +918,7 @@ const char *tt565_get_info(RIG *rig) /* filter out any non-graphic characters */ for (i=0; i < strlen(buf); i++) - if (!isgraph(buf[i])) buf[i] = ' '; // bad chars -> spaces + if (!isgraph((int)buf[i])) buf[i] = ' '; // bad chars -> spaces return buf; } diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index c822f7272..3389b272a 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -724,7 +724,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc) * alpha-numeric characters and the underscore ('_') character. */ for (j = 0; cmd_name[j] != '\0'; j++) { - if (!(isalnum(cmd_name[j]) || cmd_name[j] == '_')) { + if (!(isalnum((int)cmd_name[j]) || cmd_name[j] == '_')) { fprintf(stderr, "Valid multiple character command names contain alpha-numeric characters plus '_'\n"); return 0; } @@ -807,7 +807,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc) #endif /* Sanity check, VFO names are alpha only. */ for (j = 0; j < MAXNAMSIZ && parsed_input[x][j] != '\0'; j++) { - if (!(isalpha(parsed_input[x][j]))) { + if (!(isalpha((int)parsed_input[x][j]))) { parsed_input[x][j] = '\0'; break; @@ -2106,7 +2106,7 @@ declare_proto_rig(set_channel) memset(&chan, 0, sizeof(channel_t)); - if (isdigit(arg1[0])) { + if (isdigit((int)arg1[0])) { chan.vfo = RIG_VFO_MEM; CHKSCN1ARG(sscanf(arg1, "%d", &chan.channel_num)); /* @@ -2280,7 +2280,7 @@ declare_proto_rig(get_channel) memset(&chan, 0, sizeof(channel_t)); - if (isdigit(arg1[0])) { + if (isdigit((int)arg1[0])) { chan.vfo = RIG_VFO_MEM; CHKSCN1ARG(sscanf(arg1, "%d", &chan.channel_num)); } else { diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 0d5dd558f..6b70af1dc 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -630,7 +630,7 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc) * alpha-numeric characters and the underscore ('_') character. */ for (j = 0; cmd_name[j] != '\0'; j++) { - if (!(isalnum(cmd_name[j]) || cmd_name[j] == '_')) { + if (!(isalnum((int)cmd_name[j]) || cmd_name[j] == '_')) { fprintf(stderr, "Valid multiple character command names contain alpha-numeric characters plus '_'\n"); return 0; }