--------------------- PatchSet 11359 Date: 2007/04/01 14:17:44 Author: serassio Branch: HEAD Tag: (none) Log: Always use xisxxxx() Squid defined macros instead of ctype functions. Also fixed some incorrect type cast. Fore more details see this squid-dev thread: http://www.squid-cache.org/mail-archive/squid-dev/200703/0129.html Members: helpers/basic_auth/LDAP/squid_ldap_auth.c:1.32->1.33 helpers/negotiate_auth/mswin_sspi/libnegotiatessp.c:1.1->1.2 helpers/negotiate_auth/mswin_sspi/negotiate_auth.c:1.1->1.2 helpers/ntlm_auth/fakeauth/fakeauth_auth.c:1.11->1.12 helpers/ntlm_auth/mswin_sspi/libntlmssp.c:1.2->1.3 helpers/ntlm_auth/mswin_sspi/ntlm_auth.c:1.1->1.2 lib/util.c:1.94->1.95 lib/win32lib.c:1.3->1.4 snmplib/parse.c:1.31->1.32 src/access_log.c:1.97->1.98 src/cache_cf.c:1.465->1.466 src/ftp.c:1.346->1.347 src/helper.c:1.65->1.66 src/tools.c:1.251->1.252 test-suite/pconn-banger.c:1.8->1.9 Index: squid/helpers/basic_auth/LDAP/squid_ldap_auth.c =================================================================== RCS file: /cvsroot/squid/squid/helpers/basic_auth/LDAP/squid_ldap_auth.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- squid/helpers/basic_auth/LDAP/squid_ldap_auth.c 1 Sep 2006 18:26:25 -0000 1.32 +++ squid/helpers/basic_auth/LDAP/squid_ldap_auth.c 1 Apr 2007 14:17:44 -0000 1.33 @@ -318,12 +318,12 @@ const unsigned char *p = (const unsigned char *) user; /* Leading whitespace? */ - if (isspace(p[0])) + if (xisspace(p[0])) return 0; while (p[0] && p[1]) { - if (isspace(p[0])) { + if (xisspace(p[0])) { /* More than one consequitive space? */ - if (isspace(p[1])) + if (xisspace(p[1])) return 0; /* or odd space type character used? */ if (p[0] != ' ') @@ -332,7 +332,7 @@ p++; } /* Trailing whitespace? */ - if (isspace(p[0])) + if (xisspace(p[0])) return 0; return 1; } Index: squid/helpers/negotiate_auth/mswin_sspi/libnegotiatessp.c =================================================================== RCS file: /cvsroot/squid/squid/helpers/negotiate_auth/mswin_sspi/libnegotiatessp.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- squid/helpers/negotiate_auth/mswin_sspi/libnegotiatessp.c 27 May 2006 08:58:30 -0000 1.1 +++ squid/helpers/negotiate_auth/mswin_sspi/libnegotiatessp.c 1 Apr 2007 14:17:45 -0000 1.2 @@ -53,7 +53,7 @@ ((unsigned int) p - (unsigned int) data)); } c = *p; - if (isalnum(c) == 0) { + if (xisalnum(c) == 0) { c = '.'; } /* store hex str (for left side) */ Index: squid/helpers/negotiate_auth/mswin_sspi/negotiate_auth.c =================================================================== RCS file: /cvsroot/squid/squid/helpers/negotiate_auth/mswin_sspi/negotiate_auth.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- squid/helpers/negotiate_auth/mswin_sspi/negotiate_auth.c 27 May 2006 08:58:30 -0000 1.1 +++ squid/helpers/negotiate_auth/mswin_sspi/negotiate_auth.c 1 Apr 2007 14:17:45 -0000 1.2 @@ -60,7 +60,7 @@ { char *p = string, c; while ((c = *p)) { - *p = toupper(c); + *p = xtoupper(c); p++; } } @@ -71,7 +71,7 @@ { char *p = string, c; while ((c = *p)) { - *p = tolower(c); + *p = xtolower(c); p++; } } Index: squid/helpers/ntlm_auth/fakeauth/fakeauth_auth.c =================================================================== RCS file: /cvsroot/squid/squid/helpers/ntlm_auth/fakeauth/fakeauth_auth.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- squid/helpers/ntlm_auth/fakeauth/fakeauth_auth.c 29 Aug 2006 15:44:49 -0000 1.11 +++ squid/helpers/ntlm_auth/fakeauth/fakeauth_auth.c 1 Apr 2007 14:17:46 -0000 1.12 @@ -91,7 +91,7 @@ (unsigned int) (p - (unsigned char *) data)); } c = *p; - if (isalnum(c) == 0) { + if (xisalnum(c) == 0) { c = '.'; } /* store hex str (for left side) */ Index: squid/helpers/ntlm_auth/mswin_sspi/libntlmssp.c =================================================================== RCS file: /cvsroot/squid/squid/helpers/ntlm_auth/mswin_sspi/libntlmssp.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- squid/helpers/ntlm_auth/mswin_sspi/libntlmssp.c 17 Sep 2006 09:23:52 -0000 1.2 +++ squid/helpers/ntlm_auth/mswin_sspi/libntlmssp.c 1 Apr 2007 14:17:48 -0000 1.3 @@ -361,7 +361,7 @@ ((unsigned int) p - (unsigned int) data)); } c = *p; - if (isalnum(c) == 0) { + if (xisalnum(c) == 0) { c = '.'; } /* store hex str (for left side) */ Index: squid/helpers/ntlm_auth/mswin_sspi/ntlm_auth.c =================================================================== RCS file: /cvsroot/squid/squid/helpers/ntlm_auth/mswin_sspi/ntlm_auth.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- squid/helpers/ntlm_auth/mswin_sspi/ntlm_auth.c 27 May 2006 08:58:30 -0000 1.1 +++ squid/helpers/ntlm_auth/mswin_sspi/ntlm_auth.c 1 Apr 2007 14:17:48 -0000 1.2 @@ -87,7 +87,7 @@ { char *p = string, c; while ((c = *p)) { - *p = toupper(c); + *p = xtoupper(c); p++; } } @@ -98,7 +98,7 @@ { char *p = string, c; while ((c = *p)) { - *p = tolower(c); + *p = xtolower(c); p++; } } Index: squid/lib/util.c =================================================================== RCS file: /cvsroot/squid/squid/lib/util.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -r1.94 -r1.95 --- squid/lib/util.c 18 Sep 2006 22:54:38 -0000 1.94 +++ squid/lib/util.c 1 Apr 2007 14:17:49 -0000 1.95 @@ -1,6 +1,6 @@ /* - * $Id: util.c,v 1.94 2006/09/18 22:54:38 hno Exp $ + * $Id: util.c,v 1.95 2007/04/01 14:17:49 serassio Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -643,7 +643,7 @@ { char *s = q; while (*s) { - *s = tolower((unsigned char) *s); + *s = xtolower(*s); s++; } } Index: squid/lib/win32lib.c =================================================================== RCS file: /cvsroot/squid/squid/lib/win32lib.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- squid/lib/win32lib.c 10 Dec 2006 13:36:24 -0000 1.3 +++ squid/lib/win32lib.c 1 Apr 2007 14:17:49 -0000 1.4 @@ -1,6 +1,6 @@ /* - * $Id: win32lib.c,v 1.3 2006/12/10 13:36:24 serassio Exp $ + * $Id: win32lib.c,v 1.4 2007/04/01 14:17:49 serassio Exp $ * * Windows support * AUTHOR: Guido Serassio @@ -117,7 +117,7 @@ s = nptr; do { c = *s++; - } while (isspace(c)); + } while (xisspace(c)); if (c == '-') { neg = 1; c = *s++; Index: squid/snmplib/parse.c =================================================================== RCS file: /cvsroot/squid/squid/snmplib/parse.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- squid/snmplib/parse.c 2 Jun 2006 17:32:44 -0000 1.31 +++ squid/snmplib/parse.c 1 Apr 2007 14:17:50 -0000 1.32 @@ -490,7 +490,7 @@ *cp = 0; ch = last; /* skip all white space */ - while (isspace(ch) && ch != -1) { + while (xisspace(ch) && ch != -1) { ch = getc(fp); if (ch == '\n') Line++; @@ -506,10 +506,10 @@ do { if (ch == '\n') Line++; - if (isspace(ch) || ch == '(' || ch == ')' || + if (xisspace(ch) || ch == '(' || ch == ')' || ch == '{' || ch == '}' || ch == ',' || ch == '"') { - if (!isspace(ch) && *token == 0) { + if (!xisspace(ch) && *token == 0) { hash += ch; *cp++ = ch; last = ' '; Index: squid/src/access_log.c =================================================================== RCS file: /cvsroot/squid/squid/src/access_log.c,v retrieving revision 1.97 retrieving revision 1.98 diff -u -r1.97 -r1.98 --- squid/src/access_log.c 28 Jan 2007 23:53:42 -0000 1.97 +++ squid/src/access_log.c 1 Apr 2007 14:17:50 -0000 1.98 @@ -1,6 +1,6 @@ /* - * $Id: access_log.c,v 1.97 2007/01/28 23:53:42 hno Exp $ + * $Id: access_log.c,v 1.98 2007/04/01 14:17:50 serassio Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -799,7 +799,7 @@ lt->zero = 1; cur++; } - if (isdigit((int) *cur)) + if (xisdigit(*cur)) lt->width = strtol(cur, &cur, 10); if (*cur == '.') lt->precision = strtol(cur + 1, &cur, 10); Index: squid/src/cache_cf.c =================================================================== RCS file: /cvsroot/squid/squid/src/cache_cf.c,v retrieving revision 1.465 retrieving revision 1.466 diff -u -r1.465 -r1.466 --- squid/src/cache_cf.c 25 Feb 2007 11:09:18 -0000 1.465 +++ squid/src/cache_cf.c 1 Apr 2007 14:17:50 -0000 1.466 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.465 2007/02/25 11:09:18 hno Exp $ + * $Id: cache_cf.c,v 1.466 2007/04/01 14:17:50 serassio Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -2273,7 +2273,7 @@ safe_free(*var); if (token == NULL) self_destruct(); - while (*token && isspace(*token)) + while (*token && xisspace(*token)) token++; if (!*token) self_destruct(); Index: squid/src/ftp.c =================================================================== RCS file: /cvsroot/squid/squid/src/ftp.c,v retrieving revision 1.346 retrieving revision 1.347 diff -u -r1.346 -r1.347 --- squid/src/ftp.c 19 Mar 2007 01:21:18 -0000 1.346 +++ squid/src/ftp.c 1 Apr 2007 14:17:50 -0000 1.347 @@ -1,6 +1,6 @@ /* - * $Id: ftp.c,v 1.346 2007/03/19 01:21:18 swilton Exp $ + * $Id: ftp.c,v 1.347 2007/04/01 14:17:50 serassio Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1033,7 +1033,7 @@ const char *t; if ((t = strRChr(request->urlpath, ';')) != NULL) { if (strncasecmp(t + 1, "type=", 5) == 0) { - ftpState->typecode = (char) toupper((int) *(t + 6)); + ftpState->typecode = (char) xtoupper(*(t + 6)); strCutPtr(request->urlpath, t); } } Index: squid/src/helper.c =================================================================== RCS file: /cvsroot/squid/squid/src/helper.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -r1.65 -r1.66 --- squid/src/helper.c 14 Mar 2007 12:06:31 -0000 1.65 +++ squid/src/helper.c 1 Apr 2007 14:17:50 -0000 1.66 @@ -1,6 +1,6 @@ /* - * $Id: helper.c,v 1.65 2007/03/14 12:06:31 hno Exp $ + * $Id: helper.c,v 1.66 2007/04/01 14:17:50 serassio Exp $ * * DEBUG: section 84 Helper process maintenance * AUTHOR: Harvest Derived? @@ -756,7 +756,7 @@ i = strtol(msg, &msg, 10); if (msg == srv->rbuf || errno) i = -1; - while (*msg && isspace((int) *msg)) + while (*msg && xisspace(*msg)) msg++; } if ((!hlp->concurrency) || (i >= 0 && i < hlp->concurrency)) Index: squid/src/tools.c =================================================================== RCS file: /cvsroot/squid/squid/src/tools.c,v retrieving revision 1.251 retrieving revision 1.252 diff -u -r1.251 -r1.252 --- squid/src/tools.c 21 Jan 2007 12:54:00 -0000 1.251 +++ squid/src/tools.c 1 Apr 2007 14:17:50 -0000 1.252 @@ -1,6 +1,6 @@ /* - * $Id: tools.c,v 1.251 2007/01/21 12:54:00 adrian Exp $ + * $Id: tools.c,v 1.252 2007/04/01 14:17:50 serassio Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -1211,7 +1211,7 @@ p = (unsigned char *) *t; if (!p) goto error; - while (*p && isspace(*p)) + while (*p && xisspace(*p)) p++; if (!*p) goto error; @@ -1240,7 +1240,7 @@ p++; break; default: - if (!quoted && isspace(*p)) { + if (!quoted && xisspace(*p)) { p++; goto done; } Index: squid/test-suite/pconn-banger.c =================================================================== RCS file: /cvsroot/squid/squid/test-suite/pconn-banger.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- squid/test-suite/pconn-banger.c 7 Jan 2001 09:55:24 -0000 1.8 +++ squid/test-suite/pconn-banger.c 1 Apr 2007 14:17:51 -0000 1.9 @@ -283,7 +283,7 @@ for (t = buf; t < end; t += strcspn(t, crlf), t += strspn(t, crlf)) { if (strncasecmp(t, hdr, strlen(hdr)) == 0) { t += strlen(hdr); - while (isspace(*t)) + while (xisspace(*t)) t++; return atoi(t); } @@ -299,7 +299,7 @@ for (t = buf; t < end; t += strcspn(t, crlf), t += strspn(t, crlf)) { if (strncasecmp(t, hdr, strlen(hdr)) == 0) { t += strlen(hdr); - while (isspace(*t)) + while (xisspace(*t)) t++; strcpy(result, ""); strncat(result, t, strcspn(t, crlf));