fnmatch - fix warnings coming from original src so less noise
This commit is contained in:
parent
3d374692f7
commit
c855204271
|
@ -36,7 +36,7 @@ static int str_next(const char *str, size_t n, size_t *step)
|
|||
*step = 0;
|
||||
return 0;
|
||||
}
|
||||
if (str[0] >= 128U) {
|
||||
if ((unsigned)str[0] >= 128U) {
|
||||
wchar_t wc;
|
||||
int k = mbtowc(&wc, str, n);
|
||||
if (k<0) {
|
||||
|
@ -89,7 +89,7 @@ static int pat_next(const char *pat, size_t m, size_t *step, int flags)
|
|||
if (pat[0] == '?')
|
||||
return QUESTION;
|
||||
escaped:
|
||||
if (pat[0] >= 128U) {
|
||||
if ((unsigned)pat[0] >= 128U) {
|
||||
wchar_t wc;
|
||||
int k = mbtowc(&wc, pat, m);
|
||||
if (k<0) {
|
||||
|
@ -105,7 +105,7 @@ escaped:
|
|||
static int casefold(int k)
|
||||
{
|
||||
int c = towupper(k);
|
||||
return c == k ? towlower(k) : c;
|
||||
return c == k ? (int)towlower(k) : c;
|
||||
}
|
||||
|
||||
static int match_bracket(const char *p, int k, int kfold)
|
||||
|
@ -131,8 +131,8 @@ static int match_bracket(const char *p, int k, int kfold)
|
|||
int l = mbtowc(&wc2, p+1, 4);
|
||||
if (l < 0) return 0;
|
||||
if (wc <= wc2)
|
||||
if ((unsigned)k-wc <= wc2-wc ||
|
||||
(unsigned)kfold-wc <= wc2-wc)
|
||||
if ((unsigned)k-wc <= (unsigned)wc2-wc ||
|
||||
(unsigned)kfold-wc <= (unsigned)wc2-wc)
|
||||
return !inv;
|
||||
p += l-1;
|
||||
continue;
|
||||
|
@ -152,7 +152,7 @@ static int match_bracket(const char *p, int k, int kfold)
|
|||
}
|
||||
continue;
|
||||
}
|
||||
if (*p < 128U) {
|
||||
if ((unsigned)*p < 128U) {
|
||||
wc = (unsigned char)*p;
|
||||
} else {
|
||||
int l = mbtowc(&wc, p, 4);
|
||||
|
@ -234,7 +234,7 @@ static int fnmatch_internal(const char *pat, size_t m, const char *str, size_t n
|
|||
* On illegal sequences we may get it wrong, but in that case
|
||||
* we necessarily have a matching failure anyway. */
|
||||
for (s=endstr; s>str && tailcnt; tailcnt--) {
|
||||
if (s[-1] < 128U || MB_CUR_MAX==1) s--;
|
||||
if ((unsigned)s[-1] < 128U || MB_CUR_MAX==1) s--;
|
||||
else while ((unsigned char)*--s-0x80U<0x40 && s>str);
|
||||
}
|
||||
if (tailcnt) return __FNM_NOMATCH;
|
||||
|
|
Loading…
Reference in New Issue