diff options
author | Guy Harris <guy@alum.mit.edu> | 2007-07-14 00:37:01 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2007-07-14 00:37:01 +0000 |
commit | fad7133f8188d0f8600549c967b065ea09256d6b (patch) | |
tree | d461e9a80307638686913091cf8598563839a499 | |
parent | 90ab61d9f704d7cd5abc6df5f57f216e1eb1a99a (diff) |
Fix yet more casts of ctype.h macro arguments - and fix some cases where
we were passing an uncasted "char" to those macros.
svn path=/trunk/; revision=22306
-rw-r--r-- | epan/dfilter/dfilter-macro.c | 4 | ||||
-rw-r--r-- | epan/strutil.c | 14 | ||||
-rw-r--r-- | epan/uat.c | 4 | ||||
-rw-r--r-- | fileset.c | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c index 6d9799b17b..9098d65162 100644 --- a/epan/dfilter/dfilter-macro.c +++ b/epan/dfilter/dfilter-macro.c @@ -221,7 +221,7 @@ gchar* dfilter_macro_apply(const gchar* text, guint depth, const gchar** error) } break; } case NAME: { - if ( isalnum((int)c) || c == '_' ) { + if ( isalnum((guchar)c) || c == '_' ) { g_string_append_c(name,c); } else if ( c == ':') { state = ARGS; @@ -452,7 +452,7 @@ static gboolean macro_name_chk(void* r _U_, const char* in_name, unsigned name_l guint i; for (i=0; i < name_len; i++) { - if (!(in_name[i] == '_' || isalnum((int)in_name[i]) ) ) { + if (!(in_name[i] == '_' || isalnum((guchar)in_name[i]) ) ) { *error = "invalid char in name"; return FALSE; } diff --git a/epan/strutil.c b/epan/strutil.c index b7ab4d1d13..3f1b04db86 100644 --- a/epan/strutil.c +++ b/epan/strutil.c @@ -553,15 +553,15 @@ hex_str_to_bytes(const char *hex_str, GByteArray *bytes, gboolean force_separato gboolean uri_str_to_bytes(const char *uri_str, GByteArray *bytes) { guint8 val; - const char *p; - char hex_digit[HEX_DIGIT_BUF_LEN]; + const guchar *p; + guchar hex_digit[HEX_DIGIT_BUF_LEN]; g_byte_array_set_size(bytes, 0); if (! uri_str) { return FALSE; } - p = uri_str; + p = (const guchar *)uri_str; while (*p) { if (! isascii(*p) || ! isprint(*p)) @@ -574,9 +574,9 @@ uri_str_to_bytes(const char *uri_str, GByteArray *bytes) { if (*p == '\0') return FALSE; hex_digit[1] = *p; hex_digit[2] = '\0'; - if (! isxdigit((int)hex_digit[0]) || ! isxdigit((int)hex_digit[1])) + if (! isxdigit(hex_digit[0]) || ! isxdigit(hex_digit[1])) return FALSE; - val = (guint8) strtoul(hex_digit, NULL, 16); + val = (guint8) strtoul((char *)hex_digit, NULL, 16); g_byte_array_append(bytes, &val, 1); } else { g_byte_array_append(bytes, (guint8 *) p, 1); @@ -691,7 +691,7 @@ oid_str_to_bytes(const char *oid_str, GByteArray *bytes) { p = oid_str; dot = NULL; while (*p) { - if (!isdigit((int)*p) && (*p != '.')) return FALSE; + if (!isdigit((guchar)*p) && (*p != '.')) return FALSE; if (*p == '.') { if (p == oid_str) return FALSE; if (!*(p+1)) return FALSE; @@ -707,7 +707,7 @@ oid_str_to_bytes(const char *oid_str, GByteArray *bytes) { subid0 = 0; /* squelch GCC complaints */ while (*p) { subid = 0; - while (isdigit((int)*p)) { + while (isdigit((guchar)*p)) { subid *= 10; subid += *p - '0'; p++; diff --git a/epan/uat.c b/epan/uat.c index cd180f329d..44ec7a53c3 100644 --- a/epan/uat.c +++ b/epan/uat.c @@ -186,7 +186,7 @@ static void putfld(FILE* fp, void* rec, uat_field_t* f) { for(i=0;i<fld_len;i++) { char c = fld_ptr[i]; - if (c == '"' || c == '\\' || ! isprint((int)c) ) { + if (c == '"' || c == '\\' || ! isprint((guchar)c) ) { fprintf(fp,"\\x%.2x",c); } else { putc(c,fp); @@ -513,7 +513,7 @@ char* uat_unesc(const char* si, guint in_len, guint* len_p) { char c1 = *(s+1); char c0 = *(s+2); - if (isxdigit((int)c1) && isxdigit((int)c0)) { + if (isxdigit((guchar)c1) && isxdigit((guchar)c0)) { *(p++) = (xton(c1) * 0x10) + xton(c0); s += 2; } else { @@ -111,7 +111,7 @@ fileset_filename_match_pattern(const char *fname) while(minlen--) { baselen--; - if(!isdigit( (int) filename[baselen])) { + if(!isdigit( (guchar) filename[baselen])) { g_free(filename); return FALSE; } |