From: Wouter Wijngaards Date: Fri, 21 Sep 2007 14:15:05 +0000 (+0000) Subject: remove subscript char warnings. X-Git-Tag: release-0.5~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50439921595e89b11f35021074edb353c856e229;p=thirdparty%2Funbound.git remove subscript char warnings. git-svn-id: file:///svn/unbound/trunk@630 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/daemon.c b/daemon/daemon.c index 6fd1dbc1a..540b5513f 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -156,12 +156,12 @@ count_modules(const char* s) return 0; while(*s) { /* skip whitespace */ - while(*s && isspace(*s)) + while(*s && isspace((int)*s)) s++; - if(*s && !isspace(*s)) { + if(*s && !isspace((int)*s)) { /* skip identifier */ num++; - while(*s && !isspace(*s)) + while(*s && !isspace((int)*s)) s++; } } @@ -184,7 +184,7 @@ daemon_module_factory(const char** str) int i; const char* s = *str; - while(*s && isspace(*s)) + while(*s && isspace((int)*s)) s++; for(i=0; iixfr_soa_serial = (uint32_t)strtol(parse, (char**)&parse, 10); - while(isspace(*parse)) + while(isspace((int)*parse)) parse++; } else { error("could not parse MATCH: '%s'", parse); @@ -206,11 +206,11 @@ static void adjustline(const char* line, struct entry* e, e->copy_query = true; } else if(str_keyword(&parse, "sleep=")) { e->sleeptime = (unsigned int) strtol(parse, (char**)&parse, 10); - while(isspace(*parse)) + while(isspace((int)*parse)) parse++; } else if(str_keyword(&parse, "packet_sleep=")) { pkt->packet_sleep = (unsigned int) strtol(parse, (char**)&parse, 10); - while(isspace(*parse)) + while(isspace((int)*parse)) parse++; } else { error("could not parse ADJUST: '%s'", parse); @@ -390,7 +390,7 @@ get_origin(const char* name, int lineno, ldns_rdf** origin, char* parse) *origin = NULL; end=parse; - while(!isspace(*end) && !isendline(*end)) + while(!isspace((int)*end) && !isendline(*end)) end++; store = *end; *end = 0; @@ -420,7 +420,7 @@ read_entry(FILE* in, const char* name, int *lineno, uint32_t* default_ttl, parse = line; (*lineno) ++; - while(isspace(*parse)) + while(isspace((int)*parse)) parse++; /* test for keywords */ if(isendline(*parse)) diff --git a/testcode/readhex.c b/testcode/readhex.c index af9a77b8f..3be539ad5 100644 --- a/testcode/readhex.c +++ b/testcode/readhex.c @@ -46,7 +46,7 @@ static void skip_whites(const char** p) { while(1) { - while(isspace(**p)) + while(isspace((int)**p)) (*p)++; if(**p == ';') { /* comment, skip until newline */ @@ -68,11 +68,11 @@ void hex_to_buf(ldns_buffer* pkt, const char* hex) skip_whites(&p); if(ldns_buffer_position(pkt) == ldns_buffer_limit(pkt)) fatal_exit("hex_to_buf: buffer too small"); - if(!isalnum(*p)) + if(!isalnum((int)*p)) break; val = ldns_hexdigit_to_int(*p++) << 4; skip_whites(&p); - log_assert(*p && isalnum(*p)); + log_assert(*p && isalnum((int)*p)); val |= ldns_hexdigit_to_int(*p++); ldns_buffer_write_u8(pkt, (uint8_t)val); skip_whites(&p); diff --git a/testcode/replay.c b/testcode/replay.c index 5d186c599..4c27b245e 100644 --- a/testcode/replay.c +++ b/testcode/replay.c @@ -92,7 +92,7 @@ strip_end_white(char* p) { size_t i; for(i = strlen(p); i > 0; i--) { - if(isspace(p[i-1])) + if(isspace((int)p[i-1])) p[i-1] = 0; else return; } @@ -133,12 +133,12 @@ replay_range_read(char* remain, FILE* in, const char* name, int* lineno, while(fgets(line, MAX_LINE_LEN-1, in)) { (*lineno)++; parse = line; - while(isspace(*parse)) + while(isspace((int)*parse)) parse++; if(!*parse || *parse == ';') continue; if(parse_keyword(&parse, "ADDRESS")) { - while(isspace(*parse)) + while(isspace((int)*parse)) parse++; strip_end_white(parse); if(!extstrtoaddr(parse, &rng->addr, &rng->addrlen)) { @@ -199,7 +199,7 @@ replay_moment_read(char* remain, FILE* in, const char* name, int* lineno, return NULL; } remain += skip; - while(isspace(*remain)) + while(isspace((int)*remain)) remain++; if(parse_keyword(&remain, "NOTHING")) { mom->evt_type = repevt_nothing; @@ -224,7 +224,7 @@ replay_moment_read(char* remain, FILE* in, const char* name, int* lineno, free(mom); return NULL; } - while(isspace(*remain)) + while(isspace((int)*remain)) remain++; if(parse_keyword(&remain, "ADDRESS")) { if(!extstrtoaddr(remain, &mom->addr, &mom->addrlen)) { @@ -251,7 +251,7 @@ static struct replay_scenario* make_scenario(char* line) { struct replay_scenario* scen; - while(isspace(*line)) + while(isspace((int)*line)) line++; if(!*line) { log_err("scenario: no title given"); @@ -283,7 +283,7 @@ replay_scenario_read(FILE* in, const char* name, int* lineno) while(fgets(line, MAX_LINE_LEN-1, in)) { parse=line; (*lineno)++; - while(isspace(*parse)) + while(isspace((int)*parse)) parse++; if(!*parse) continue; /* empty line */ diff --git a/testcode/testbound.c b/testcode/testbound.c index 0578c57d4..ebb0136ed 100644 --- a/testcode/testbound.c +++ b/testcode/testbound.c @@ -84,7 +84,7 @@ add_opts(char* optarg, int* pass_argc, char* pass_argv[]) { char *p = optarg, *np; size_t len; - while(p && isspace(*p)) + while(p && isspace((int)*p)) p++; while(p && *p) { /* find location of next string and length of this one */ @@ -102,7 +102,7 @@ add_opts(char* optarg, int* pass_argc, char* pass_argv[]) (*pass_argc)++; /* go to next option */ p = np; - while(p && isspace(*p)) + while(p && isspace((int)*p)) p++; } } @@ -138,7 +138,7 @@ setup_config(FILE* in, char* configfile, int* lineno, while(fgets(line, MAX_LINE_LEN-1, in)) { parse = line; (*lineno)++; - while(isspace(*parse)) + while(isspace((int)*parse)) parse++; if(!*parse || parse[0] == ';') continue; diff --git a/util/config_file.c b/util/config_file.c index 104d1856e..14396dab5 100644 --- a/util/config_file.c +++ b/util/config_file.c @@ -302,7 +302,7 @@ cfg_count_numbers(const char* s) /* sp ::= (space|tab)* */ int num = 0; while(*s) { - while(*s && isspace(*s)) + while(*s && isspace((int)*s)) s++; if(!*s) /* end of string */ break; @@ -310,9 +310,9 @@ cfg_count_numbers(const char* s) s++; if(!*s) /* only - not allowed */ return 0; - if(!isdigit(*s)) /* bad character */ + if(!isdigit((int)*s)) /* bad character */ return 0; - while(*s && isdigit(*s)) + while(*s && isdigit((int)*s)) s++; num++; }