X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fconf-parse.c;h=c828462bb8dfb018c042baab5c6851bd9acf8a08;hb=da2f99caf76902aacb06fd389994ac79182a92da;hp=9a82f9c97e035ba5021ede070d7ab27b48bb1a7c;hpb=47a0795e8a28e8ad6ff55cda89e300267d9e590c;p=libucw.git diff --git a/lib/conf-parse.c b/lib/conf-parse.c index 9a82f9c9..c828462b 100644 --- a/lib/conf-parse.c +++ b/lib/conf-parse.c @@ -35,14 +35,14 @@ static const struct unit units[] = { }; static const struct unit * -lookup_unit(byte *value, byte *end, byte **msg) +lookup_unit(const char *value, const char *end, char **msg) { if (end && *end) { if (end == value || end[1] || *end >= '0' && *end <= '9') *msg = "Invalid number"; else { for (const struct unit *u=units; u->name; u++) - if (u->name == *end) + if ((char)u->name == *end) return u; *msg = "Invalid unit"; } @@ -52,10 +52,10 @@ lookup_unit(byte *value, byte *end, byte **msg) static char cf_rngerr[] = "Number out of range"; -byte * -cf_parse_int(byte *str, int *ptr) +char * +cf_parse_int(const char *str, int *ptr) { - byte *msg = NULL; + char *msg = NULL; if (!*str) msg = "Missing number"; else { @@ -81,10 +81,10 @@ cf_parse_int(byte *str, int *ptr) return msg; } -byte * -cf_parse_u64(byte *str, u64 *ptr) +char * +cf_parse_u64(const char *str, u64 *ptr) { - byte *msg = NULL; + char *msg = NULL; if (!*str) msg = "Missing number"; else { @@ -110,10 +110,10 @@ cf_parse_u64(byte *str, u64 *ptr) return msg; } -byte * -cf_parse_double(byte *str, double *ptr) +char * +cf_parse_double(const char *str, double *ptr) { - byte *msg = NULL; + char *msg = NULL; if (!*str) msg = "Missing number"; else { @@ -130,8 +130,8 @@ cf_parse_double(byte *str, double *ptr) return msg; } -byte * -cf_parse_ip(byte *p, u32 *varp) +char * +cf_parse_ip(const char *p, u32 *varp) { if (!*p) return "Missing IP address";