]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
remove subscript char warnings.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 21 Sep 2007 14:15:05 +0000 (14:15 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 21 Sep 2007 14:15:05 +0000 (14:15 +0000)
git-svn-id: file:///svn/unbound/trunk@630 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/daemon.c
doc/Changelog
testcode/ldns-testpkts.c
testcode/readhex.c
testcode/replay.c
testcode/testbound.c
util/config_file.c

index 6fd1dbc1a6fc603611f3c6b918223c5578a97581..540b5513f6dd1b15ee77d741cbb3d5872322a1cd 100644 (file)
@@ -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; i<num; i++) {
                if(strncmp(names[i], s, strlen(names[i])) == 0) {
index b9463c1f75eda91bc53bc177246198dd09e6ac7d..727cccd661f95f255a9f86e1e1e6d14f218641c4 100644 (file)
@@ -1,6 +1,7 @@
 21 September 2007: Wouter
        - fixup empty_DS_name allocated in wrong region.
        - fixup testcode lock safety. 
+       - removes subscript has type char warnings.
 
 20 September 2007: Wouter
        - fixup and test for NSEC wildcard with empty nonterminals. 
index b01795344ba26980a28d16df29b618342d8a48a4..4c13692b791a4605f9dfc8b4840fd9e43eb2fe01 100644 (file)
@@ -68,7 +68,7 @@ static bool str_keyword(const char** str, const char* keyword)
        if(strncmp(*str, keyword, len) != 0)
                return false;
        *str += len;
-       while(isspace(**str))
+       while(isspace((int)**str))
                (*str)++;
        return true;
 }
@@ -120,7 +120,7 @@ static void matchline(const char* line, struct entry* e)
                                error("expected = or : in MATCH: %s", line);
                        parse++;
                        e->ixfr_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))
index af9a77b8fea6f42499721a912d71e353ab54ee7b..3be539ad574ff7e8b5e47cb7662e0c9e5725287b 100644 (file)
@@ -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);
index 5d186c5999e7e6f1016ab5940ac6ae413119fd63..4c27b245ec385ce542591980b965ae90efdc6814 100644 (file)
@@ -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 */
index 0578c57d48839f0603da7b1eb425bae1cf0ad79e..ebb0136edb50310f06168bbdb4afdb905b84c4ed 100644 (file)
@@ -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;
index 104d1856ec3173fde51e88042448d325b1ae3ba9..14396dab5d7eea31d3ba936f4efb016c7d047151 100644 (file)
@@ -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++;
         }