diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 1998-12-22 06:57:17 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 1998-12-22 06:57:17 +0000 |
commit | 087aa3989488d52b6c5be69879ead4255f951840 (patch) | |
tree | 3469ef763250330165a80bdbf1c8e2d35e50ea42 /libiberty/fnmatch.c | |
parent | 4510c86d24c903d9aafd2cd5fd76d3838c4f6494 (diff) | |
download | gcc-087aa3989488d52b6c5be69879ead4255f951840.tar.gz |
Warning fixes:
* argv.c (buildargv): Cast the result of alloca in assignment.
* choose-temp.c: Include stdlib.h.
* cplus-dem.c (demangle_arm_pt): Remove unused prototype.
(snarf_numeric_literal): Constify first parameter.
(code_for_qualifier): Avoid a gcc extension, make the parameter an
int, not a char.
(demangle_qualifier): Likewise.
(demangle_signature): Cast the argument of a ctype function to
unsigned char.
(arm_pt): Add parens around assignment used as truth value.
(demangle_arm_hp_template): Constify variable `args'.
(do_hpacc_template_const_value): Cast the argument of a ctype
function to unsigned char.
(do_hpacc_template_literal): Remove unused variable `i'.
(snarf_numeric_literal): Constify parameter `args'.
Cast the argument of a ctype function to unsigned char.
* floatformat.c (floatformat_to_double): Add explicit braces to
avoid ambiguous `else'.
* fnmatch.c (fnmatch): Change type of variables `c', `c1',
`cstart' and `cend' to unsigned char. Cast the argument of macro
`FOLD', which uses ctype functions, to unsigned char.
* objalloc.c (free): Add prototype.
From-SVN: r24392
Diffstat (limited to 'libiberty/fnmatch.c')
-rw-r--r-- | libiberty/fnmatch.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libiberty/fnmatch.c b/libiberty/fnmatch.c index 685d9e40edc..453caced72f 100644 --- a/libiberty/fnmatch.c +++ b/libiberty/fnmatch.c @@ -71,7 +71,7 @@ fnmatch (pattern, string, flags) int flags; { register const char *p = pattern, *n = string; - register char c; + register unsigned char c; /* Note that this evalutes C many times. */ #define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c)) @@ -98,7 +98,7 @@ fnmatch (pattern, string, flags) c = *p++; c = FOLD (c); } - if (FOLD (*n) != c) + if (FOLD ((unsigned char)*n) != c) return FNM_NOMATCH; break; @@ -116,10 +116,10 @@ fnmatch (pattern, string, flags) return 0; { - char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; + unsigned char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; c1 = FOLD (c1); for (--p; *n != '\0'; ++n) - if ((c == '[' || FOLD (*n) == c1) && + if ((c == '[' || FOLD ((unsigned char)*n) == c1) && fnmatch (p, n, flags & ~FNM_PERIOD) == 0) return 0; return FNM_NOMATCH; @@ -144,7 +144,7 @@ fnmatch (pattern, string, flags) c = *p++; for (;;) { - register char cstart = c, cend = c; + register unsigned char cstart = c, cend = c; if (!(flags & FNM_NOESCAPE) && c == '\\') cstart = cend = *p++; @@ -174,7 +174,8 @@ fnmatch (pattern, string, flags) c = *p++; } - if (FOLD (*n) >= cstart && FOLD (*n) <= cend) + if (FOLD ((unsigned char)*n) >= cstart + && FOLD ((unsigned char)*n) <= cend) goto matched; if (c == ']') @@ -203,7 +204,7 @@ fnmatch (pattern, string, flags) break; default: - if (c != FOLD (*n)) + if (c != FOLD ((unsigned char)*n)) return FNM_NOMATCH; } |