]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: silence a warning on Solaris about usage of isdigit()
authorWilly Tarreau <w@1wt.eu>
Thu, 22 Nov 2012 00:04:31 +0000 (01:04 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Nov 2012 00:04:31 +0000 (01:04 +0100)
On Solaris, isdigit() is a macro and it complains about the use of
a char instead of the int for the argument. Let's cast it to an int
to silence it.

src/cfgparse.c
src/dumpstats.c

index 72719dc2ab70c2f3a8b981e5ff3fe55e907b1de6..c31774320235b5a210982bc4d15533801c5193e1 100644 (file)
@@ -1231,7 +1231,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
                while (*args[cur_arg]) {
                        unsigned int low, high;
 
-                       if (isdigit(*args[cur_arg])) {
+                       if (isdigit((int)*args[cur_arg])) {
                                char *dash = strchr(args[cur_arg], '-');
 
                                low = high = str2uic(args[cur_arg]);
@@ -2146,7 +2146,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                        else if (strcmp(args[cur_arg], "even") == 0) {
                                set |= 0xAAAAAAAA;
                        }
-                       else if (isdigit(*args[cur_arg])) {
+                       else if (isdigit((int)*args[cur_arg])) {
                                char *dash = strchr(args[cur_arg], '-');
 
                                low = high = str2uic(args[cur_arg]);
@@ -4599,7 +4599,7 @@ stats_error_parsing:
                                                                name = end;
                                                                if (*end == '-')
                                                                        end++;
-                                                               while (isdigit(*end))
+                                                               while (isdigit((int)*end))
                                                                        end++;
                                                                newsrv->bind_hdr_occ = strl2ic(name, end-name);
                                                        }
@@ -5032,7 +5032,7 @@ stats_error_parsing:
                                                name = end;
                                                if (*end == '-')
                                                        end++;
-                                               while (isdigit(*end))
+                                               while (isdigit((int)*end))
                                                        end++;
                                                curproxy->bind_hdr_occ = strl2ic(name, end-name);
                                        }
index db82005eef5766675b23d9c11fe0b32223a3ff90..997bdec595c9ffc0444edb69c8837db6a6faef53 100644 (file)
@@ -322,7 +322,7 @@ static int stats_parse_global(char **args, int section_type, struct proxy *curpx
                        else if (strcmp(args[cur_arg], "even") == 0) {
                                set |= 0xAAAAAAAA;
                        }
-                       else if (isdigit(*args[cur_arg])) {
+                       else if (isdigit((int)*args[cur_arg])) {
                                char *dash = strchr(args[cur_arg], '-');
 
                                low = high = str2uic(args[cur_arg]);