Changeset 3441:f78b184ef598
- Timestamp:
- 2003-07-24 11:40:50 (5 years ago)
- Author:
- Vincent Lefevre <vincent@…>
- Branch:
- HEAD
- Message:
-
Some functions/macros like isspace take an int and require the
argument to have the value of an unsigned char (or EOF). Under
Solaris, gcc complains when the argument is a char (as this is a
possible bug, on platforms where char is signed, like Solaris). The
attached patch fixes such problems (well, perhaps I've changed more
than necessary, but this doesn't hurt).
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r3317
|
r3441
|
|
| 354 | 354 | { |
| 355 | 355 | return (c == '-' || c == '_' || c == '+' || c == '=' || c == '.' || |
| 356 | | isalnum (c)); |
| | 356 | isalnum ((unsigned char) c)); |
| 357 | 357 | } |
| 358 | 358 | |
-
|
r3341
|
r3441
|
|
| 845 | 845 | ADDRESS *a = NULL; |
| 846 | 846 | |
| 847 | | switch (tolower (*s)) |
| | 847 | switch (tolower ((unsigned char) *s)) |
| 848 | 848 | { |
| 849 | 849 | case 'r': |
-
|
r3323
|
r3441
|
|
| 155 | 155 | |
| 156 | 156 | /* quoted-printable triple */ |
| 157 | | if (*s == '=' && isxdigit (*(s+1)) && isxdigit (*(s+2))) |
| | 157 | if (*s == '=' && |
| | 158 | isxdigit ((unsigned char) *(s+1)) && |
| | 159 | isxdigit ((unsigned char) *(s+2))) |
| 158 | 160 | { |
| 159 | 161 | *d = (hexval (*(s+1)) << 4) | hexval (*(s+2)); |
-
|
r3433
|
r3441
|
|
| 309 | 309 | s = imap_next_word (idata->cmd.buf); |
| 310 | 310 | |
| 311 | | if ((idata->state == IMAP_SELECTED) && isdigit (*s)) |
| | 311 | if ((idata->state == IMAP_SELECTED) && isdigit ((unsigned char) *s)) |
| 312 | 312 | { |
| 313 | 313 | pn = s; |
| … |
… |
|
| 526 | 526 | memset (idata->rights, 0, sizeof (idata->rights)); |
| 527 | 527 | |
| 528 | | while (*s && !isspace(*s)) |
| | 528 | while (*s && !isspace((unsigned char) *s)) |
| 529 | 529 | { |
| 530 | 530 | switch (*s) |
-
|
r3437
|
r3441
|
|
| 1235 | 1235 | s = imap_next_word (s); |
| 1236 | 1236 | s = imap_next_word (s); |
| 1237 | | if (isdigit (*s)) |
| | 1237 | if (isdigit ((unsigned char) *s)) |
| 1238 | 1238 | { |
| 1239 | 1239 | if (*s != '0') |
-
|
r3173
|
r3441
|
|
| 853 | 853 | SKIPWS (s); |
| 854 | 854 | ptmp = tmp; |
| 855 | | while (isdigit (*s)) |
| | 855 | while (isdigit ((unsigned char) *s)) |
| 856 | 856 | *ptmp++ = *s++; |
| 857 | 857 | *ptmp = 0; |
-
|
r3433
|
r3441
|
|
| 311 | 311 | pc++; |
| 312 | 312 | pn = pc; |
| 313 | | while (isdigit (*pc)) |
| | 313 | while (isdigit ((unsigned char) *pc)) |
| 314 | 314 | pc++; |
| 315 | 315 | *pc = 0; |
-
|
r3410
|
r3441
|
|
| 140 | 140 | if (!*tok->dptr) |
| 141 | 141 | return -1; /* premature end of token */ |
| 142 | | mutt_buffer_addch (dest, (toupper (*tok->dptr) - '@') & 0x7f); |
| | 142 | mutt_buffer_addch (dest, (toupper ((unsigned char) *tok->dptr) |
| | 143 | - '@') & 0x7f); |
| 143 | 144 | tok->dptr++; |
| 144 | 145 | break; |
| … |
… |
|
| 181 | 182 | mutt_buffer_addch (dest, '\033'); |
| 182 | 183 | else if (isalpha ((unsigned char) ch)) |
| 183 | | mutt_buffer_addch (dest, toupper (ch) - '@'); |
| | 184 | mutt_buffer_addch (dest, toupper ((unsigned char) ch) - '@'); |
| 184 | 185 | else |
| 185 | 186 | { |
-
|
r2769
|
r3441
|
|
| 357 | 357 | |
| 358 | 358 | for (cnt = 0; cnt < name_len; ++cnt) |
| 359 | | if (isalnum (codeset[cnt])) |
| | 359 | if (isalnum ((unsigned char) codeset[cnt])) |
| 360 | 360 | { |
| 361 | 361 | ++len; |
| 362 | 362 | |
| 363 | | if (isalpha (codeset[cnt])) |
| | 363 | if (isalpha ((unsigned char) codeset[cnt])) |
| 364 | 364 | only_digit = 0; |
| 365 | 365 | } |
| … |
… |
|
| 375 | 375 | |
| 376 | 376 | for (cnt = 0; cnt < name_len; ++cnt) |
| 377 | | if (isalpha (codeset[cnt])) |
| 378 | | *wp++ = tolower (codeset[cnt]); |
| 379 | | else if (isdigit (codeset[cnt])) |
| | 377 | if (isalpha ((unsigned char) codeset[cnt])) |
| | 378 | *wp++ = tolower ((unsigned char) codeset[cnt]); |
| | 379 | else if (isdigit ((unsigned char) codeset[cnt])) |
| 380 | 380 | *wp++ = codeset[cnt]; |
| 381 | 381 | |
-
|
r2769
|
r3441
|
|
| 509 | 509 | |
| 510 | 510 | nplurals += 9; |
| 511 | | while (*nplurals != '\0' && isspace (*nplurals)) |
| | 511 | while (*nplurals != '\0' && isspace ((unsigned char) *nplurals)) |
| 512 | 512 | ++nplurals; |
| 513 | 513 | #if defined HAVE_STRTOUL || defined _LIBC |
-
|
r2769
|
r3441
|
|
| 245 | 245 | cp = buf; |
| 246 | 246 | /* Ignore leading white space. */ |
| 247 | | while (isspace (cp[0])) |
| | 247 | while (isspace ((unsigned char) cp[0])) |
| 248 | 248 | ++cp; |
| 249 | 249 | |
| … |
… |
|
| 252 | 252 | { |
| 253 | 253 | alias = cp++; |
| 254 | | while (cp[0] != '\0' && !isspace (cp[0])) |
| | 254 | while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) |
| 255 | 255 | ++cp; |
| 256 | 256 | /* Terminate alias name. */ |
| … |
… |
|
| 259 | 259 | |
| 260 | 260 | /* Now look for the beginning of the value. */ |
| 261 | | while (isspace (cp[0])) |
| | 261 | while (isspace ((unsigned char) cp[0])) |
| 262 | 262 | ++cp; |
| 263 | 263 | |
| … |
… |
|
| 268 | 268 | |
| 269 | 269 | value = cp++; |
| 270 | | while (cp[0] != '\0' && !isspace (cp[0])) |
| | 270 | while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) |
| 271 | 271 | ++cp; |
| 272 | 272 | /* Terminate value. */ |
-
|
r3435
|
r3441
|
|
| 121 | 121 | static int parse_keycode (const char *s) |
| 122 | 122 | { |
| 123 | | if (isdigit (s[1]) && isdigit (s[2]) && isdigit (s[3]) && s[4] == '>') |
| | 123 | if (isdigit ((unsigned char) s[1]) && |
| | 124 | isdigit ((unsigned char) s[2]) && |
| | 125 | isdigit ((unsigned char) s[3]) && |
| | 126 | s[4] == '>') |
| 124 | 127 | { |
| 125 | 128 | return (s[3] - '0') + (s[2] - '0') * 8 + (s[1] - '0') * 64; |
-
|
r3379
|
r3441
|
|
| 171 | 171 | while (*p) |
| 172 | 172 | { |
| 173 | | *p = tolower (*p); |
| | 173 | *p = tolower ((unsigned char) *p); |
| 174 | 174 | p++; |
| 175 | 175 | } |
| … |
… |
|
| 609 | 609 | while (*(p = haystack)) |
| 610 | 610 | { |
| 611 | | for (q = needle; *p && *q && tolower (*p) == tolower (*q); p++, q++) |
| | 611 | for (q = needle; |
| | 612 | *p && *q && |
| | 613 | tolower ((unsigned char) *p) == tolower ((unsigned char) *q); |
| | 614 | p++, q++) |
| 612 | 615 | ; |
| 613 | 616 | if (!*q) |
-
|
r3179
|
r3441
|
|
| 219 | 219 | static char *skip_ws (char *s) |
| 220 | 220 | { |
| 221 | | while (*s && isspace (*s)) |
| | 221 | while (*s && isspace ((unsigned char) *s)) |
| 222 | 222 | s++; |
| 223 | 223 | |
| … |
… |
|
| 301 | 301 | else if (!is_quoted && strchr (single_char_tokens, *t)) |
| 302 | 302 | break; |
| 303 | | else if (!is_quoted && isspace (*t)) |
| | 303 | else if (!is_quoted && isspace ((unsigned char) *t)) |
| 304 | 304 | break; |
| 305 | 305 | else |
| … |
… |
|
| 487 | 487 | /* heuristic! */ |
| 488 | 488 | strncpy (t, s + 5, l); |
| 489 | | for (; *t; t++) *t = tolower (*t); |
| | 489 | for (; *t; t++) *t = tolower ((unsigned char) *t); |
| 490 | 490 | break; |
| 491 | 491 | } |
| … |
… |
|
| 494 | 494 | /* heuristic! */ |
| 495 | 495 | strncpy (t, s + 2, l); |
| 496 | | for (; *t; t++) *t = tolower (*t); |
| | 496 | for (; *t; t++) *t = tolower ((unsigned char) *t); |
| 497 | 497 | break; |
| 498 | 498 | } |
| … |
… |
|
| 1189 | 1189 | { |
| 1190 | 1190 | ref = s; |
| 1191 | | while (isalnum (*s) || *s == '-' || *s == '_') |
| | 1191 | while (isalnum ((unsigned char) *s) || *s == '-' || *s == '_') |
| 1192 | 1192 | ++s; |
| 1193 | 1193 | |
-
|
r3415
|
r3441
|
|
| 522 | 522 | MAX(destlen - idx - pwnl - 1, 0)); |
| 523 | 523 | memcpy (&dest[idx], pw->pw_name, MIN(destlen - idx - 1, pwnl)); |
| 524 | | dest[idx] = toupper (dest[idx]); |
| | 524 | dest[idx] = toupper ((unsigned char) dest[idx]); |
| 525 | 525 | } |
| 526 | 526 | } |
-
|
r3417
|
r3441
|
|
| 279 | 279 | else |
| 280 | 280 | pat->min = strtol (s->dptr, &tmp, 0); |
| 281 | | if (toupper (*tmp) == 'K') /* is there a prefix? */ |
| | 281 | if (toupper ((unsigned char) *tmp) == 'K') /* is there a prefix? */ |
| 282 | 282 | { |
| 283 | 283 | pat->min *= 1024; |
| 284 | 284 | tmp++; |
| 285 | 285 | } |
| 286 | | else if (toupper (*tmp) == 'M') |
| | 286 | else if (toupper ((unsigned char) *tmp) == 'M') |
| 287 | 287 | { |
| 288 | 288 | pat->min *= 1048576; |
| … |
… |
|
| 313 | 313 | /* range maximum */ |
| 314 | 314 | pat->max = strtol (tmp, &tmp, 0); |
| 315 | | if (toupper (*tmp) == 'K') |
| | 315 | if (toupper ((unsigned char) *tmp) == 'K') |
| 316 | 316 | { |
| 317 | 317 | pat->max *= 1024; |
| 318 | 318 | tmp++; |
| 319 | 319 | } |
| 320 | | else if (toupper (*tmp) == 'M') |
| | 320 | else if (toupper ((unsigned char) *tmp) == 'M') |
| 321 | 321 | { |
| 322 | 322 | pat->max *= 1048576; |
-
|
r3195
|
r3441
|
|
| 607 | 607 | break; |
| 608 | 608 | case 3: |
| 609 | | if (toupper (*pp) == 'Q') |
| | 609 | if (toupper ((unsigned char) *pp) == 'Q') |
| 610 | 610 | enc = ENCQUOTEDPRINTABLE; |
| 611 | | else if (toupper (*pp) == 'B') |
| | 611 | else if (toupper ((unsigned char) *pp) == 'B') |
| 612 | 612 | enc = ENCBASE64; |
| 613 | 613 | else |
-
|
r3179
|
r3441
|
|
| 136 | 136 | { |
| 137 | 137 | *s = '\0'; s++; /* let s point to the first character of index. */ |
| 138 | | for (t = s; *t && isdigit (*t); t++) |
| | 138 | for (t = s; *t && isdigit ((unsigned char) *t); t++) |
| 139 | 139 | ; |
| 140 | 140 | encoded = (*t == '*'); |
| … |
… |
|
| 209 | 209 | for (d = dest; *src; src++) |
| 210 | 210 | { |
| 211 | | if (*src == '%' && isxdigit (*(src + 1)) && isxdigit (*(src + 2))) |
| | 211 | if (*src == '%' && |
| | 212 | isxdigit ((unsigned char) *(src + 1)) && |
| | 213 | isxdigit ((unsigned char) *(src + 2))) |
| 212 | 214 | { |
| 213 | 215 | *d++ = (hexval (*(src + 1)) << 4) | (hexval (*(src + 2))); |
-
|
r3311
|
r3441
|
|
| 175 | 175 | while (*s) |
| 176 | 176 | { |
| 177 | | if (ISSPACE (*s) || is_special (*s)) |
| | 177 | if (ISSPACE ((unsigned char) *s) || is_special (*s)) |
| 178 | 178 | break; |
| 179 | 179 | if (*tokenlen < tokenmax) |
| … |
… |
|
| 346 | 346 | last = last->next; |
| 347 | 347 | |
| 348 | | ws_pending = isspace (*s); |
| | 348 | ws_pending = isspace ((unsigned char) *s); |
| 349 | 349 | |
| 350 | 350 | SKIPWS (s); |
| … |
… |
|
| 480 | 480 | s = ps; |
| 481 | 481 | } |
| 482 | | ws_pending = isspace (*s); |
| | 482 | ws_pending = isspace ((unsigned char) *s); |
| 483 | 483 | SKIPWS (s); |
| 484 | 484 | } |
-
|
r2766
|
r3441
|
|
| 10 | 10 | while (*s1 && *s2 && l < n) |
| 11 | 11 | { |
| 12 | | c1 = tolower (*s1); |
| 13 | | c2 = tolower (*s2); |
| | 12 | c1 = tolower ((unsigned char) *s1); |
| | 13 | c2 = tolower ((unsigned char) *s2); |
| 14 | 14 | if (c1 != c2) |
| 15 | 15 | return (c1 - c2); |
| … |
… |
|
| 30 | 30 | while (*s1 && *s2) |
| 31 | 31 | { |
| 32 | | c1 = tolower (*s1); |
| 33 | | c2 = tolower (*s2); |
| | 32 | c1 = tolower ((unsigned char) *s1); |
| | 33 | c2 = tolower ((unsigned char) *s2); |
| 34 | 34 | if (c1 != c2) |
| 35 | 35 | return (c1 - c2); |
-
|
r3195
|
r3441
|
|
| 51 | 51 | { |
| 52 | 52 | if (*s == '%' && s[1] && s[2] && |
| 53 | | isxdigit (s[1]) && isxdigit (s[2]) && |
| | 53 | isxdigit ((unsigned char) s[1]) && |
| | 54 | isxdigit ((unsigned char) s[2]) && |
| 54 | 55 | hexval (s[1]) >= 0 && hexval (s[2]) >= 0) |
| 55 | 56 | { |