diff options
Diffstat (limited to 'WWW')
21 files changed, 160 insertions, 153 deletions
diff --git a/WWW/Library/Implementation/HTAccess.c b/WWW/Library/Implementation/HTAccess.c index 4d44a317..786c9619 100644 --- a/WWW/Library/Implementation/HTAccess.c +++ b/WWW/Library/Implementation/HTAccess.c @@ -1268,12 +1268,12 @@ PUBLIC BOOL HTSearch ARGS2( for (e = s + strlen(s); e > s && WHITE(*(e-1)); e--) /* Scan */ ; /* Skip trailers */ for (q = escaped, p = s; p < e; p++) { /* Scan stripped field */ - unsigned char c = (unsigned char)TOASCII(*p); + unsigned char c = UCH(TOASCII(*p)); if (WHITE(*p)) { *q++ = '+'; } else if (HTCJK != NOCJK) { *q++ = *p; - } else if (c>=32 && c<=(unsigned char)127 && isAcceptable[c-32]) { + } else if (c>=32 && c<=UCH(127) && isAcceptable[c-32]) { *q++ = *p; /* 930706 TBL for MVS bug */ } else { *q++ = '%'; diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index 42dcb4dc..e4373848 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -959,8 +959,8 @@ PUBLIC void HTAnchor_setTitle ARGS2( if (title) { StrAllocCopy(me->title, title); for (i = 0; me->title[i]; i++) { - if ((unsigned char)me->title[i] == 1 || - (unsigned char)me->title[i] == 2) { + if (UCH(me->title[i]) == 1 || + UCH(me->title[i]) == 2) { me->title[i] = ' '; } } @@ -985,8 +985,8 @@ PUBLIC void HTAnchor_appendTitle ARGS2( if (me) { StrAllocCat(me->title, title); for (i = 0; me->title[i]; i++) { - if ((unsigned char)me->title[i] == 1 || - (unsigned char)me->title[i] == 2) { + if (UCH(me->title[i]) == 1 || + UCH(me->title[i]) == 2) { me->title[i] = ' '; } } @@ -1043,8 +1043,8 @@ PUBLIC void HTAnchor_setRevTitle ARGS2( if (me) { StrAllocCopy(me->RevTitle, title); for (i = 0; me->RevTitle[i]; i++) { - if ((unsigned char)me->RevTitle[i] == 1 || - (unsigned char)me->RevTitle[i] == 2) { + if (UCH(me->RevTitle[i]) == 1 || + UCH(me->RevTitle[i]) == 2) { me->RevTitle[i] = ' '; } } diff --git a/WWW/Library/Implementation/HTAtom.c b/WWW/Library/Implementation/HTAtom.c index f2cfdffc..cb5fc7c4 100644 --- a/WWW/Library/Implementation/HTAtom.c +++ b/WWW/Library/Implementation/HTAtom.c @@ -36,7 +36,7 @@ PRIVATE void free_atoms NOPARAMS; /* * Alternate hashing function. */ -#define HASH_FUNCTION(cp_hash) ((strlen(cp_hash) * (unsigned char)*cp_hash) % HASH_SIZE) +#define HASH_FUNCTION(cp_hash) ((strlen(cp_hash) * UCH(*cp_hash)) % HASH_SIZE) PUBLIC HTAtom * HTAtom_for ARGS1(CONST char *, string) { diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index 82c8ccbf..49983c79 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -306,7 +306,7 @@ PRIVATE int next_data_char NOARGS return FROMASCII(c); } #else - return (unsigned char)(*data_read_pointer++); + return UCH(*data_read_pointer++); #endif /* NOT_ASCII */ } @@ -1408,7 +1408,7 @@ PRIVATE BOOLEAN is_ls_date ARGS1( char *, s) { /* must start with three alpha characters */ - if (!isalpha(*s++) || !isalpha(*s++) || !isalpha(*s++)) + if (!isalpha(UCH(*s++)) || !isalpha(UCH(*s++)) || !isalpha(UCH(*s++))) return FALSE; /* space or HT_NON_BREAK_SPACE */ @@ -1419,14 +1419,14 @@ PRIVATE BOOLEAN is_ls_date ARGS1( s++; /* space or digit */ - if (!(*s == ' ' || isdigit(*s))) { + if (!(*s == ' ' || isdigit(UCH(*s)))) { s++; return FALSE; } s++; /* digit */ - if (!isdigit(*s++)) + if (!isdigit(UCH(*s++))) return FALSE; /* space */ @@ -1434,29 +1434,29 @@ PRIVATE BOOLEAN is_ls_date ARGS1( return FALSE; /* space or digit */ - if (!(*s == ' ' || isdigit(*s))) { + if (!(*s == ' ' || isdigit(UCH(*s)))) { s++; return FALSE; } s++; /* digit */ - if (!isdigit(*s++)) + if (!isdigit(UCH(*s++))) return FALSE; /* colon or digit */ - if (!(*s == ':' || isdigit(*s))) { + if (!(*s == ':' || isdigit(UCH(*s)))) { s++; return FALSE; } s++; /* digit */ - if (!isdigit(*s++)) + if (!isdigit(UCH(*s++))) return FALSE; /* space or digit */ - if (!(*s == ' ' || isdigit(*s))) { + if (!(*s == ' ' || isdigit(UCH(*s)))) { s++; return FALSE; } @@ -1539,7 +1539,7 @@ PRIVATE void parse_ls_line ARGS2( int size_num=0; for (i = strlen(line) - 1; - (i > 13) && (!isspace(line[i]) || !is_ls_date(&line[i-12])); i--) + (i > 13) && (!isspace(UCH(line[i])) || !is_ls_date(&line[i-12])); i--) ; /* null body */ line[i] = '\0'; if (i > 13) { @@ -1555,7 +1555,7 @@ PRIVATE void parse_ls_line ARGS2( } } j = i - 14; - while (isdigit(line[j])) { + while (isdigit(UCH(line[j]))) { size_num += (line[j] - '0') * base; base *= 10; j--; @@ -1605,9 +1605,9 @@ PRIVATE void parse_dls_line ARGS3( return; } if (len < 24 || line[23] != ' ' || - (isspace(line[0]) && !*pspilledname)) { + (isspace(UCH(line[0])) && !*pspilledname)) { /* this isn't the expected "dls" format! */ - if (!isspace(line[0])) + if (!isspace(UCH(line[0]))) *cps = '\0'; if (*pspilledname && !*line) { entry_info->filename = *pspilledname; @@ -1631,7 +1631,7 @@ PRIVATE void parse_dls_line ARGS3( if (line[j] == '=' || line[j] == '-') { StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY); } else { - while (isdigit(line[j])) { + while (isdigit(UCH(line[j]))) { size_num += (line[j] - '0') * base; base *= 10; j--; @@ -1742,8 +1742,8 @@ PRIVATE void parse_vms_dir_entry ARGS2( /** Track down the date. **/ if ((cpd=strchr(cp, '-')) != NULL && - strlen(cpd) > 9 && isdigit(*(cpd-1)) && - isalpha(*(cpd+1)) && *(cpd+4) == '-') { + strlen(cpd) > 9 && isdigit(UCH(*(cpd-1))) && + isalpha(UCH(*(cpd+1))) && *(cpd+4) == '-') { /** Month **/ *(cpd+2) = (char) TOLOWER(*(cpd+2)); @@ -1751,7 +1751,7 @@ PRIVATE void parse_vms_dir_entry ARGS2( sprintf(date, "%.3s ", cpd+1); /** Day **/ - if (isdigit(*(cpd-2))) + if (isdigit(UCH(*(cpd-2)))) sprintf(date+4, "%.2s ", cpd-2); else sprintf(date+4, "%c%.1s ", HT_NON_BREAK_SPACE, cpd-1); @@ -1771,13 +1771,13 @@ PRIVATE void parse_vms_dir_entry ARGS2( if ((cpd=strchr(cp, '/')) != NULL) { /* Appears be in used/allocated format */ cps = cpd; - while (isdigit(*(cps-1))) + while (isdigit(UCH(*(cps-1)))) cps--; if (cps < cpd) *cpd = '\0'; entry_info->size = atoi(cps); cps = cpd+1; - while (isdigit(*cps)) + while (isdigit(UCH(*cps))) cps++; *cps = '\0'; ialloc = atoi(cpd+1); @@ -1790,7 +1790,7 @@ PRIVATE void parse_vms_dir_entry ARGS2( /* Now let's hunt for a lone, size number */ while ((cps=strtok(NULL, sp)) != NULL) { cpd = cps; - while (isdigit(*cpd)) + while (isdigit(UCH(*cpd))) cpd++; if (*cpd == '\0') { /* Assume it's blocks */ @@ -1839,7 +1839,7 @@ PRIVATE void parse_ms_windows_dir_entry ARGS2( cps = LYSkipBlanks(cps); cpd = LYSkipNonBlanks(cps); *cpd++ = '\0'; - if (isdigit(*cps)) { + if (isdigit(UCH(*cps))) { entry_info->size = atoi(cps); } else { StrAllocCopy(entry_info->type, ENTRY_IS_DIRECTORY); @@ -2057,7 +2057,7 @@ PRIVATE void parse_cms_dir_entry ARGS2( cp = LYSkipBlanks(cp); cps = LYSkipNonBlanks(cp); *cps++ = '\0'; - if (isdigit(*cp)) { + if (isdigit(UCH(*cp))) { RecordLength = atoi(cp); } } @@ -2068,7 +2068,7 @@ PRIVATE void parse_cms_dir_entry ARGS2( cp = LYSkipBlanks(cp); cps = LYSkipNonBlanks(cp); *cps++ = '\0'; - if (isdigit(*cp)) { + if (isdigit(UCH(*cp))) { Records = atoi(cp); } if (Records > 0 && RecordLength > 0) { @@ -2087,7 +2087,7 @@ PRIVATE void parse_cms_dir_entry ARGS2( if (((cps < end) && (cps = strchr(cpd, ':')) != NULL) && (cps < (end - 3) && - isdigit(*(cps+1)) && isdigit(*(cps+2)) && *(cps+3) == ':')) { + isdigit(UCH(*(cps+1))) && isdigit(UCH(*(cps+2))) && *(cps+3) == ':')) { cps += 3; *cps = '\0'; if ((cps - cpd) >= 14) { @@ -2269,7 +2269,7 @@ PRIVATE EntryInfo * parse_dir_entry ARGS3( ** Strip off " -> pathname". */ for (i = len - 1; (i > 3) && - (!isspace(entry[i]) || + (!isspace(UCH(entry[i])) || (entry[i-1] != '>') || (entry[i-2] != '-') || (entry[i-3] != ' ')); i--) diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c index c0a44bb3..41627cdb 100644 --- a/WWW/Library/Implementation/HTFile.c +++ b/WWW/Library/Implementation/HTFile.c @@ -264,7 +264,7 @@ PRIVATE void LYListFmtParse ARGS5( if (s == end) break; start = ++s; - while (isdigit(*s) || *s == '.' || *s == '-' || *s == ' ' || + while (isdigit(UCH(*s)) || *s == '.' || *s == '-' || *s == ' ' || *s == '#' || *s == '+' || *s == '\'') s++; c = *s; /* the format char. or \0 */ @@ -1037,7 +1037,7 @@ PUBLIC HTFormat HTCharsetFormat ARGS3( */ BOOL given_is_8859 = (BOOL) (!strncmp(cp4, "iso-8859-", 9) && - isdigit((unsigned char)cp4[9])); + isdigit(UCH(cp4[9]))); BOOL given_is_8859like = (BOOL) (given_is_8859 || !strncmp(cp4, "windows-", 8) || @@ -1057,7 +1057,7 @@ PUBLIC HTFormat HTCharsetFormat ARGS3( if (given_is_8859) { cp1 = &cp4[10]; while (*cp1 && - isdigit((unsigned char)(*cp1))) + isdigit(UCH(*cp1))) cp1++; *cp1 = '\0'; } diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c index 68b5f7c3..c589749d 100644 --- a/WWW/Library/Implementation/HTFormat.c +++ b/WWW/Library/Implementation/HTFormat.c @@ -256,7 +256,7 @@ PUBLIC int HTGetCharacter NOARGS ch = *input_pointer++; } while (ch == (char) 13); /* Ignore ASCII carriage return */ - return FROMASCII((unsigned char)ch); + return FROMASCII(UCH(ch)); } /* Match maintype to any MIME type starting with maintype, @@ -1007,7 +1007,7 @@ PUBLIC void HTCopyNoCR ARGS3( character = HTGetCharacter(); if (character == EOF) break; - (*targetClass.put_character)(sink, (unsigned char) character); + (*targetClass.put_character)(sink, UCH(character)); } } diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c index d960e373..33940a63 100644 --- a/WWW/Library/Implementation/HTGopher.c +++ b/WWW/Library/Implementation/HTGopher.c @@ -403,7 +403,7 @@ PRIVATE void parse_menu ARGS2( HTSprintf0(&address, "//%s/%c", host, gtype); for(r = selector; *r; r++) { /* Encode selector string */ - if (acceptable[(unsigned char)*r]) { + if (acceptable[UCH(*r)]) { HTSprintf(&address, "%c", *r); } else { HTSprintf(&address, "%c%c%c", diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c index 2e555000..c0b0e89b 100644 --- a/WWW/Library/Implementation/HTMIME.c +++ b/WWW/Library/Implementation/HTMIME.c @@ -285,7 +285,7 @@ PRIVATE int pumpData ARGS1(HTStream *, me) */ BOOL given_is_8859 = (BOOL) (!strncmp(cp4, "iso-8859-", 9) && - isdigit((unsigned char)cp4[9])); + isdigit(UCH(cp4[9]))); BOOL given_is_8859like = (BOOL) (given_is_8859 || !strncmp(cp4, "windows-", 8) || @@ -305,7 +305,7 @@ PRIVATE int pumpData ARGS1(HTStream *, me) if (given_is_8859) { cp1 = &cp4[10]; while (*cp1 && - isdigit((unsigned char)(*cp1))) + isdigit(UCH(*cp1))) cp1++; *cp1 = '\0'; } @@ -507,9 +507,9 @@ PRIVATE int dispatchField ARGS1(HTStream *, me) cp1++; while (*cp1 != '\0' && WHITE(*cp1)) cp1++; - if (isdigit((unsigned char)*cp1)) { + if (isdigit(UCH(*cp1))) { cp0 = cp1; - while (isdigit((unsigned char)*cp1)) + while (isdigit(UCH(*cp1))) cp1++; if (*cp0 == '0' && cp1 == (cp0 + 1)) { me->anchor->no_cache = TRUE; diff --git a/WWW/Library/Implementation/HTMLDTD.h b/WWW/Library/Implementation/HTMLDTD.h index d732e7b4..9c44e2c2 100644 --- a/WWW/Library/Implementation/HTMLDTD.h +++ b/WWW/Library/Implementation/HTMLDTD.h @@ -16,10 +16,10 @@ #include <HTFont.h> /* -** Valid mane chars for tag parsing. +** Valid name chars for tag parsing. */ -#define IsNmStart(c) (isalpha((unsigned char)c)) -#define IsNmChar(c) (isalnum((unsigned char)c) || \ +#define IsNmStart(c) (isalpha(UCH(c))) +#define IsNmChar(c) (isalnum(UCH(c)) || \ c == '_' || c=='-' || c == '.' || c==':') diff --git a/WWW/Library/Implementation/HTMLGen.c b/WWW/Library/Implementation/HTMLGen.c index 86f06c2a..ae94493a 100644 --- a/WWW/Library/Implementation/HTMLGen.c +++ b/WWW/Library/Implementation/HTMLGen.c @@ -180,7 +180,7 @@ PRIVATE void HTMLGen_put_character ARGS2( HTStructured *, me, char, c) { - if (me->escape_specials && (unsigned char)c < 32) { + if (me->escape_specials && UCH(c) < 32) { if (c == HT_NON_BREAK_SPACE || c == HT_EN_SPACE || c == LY_SOFT_HYPHEN) { /* recursion... */ HTMLGen_put_character(me, '&'); diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c index 41506116..ded9af8c 100644 --- a/WWW/Library/Implementation/HTNews.c +++ b/WWW/Library/Implementation/HTNews.c @@ -616,9 +616,9 @@ PRIVATE char * author_address ARGS1(char *,email) if ((at = strrchr(address, '@')) && at > address) { p = (at - 1); e = (at + 1); - while (p > address && !isspace((unsigned char)*p)) + while (p > address && !isspace(UCH(*p))) p--; - while (*e && !isspace((unsigned char)*e)) + while (*e && !isspace(UCH(*e))) e++; *e = 0; return HTStrip(p); @@ -628,10 +628,10 @@ PRIVATE char * author_address ARGS1(char *,email) ** Default to the first word. */ p = address; - while (isspace((unsigned char)*p)) + while (isspace(UCH(*p))) p++; /* find first non-space */ e = p; - while (!isspace((unsigned char)*e) && *e != '\0') + while (!isspace(UCH(*e)) && *e != '\0') e++; /* find next space or end */ *e = '\0'; /* terminate space */ @@ -799,7 +799,7 @@ PRIVATE BOOLEAN valid_header ARGS1( */ colon = strchr(line, ':'); space = strchr(line, ' '); - if (isalpha(line[0]) && colon && space == colon + 1) + if (isalpha(UCH(line[0])) && colon && space == colon + 1) return(TRUE); /* @@ -1085,11 +1085,11 @@ PRIVATE int read_article ARGS1( /* ** End of article? */ - if ((unsigned char)full_line[1] < ' ') { + if (UCH(full_line[1]) < ' ') { done = YES; break; } - } else if ((unsigned char)full_line[0] < ' ') { + } else if (UCH(full_line[0]) < ' ') { break; /* End of Header? */ } else if (match(full_line, "SUBJECT:")) { @@ -1401,7 +1401,7 @@ PRIVATE int read_article ARGS1( /* ** End of article? */ - if ((unsigned char)line[1] < ' ') { + if (UCH(line[1]) < ' ') { done = YES; break; } else { /* Line starts with dot */ @@ -1638,7 +1638,7 @@ PRIVATE int read_list ARGS1(char *, arg) /* ** End of article? */ - if ((unsigned char)line[1] < ' ') { + if (UCH(line[1]) < ' ') { done = YES; break; } else { /* Line starts with dot */ @@ -1838,7 +1838,7 @@ PRIVATE int read_group ARGS3( /* ** End of article? */ - if ((unsigned char)line[1] < ' ') { + if (UCH(line[1]) < ' ') { done = YES; break; } else { /* Line starts with dot */ @@ -1947,7 +1947,7 @@ PRIVATE int read_group ARGS3( /* ** End of article? */ - done = (BOOL) ((unsigned char)line[1] < ' '); + done = (BOOL) (UCH(line[1]) < ' '); break; case 'S': @@ -2413,7 +2413,7 @@ PRIVATE int HTLoadNews ARGS4( LYstrncpy(groupName, p1, sizeof(groupName) - 1); *slash = '/'; (void)sscanf(slash+1, "%d-%d", &first, &last); - if ((first > 0) && (isdigit(*(slash+1))) && + if ((first > 0) && (isdigit(UCH(*(slash+1)))) && (strchr(slash+1, '-') == NULL || first == last)) { /* ** We got a number greater than 0, which will be diff --git a/WWW/Library/Implementation/HTParse.c b/WWW/Library/Implementation/HTParse.c index 8a4a9ede..c7255995 100644 --- a/WWW/Library/Implementation/HTParse.c +++ b/WWW/Library/Implementation/HTParse.c @@ -292,7 +292,7 @@ PUBLIC char * HTParse ARGS3( if ((p2 = strchr(result, '@')) != NULL) tail = (p2 + 1); p2 = strchr(tail, ':'); - if (p2 != NULL && !isdigit((unsigned char)p2[1])) + if (p2 != NULL && !isdigit(UCH(p2[1]))) /* ** Colon not followed by a port number. */ @@ -732,7 +732,7 @@ PUBLIC char * HTEscape ARGS2( char * result; int unacceptable = 0; for (p = str; *p; p++) - if (!ACCEPTABLE((unsigned char)TOASCII(*p))) + if (!ACCEPTABLE(UCH(TOASCII(*p)))) unacceptable++; result = (char *)calloc(1, (p-str + unacceptable + unacceptable + 1)); if (result == NULL) @@ -770,7 +770,7 @@ PUBLIC char * HTEscapeSP ARGS2( char * result; int unacceptable = 0; for (p = str; *p; p++) - if (!(*p == ' ' || ACCEPTABLE((unsigned char)TOASCII(*p)))) + if (!(*p == ' ' || ACCEPTABLE(UCH(TOASCII(*p))))) unacceptable++; result = (char *)calloc(1, (p-str + unacceptable + unacceptable + 1)); if (result == NULL) @@ -822,8 +822,8 @@ PUBLIC char * HTUnEscape ARGS1( * Tests shouldn't be needed, but better safe than sorry. */ p[1] && p[2] && - isxdigit((unsigned char)p[1]) && - isxdigit((unsigned char)p[2])) { + isxdigit(UCH(p[1])) && + isxdigit(UCH(p[2]))) { p++; if (*p) *q = (char) (from_hex(*p++) * 16); @@ -869,8 +869,8 @@ PUBLIC char * HTUnEscapeSome ARGS2( while (*p != '\0') { if (*p == HEX_ESCAPE && p[1] && p[2] && /* tests shouldn't be needed, but.. */ - isxdigit((unsigned char)p[1]) && - isxdigit((unsigned char)p[2]) && + isxdigit(UCH(p[1])) && + isxdigit(UCH(p[2])) && (testcode = (char) FROMASCII(from_hex(p[1])*16 + from_hex(p[2]))) && /* %00 no good*/ strchr(do_trans, testcode)) { /* it's one of the ones we want */ diff --git a/WWW/Library/Implementation/HTParse.h b/WWW/Library/Implementation/HTParse.h index 2f3c522c..0f433bb0 100644 --- a/WWW/Library/Implementation/HTParse.h +++ b/WWW/Library/Implementation/HTParse.h @@ -36,9 +36,9 @@ ** The following are valid mask values. The terms are the BNF names ** in the URL document. */ -#define URL_XALPHAS (unsigned char) 1 -#define URL_XPALPHAS (unsigned char) 2 -#define URL_PATH (unsigned char) 4 +#define URL_XALPHAS UCH(1) +#define URL_XPALPHAS UCH(2) +#define URL_PATH UCH(4) /* Strip white space off a string. HTStrip() diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c index 4e5cbb56..1ef4ca57 100644 --- a/WWW/Library/Implementation/HTPlain.c +++ b/WWW/Library/Implementation/HTPlain.c @@ -135,10 +135,10 @@ PRIVATE void HTPlain_put_character ARGS2( HTPlain_write(me, &c, 1); return; } - HTPlain_lastraw = (unsigned char)c; + HTPlain_lastraw = UCH(c); if (c == '\r') { HText_appendCharacter(me->text, '\n'); - } else if (TOASCII((unsigned char)c) >= 127) { /* S/390 -- gil -- 0305 */ + } else if (TOASCII(UCH(c)) >= 127) { /* S/390 -- gil -- 0305 */ /* ** For now, don't repeat everything here ** that has been done below - KW @@ -146,23 +146,23 @@ PRIVATE void HTPlain_put_character ARGS2( HTPlain_write(me, &c, 1); } else if (HTCJK != NOCJK) { HText_appendCharacter(me->text, c); - } else if (TOASCII((unsigned char)c) >= 127 && TOASCII((unsigned char)c) < 161 && + } else if (TOASCII(UCH(c)) >= 127 && TOASCII(UCH(c)) < 161 && HTPassHighCtrlRaw) { HText_appendCharacter(me->text, c); - } else if ((unsigned char)c == CH_NBSP) { /* S/390 -- gil -- 0341 */ + } else if (UCH(c) == CH_NBSP) { /* S/390 -- gil -- 0341 */ HText_appendCharacter(me->text, ' '); - } else if ((unsigned char)c == CH_SHY) { + } else if (UCH(c) == CH_SHY) { return; - } else if (((unsigned char)c >= ' ' && TOASCII((unsigned char)c) < 127) || + } else if ((UCH(c) >= ' ' && TOASCII(UCH(c)) < 127) || c == '\n' || c == '\t') { HText_appendCharacter(me->text, c); - } else if (TOASCII((unsigned char)c) > 160) { + } else if (TOASCII(UCH(c)) > 160) { if (!HTPassEightBitRaw && !((me->outUCLYhndl == LATIN1) || (me->outUCI->enc & (UCT_CP_SUPERSETOF_LAT1)))) { int len, high, low, i, diff = 1; CONST char * name; - UCode_t value = (UCode_t)FROMASCII((TOASCII((unsigned char)c) - 160)); + UCode_t value = (UCode_t)FROMASCII((TOASCII(UCH(c)) - 160)); name = HTMLGetEntityName(value); len = strlen(name); @@ -233,7 +233,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) } #else if (*p == '\b') { - if (HTPlain_lastraw >= (unsigned char)' ' && + if (HTPlain_lastraw >= UCH(' ') && HTPlain_lastraw != '\r' && HTPlain_lastraw != '\n') { if (!HTPlain_bs_pending) { HTPlain_bs_pending = 1; @@ -249,12 +249,12 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) } else if (*p == '_') { if (!HTPlain_bs_pending) { HTPlain_bs_pending = 2; - HTPlain_lastraw = (unsigned char)*p; + HTPlain_lastraw = UCH(*p); continue; #if 0 } else if (HTPlain_bs_pending != 2) { HTPlain_bs_pending--; /* 1 -> 0, 3 -> 2 */ - HTPlain_lastraw = (unsigned char)*p; + HTPlain_lastraw = UCH(*p); continue; #endif } @@ -272,9 +272,9 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) } if (HTPlain_bs_pending && - !((unsigned char)*p >= ' ' && *p != '\r' && *p != '\n' && - (HTPlain_lastraw == (unsigned char)*p || - HTPlain_lastraw == (unsigned char)'_' || + !(UCH(*p) >= ' ' && *p != '\r' && *p != '\n' && + (HTPlain_lastraw == UCH(*p) || + HTPlain_lastraw == UCH('_') || *p == '_'))) { if (HTPlain_bs_pending >= 2) HText_appendCharacter(me->text, '_'); @@ -298,7 +298,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) } else { HTPlain_bs_pending = 0; } - HTPlain_lastraw = (unsigned char)*p; + HTPlain_lastraw = UCH(*p); if (*p == '\r') { HText_appendCharacter(me->text, '\n'); continue; @@ -308,7 +308,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) ** whenever that's appropriate. - FM */ c = *p; - c_unsign = (unsigned char)c; + c_unsign = UCH(c); code = (UCode_t)c_unsign; saved_char_in = '\0'; /* @@ -343,7 +343,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) code = me->utf_char; if (code > 0 && code < 256) { c = FROMASCII((char)code); - c_unsign = (unsigned char)c; + c_unsign = UCH(c); } } else { /* @@ -409,7 +409,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) ** to Unicode (if appropriate). - FM */ if (!(me->T.decode_utf8 && - (unsigned char)(*p) > 127)) { + UCH(*p) > 127)) { #ifdef NOTDEFINED if (me->T.strip_raw_char_in) saved_char_in = c; @@ -426,7 +426,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) saved_char_in = c; if (code < 256) { c = FROMASCII((char)code); - c_unsign = (unsigned char)c; + c_unsign = UCH(c); } } } else if (code < 32 && code != 0 && @@ -442,7 +442,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) saved_char_in = c; if (code < 256) { c = FROMASCII((char)code); - c_unsign = (unsigned char)c; + c_unsign = UCH(c); } } else { uck = -1; @@ -460,7 +460,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) continue; } else if (uck < 0) { me->utf_buf[0] = '\0'; - code = (unsigned char)c; + code = UCH(c); } else { c = replace_buf[0]; if (c && replace_buf[1]) { @@ -469,11 +469,11 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) } } me->utf_buf[0] = '\0'; - code = (unsigned char)c; + code = UCH(c); } /* Next line end of ugly stuff for C0. - KW */ } else { me->utf_buf[0] = '\0'; - code = (unsigned char)c; + code = UCH(c); } } /* @@ -588,8 +588,8 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l) } #ifdef NOTDEFINED } else if (me->T.strip_raw_char_in && - (unsigned char)*p >= 192 && - (unsigned char)*p < 255) { + UCH(*p) >= 192 && + UCH(*p) < 255) { /* ** KOI special: strip high bit, gives ** (somewhat) readable ASCII. diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c index c57d51c4..b81e60d1 100644 --- a/WWW/Library/Implementation/HTString.c +++ b/WWW/Library/Implementation/HTString.c @@ -215,7 +215,7 @@ PUBLIC int AS_casecomp ARGS2( for ( ; ; p++, q++) { if (!(*p && *q)) - return ((unsigned char) *p - (unsigned char) *q); + return (UCH(*p) - UCH(*q)); diff = TOASCII(TOLOWER(*p)) - TOASCII(TOLOWER(*q)); if (diff) @@ -239,7 +239,7 @@ PUBLIC int AS_ncmp ARGS3( for ( ; (p-a) < n; p++, q++) { if (!(*p && *q)) - return ((unsigned char) *p - (unsigned char) *q); + return (UCH(*p) - UCH(*q)); diff = TOASCII(*p) - TOASCII(*q); if (diff) @@ -599,7 +599,7 @@ PUBLIC_IF_FIND_LEAKS char * StrAllocVsprintf ARGS4( while (*++fmt != '\0' && !done) { fmt_ptr[f++] = *fmt; - if (isdigit(*fmt)) { + if (isdigit(UCH(*fmt))) { int num = *fmt - '0'; if (state == Flags && num != 0) state = Width; @@ -623,7 +623,7 @@ PUBLIC_IF_FIND_LEAKS char * StrAllocVsprintf ARGS4( } sprintf(&fmt_ptr[--f], "%d", ival); f = strlen(fmt_ptr); - } else if (isalpha(*fmt)) { + } else if (isalpha(UCH(*fmt))) { done = TRUE; switch (*fmt) { case 'Z': /* FALLTHRU */ @@ -847,7 +847,7 @@ PUBLIC char *HTQuoteParameter ARGS1( for (i=0; i < last; ++i) if (strchr("\\&#$^*?(){}<>\"';`|", parameter[i]) != 0 - || isspace(parameter[i])) + || isspace(UCH(parameter[i]))) ++quoted; result = (char *)malloc(last + 5*quoted + 3); diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index 673e4727..c4fae8f2 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -360,7 +360,7 @@ PUBLIC BOOL valid_hostname ARGS1( } else if (++iseg > 63) { return NO; } - if (!isalnum((unsigned char)*cp) && + if (!isalnum(UCH(*cp)) && *cp != '-' && *cp != '_' && *cp != '$' && *cp != '+') { return NO; @@ -1282,7 +1282,7 @@ PRIVATE int HTParseInet ARGS2( while (*strptr) { if (*strptr == '.') { dotcount_ip++; - } else if (!isdigit(*strptr)) { + } else if (!isdigit(UCH(*strptr))) { break; } strptr++; diff --git a/WWW/Library/Implementation/HTTelnet.c b/WWW/Library/Implementation/HTTelnet.c index 9f5f3a14..393e6051 100644 --- a/WWW/Library/Implementation/HTTelnet.c +++ b/WWW/Library/Implementation/HTTelnet.c @@ -70,7 +70,7 @@ PRIVATE int remote_session ARGS2(char *, acc_method, char *, host) */ for(cp = (strchr(host, '@') ? strchr(host, '@') : host); *cp != '\0'; cp++) { - if(!isalnum(*cp) && *cp != '_' && *cp != '-' && + if(!isalnum(UCH(*cp)) && *cp != '_' && *cp != '-' && *cp != ':' && *cp != '.' && *cp != '@') { *cp = '\0'; break; diff --git a/WWW/Library/Implementation/HTUU.c b/WWW/Library/Implementation/HTUU.c index 76ce8117..580be9da 100644 --- a/WWW/Library/Implementation/HTUU.c +++ b/WWW/Library/Implementation/HTUU.c @@ -147,7 +147,7 @@ PUBLIC int HTUU_decode ARGS3(char *, bufcoded, first = 0; for(j=0; j<256; j++) pr2six[j] = MAXVAL+1; - for(j=0; j<64; j++) pr2six[(unsigned char)six2pr[j]] = (unsigned char)j; + for(j=0; j<64; j++) pr2six[UCH(six2pr[j])] = UCH(j); #if 0 pr2six['A']= 0; pr2six['B']= 1; pr2six['C']= 2; pr2six['D']= 3; pr2six['E']= 4; pr2six['F']= 5; pr2six['G']= 6; pr2six['H']= 7; @@ -177,7 +177,7 @@ PUBLIC int HTUU_decode ARGS3(char *, bufcoded, * the output buffer, adjust the number of input bytes downwards. */ bufin = bufcoded; - while(pr2six[(unsigned char)*(bufin++)] <= MAXVAL); + while(pr2six[UCH(*(bufin++))] <= MAXVAL); nprbytes = bufin - bufcoded - 1; nbytesdecoded = ((nprbytes+3)/4) * 3; if(nbytesdecoded > outbufsize) { @@ -187,9 +187,9 @@ PUBLIC int HTUU_decode ARGS3(char *, bufcoded, bufin = bufcoded; while (nprbytes > 0) { - *(bufout++) = (unsigned char) ((DEC(*bufin) << 2) | (DEC(bufin[1]) >> 4)); - *(bufout++) = (unsigned char) ((DEC(bufin[1]) << 4) | (DEC(bufin[2]) >> 2)); - *(bufout++) = (unsigned char) ((DEC(bufin[2]) << 6) | (DEC(bufin[3]))); + *(bufout++) = UCH((DEC(bufin[0]) << 2) | (DEC(bufin[1]) >> 4)); + *(bufout++) = UCH((DEC(bufin[1]) << 4) | (DEC(bufin[2]) >> 2)); + *(bufout++) = UCH((DEC(bufin[2]) << 6) | (DEC(bufin[3]))); bufin += 4; nprbytes -= 4; } diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h index 686d784c..aaef1923 100644 --- a/WWW/Library/Implementation/HTUtils.h +++ b/WWW/Library/Implementation/HTUtils.h @@ -358,12 +358,12 @@ extern BOOL LYOutOfMemory; /* Declared in LYexit.c - FM */ /* Inline Function WHITE: Is character c white space? */ /* For speed, include all control characters */ -#define WHITE(c) (((unsigned char)(TOASCII(c))) <= 32) +#define WHITE(c) ((UCH(TOASCII(c))) <= 32) /* Inline Function LYIsASCII: Is character c a traditional ASCII ** character (i.e. <128) after converting from host character set. */ -#define LYIsASCII(c) (TOASCII((unsigned char)(c)) < 128) +#define LYIsASCII(c) (TOASCII(UCH(c)) < 128) /* @@ -454,8 +454,8 @@ Upper- and Lowercase macros #ifndef TOLOWER /* Pyramid and Mips can't uppercase non-alpha */ -#define TOLOWER(c) (isupper((unsigned char)c) ? tolower((unsigned char)c) : ((unsigned char)c)) -#define TOUPPER(c) (islower((unsigned char)c) ? toupper((unsigned char)c) : ((unsigned char)c)) +#define TOLOWER(c) (isupper(UCH(c)) ? tolower(UCH(c)) : UCH(c)) +#define TOUPPER(c) (islower(UCH(c)) ? toupper(UCH(c)) : UCH(c)) #endif /* TOLOWER */ #define FREE(x) if (x != 0) {free((char *)x); x = NULL;} diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c index efa921dc..430e36d0 100644 --- a/WWW/Library/Implementation/SGML.c +++ b/WWW/Library/Implementation/SGML.c @@ -1482,7 +1482,7 @@ PRIVATE void SGML_character ARGS2( #endif c = c_in; - clong = (unsigned char)c; /* a.k.a. unsign_c */ + clong = UCH(c); /* a.k.a. unsign_c */ if (context->T.decode_utf8) { /* @@ -1490,7 +1490,7 @@ PRIVATE void SGML_character ARGS2( ** Incomplete characters silently ignored. ** From Linux kernel's console.c. - KW */ - if (TOASCII((unsigned char)c) > 127) { /* S/390 -- gil -- 0710 */ + if (TOASCII(UCH(c)) > 127) { /* S/390 -- gil -- 0710 */ /* ** We have an octet from a multibyte character. - FM */ @@ -1669,7 +1669,7 @@ top: */ top0a: *(context->utf_buf) = '\0'; - clong = (unsigned char)c; + clong = UCH(c); /* ** We jump to here from above if we have converted ** the input, or a multibyte sequence across calls, @@ -1704,7 +1704,7 @@ top1: sjis_1st = '\0'; } else { if (context->state == S_text) { - if (0xA1 <= (unsigned char)c && (unsigned char)c <= 0xDF) { + if (0xA1 <= UCH(c) && UCH(c) <= 0xDF) { JISx0201TO0208_SJIS(c, &sjis_hi, &sjis_lo); PUTC(sjis_hi); PUTC(sjis_lo); @@ -1739,7 +1739,7 @@ top1: * we have to care them here. -- TH */ if ((HTCJK==JAPANESE) && (context->state==S_in_kanji) && - !IS_JAPANESE_2BYTE(context->kanji_buf,(unsigned char)c)) { + !IS_JAPANESE_2BYTE(context->kanji_buf, UCH(c))) { #ifdef CONV_JISX0201KANA_JISX0208KANA if (IS_SJIS_X0201KANA(context->kanji_buf)) { unsigned char sjis_hi, sjis_lo; @@ -1900,9 +1900,9 @@ top1: PUTC(c); } else if (clong == 0xfffd && saved_char_in && HTPassEightBitRaw && - (unsigned char)saved_char_in >= + UCH(saved_char_in) >= LYlowest_eightbit[context->outUCLYhndl]) { - PUTUTF8((0xf000 | (unsigned char)saved_char_in)); + PUTUTF8((0xf000 | UCH(saved_char_in))); } else { PUTUTF8(clong); } @@ -2042,8 +2042,8 @@ top1: ** Check for a strippable koi8-r 8-bit character. - FM */ } else if (context->T.strip_raw_char_in && saved_char_in && - ((unsigned char)saved_char_in >= 0xc0) && - ((unsigned char)saved_char_in < 255)) { + (UCH(saved_char_in) >= 0xc0) && + (UCH(saved_char_in) < 255)) { /* ** KOI8 special: strip high bit, gives (somewhat) readable ** ASCII or KOI7 - it was constructed that way! - KW @@ -2055,7 +2055,7 @@ top1: ** If we don't actually want the character, ** make it safe and output that now. - FM */ - } else if (TOASCII((unsigned char)c) < /* S/390 -- gil -- 0997 */ + } else if (TOASCII(UCH(c)) < /* S/390 -- gil -- 0997 */ LYlowest_eightbit[context->outUCLYhndl] || (context->T.trans_from_uni && !HTPassEightBitRaw)) { #ifdef NOTUSED_FOTEMODS @@ -2245,7 +2245,7 @@ top1: */ case S_entity: if (TOASCII(unsign_c) < 127 && (string->size ? /* S/390 -- gil -- 1029 */ - isalnum((unsigned char)c) : isalpha((unsigned char)c))) { + isalnum(UCH(c)) : isalpha(UCH(c)))) { /* Should probably use IsNmStart/IsNmChar above (is that right?), but the world is not ready for that - there's  : (note colon!) and stuff around. */ @@ -2331,10 +2331,10 @@ top1: ** Check for a numeric entity. */ case S_cro: - if (TOASCII(unsign_c) < 127 && TOLOWER((unsigned char)c) == 'x') { /* S/390 -- gil -- 1060 */ + if (TOASCII(unsign_c) < 127 && TOLOWER(UCH(c)) == 'x') { /* S/390 -- gil -- 1060 */ context->isHex = TRUE; context->state = S_incro; - } else if (TOASCII(unsign_c) < 127 && isdigit((unsigned char)c)) { + } else if (TOASCII(unsign_c) < 127 && isdigit(UCH(c))) { /* ** Accept only valid ASCII digits. - FM */ @@ -2368,8 +2368,8 @@ top1: /* S/390 -- gil -- 1075 */ /* CTRACE((tfp, "%s: %d: numeric %d %d\n", __FILE__, __LINE__, unsign_c, c)); */ if ((TOASCII(unsign_c) < 127) && - (context->isHex ? isxdigit((unsigned char)c) : - isdigit((unsigned char)c))) { + (context->isHex ? isxdigit(UCH(c)) : + isdigit(UCH(c)))) { /* ** Accept only valid hex or ASCII digits. - FM */ @@ -3254,7 +3254,7 @@ top1: break; } context->first_dash = FALSE; - if (context->end_comment && !isspace(c)) + if (context->end_comment && !isspace(UCH(c))) context->end_comment = FALSE; S_comment_put_c: @@ -3268,10 +3268,10 @@ top1: context->T.trans_from_uni)) { if (clong == 0xfffd && saved_char_in && HTPassEightBitRaw && - (unsigned char)saved_char_in >= + UCH(saved_char_in) >= LYlowest_eightbit[context->outUCLYhndl]) { HTChunkPutUtf8Char(string, - (0xf000 | (unsigned char)saved_char_in)); + (0xf000 | UCH(saved_char_in))); } else { HTChunkPutUtf8Char(string, clong); } @@ -3682,10 +3682,10 @@ top1: context->T.trans_from_uni)) { if (clong == 0xfffd && saved_char_in && HTPassEightBitRaw && - (unsigned char)saved_char_in >= + UCH(saved_char_in) >= LYlowest_eightbit[context->outUCLYhndl]) { HTChunkPutUtf8Char(string, - (0xf000 | (unsigned char)saved_char_in)); + (0xf000 | UCH(saved_char_in))); } else { HTChunkPutUtf8Char(string, clong); } @@ -3744,10 +3744,10 @@ top1: context->T.trans_from_uni)) { if (clong == 0xfffd && saved_char_in && HTPassEightBitRaw && - (unsigned char)saved_char_in >= + UCH(saved_char_in) >= LYlowest_eightbit[context->outUCLYhndl]) { HTChunkPutUtf8Char(string, - (0xf000 | (unsigned char)saved_char_in)); + (0xf000 | UCH(saved_char_in))); } else { HTChunkPutUtf8Char(string, clong); } @@ -3811,10 +3811,10 @@ top1: context->T.trans_from_uni)) { if (clong == 0xfffd && saved_char_in && HTPassEightBitRaw && - (unsigned char)saved_char_in >= + UCH(saved_char_in) >= LYlowest_eightbit[context->outUCLYhndl]) { HTChunkPutUtf8Char(string, - (0xf000 | (unsigned char)saved_char_in)); + (0xf000 | UCH(saved_char_in))); } else { HTChunkPutUtf8Char(string, clong); } @@ -4609,15 +4609,15 @@ PUBLIC unsigned char * SJIS_TO_JIS1 ARGS3( register unsigned char, LO, register unsigned char *, JCODE) { - HI -= (unsigned char) ((HI <= 0x9F) ? 0x71 : 0xB1); - HI = (unsigned char) ((HI << 1) + 1); + HI -= UCH((HI <= 0x9F) ? 0x71 : 0xB1); + HI = UCH((HI << 1) + 1); if (0x7F < LO) LO--; if (0x9E <= LO) { - LO -= (unsigned char) 0x7D; + LO -= UCH(0x7D); HI++; } else { - LO -= (unsigned char) 0x1F; + LO -= UCH(0x1F); } JCODE[0] = HI; JCODE[1] = LO; @@ -4630,15 +4630,15 @@ PUBLIC unsigned char * JIS_TO_SJIS1 ARGS3( register unsigned char *, SJCODE) { if (HI & 1) - LO += (unsigned char) 0x1F; + LO += UCH(0x1F); else - LO += (unsigned char) 0x7D; + LO += UCH(0x7D); if (0x7F <= LO) LO++; - HI = (unsigned char) (((HI - 0x21) >> 1) + 0x81); + HI = UCH(((HI - 0x21) >> 1) + 0x81); if (0x9F < HI) - HI += (unsigned char) 0x40; + HI += UCH(0x40); SJCODE[0] = HI; SJCODE[1] = LO; return SJCODE; @@ -4651,7 +4651,7 @@ PUBLIC unsigned char * EUC_TO_SJIS1 ARGS3( { if (HI == 0x8E) JISx0201TO0208_EUC(HI, LO, &HI, &LO); - JIS_TO_SJIS1((unsigned char) (HI & 0x7F), (unsigned char) (LO & 0x7F), SJCODE); + JIS_TO_SJIS1(UCH(HI & 0x7F), UCH(LO & 0x7F), SJCODE); return SJCODE; } @@ -4663,7 +4663,7 @@ PUBLIC void JISx0201TO0208_SJIS ARGS3( unsigned char SJCODE[2]; JISx0201TO0208_EUC(0x8E, I, OHI, OLO); - JIS_TO_SJIS1((unsigned char)(*OHI & 0x7F), (unsigned char)(*OLO & 0x7F), SJCODE); + JIS_TO_SJIS1(UCH(*OHI & 0x7F), UCH(*OLO & 0x7F), SJCODE); *OHI = SJCODE[0]; *OLO = SJCODE[1]; } @@ -4711,7 +4711,7 @@ PUBLIC unsigned char * EUC_TO_SJIS ARGS2( for (sp = src, dp = dst; *sp;) { if (*sp & 0x80) { if (sp[1] && (sp[1] & 0x80)) { - JIS_TO_SJIS1((unsigned char)(sp[0] & 0x7F), (unsigned char)(sp[1] & 0x7F), dp); + JIS_TO_SJIS1(UCH(sp[0] & 0x7F), UCH(sp[1] & 0x7F), dp); dp += 2; sp += 2; } else { @@ -4749,16 +4749,16 @@ PUBLIC unsigned char *EUC_TO_JIS ARGS4( continue; } if (!kana_mode) { - kana_mode = (unsigned char) ~kana_mode; + kana_mode = UCH(~kana_mode); dp = Strcpy(dp, toK); } if (*sp & 0x80) { - *dp++ = (unsigned char) (cch & ~0x80); - *dp++ = (unsigned char) (*sp++ & ~0x80); + *dp++ = UCH(cch & ~0x80); + *dp++ = UCH(*sp++ & ~0x80); } } else { if (kana_mode) { - kana_mode = (unsigned char) ~kana_mode; + kana_mode = UCH(~kana_mode); dp = Strcpy(dp, toA); } *dp++ = cch; @@ -4797,8 +4797,8 @@ PRIVATE CONST unsigned char *repairJIStoEUC ARGS2( if (!IS_JIS7(ch1, ch2)) return 0; - *d++ = (unsigned char) (0x80 | ch1); - *d++ = (unsigned char) (0x80 | ch2); + *d++ = UCH(0x80 | ch1); + *d++ = UCH(0x80 | ch2); } return 0; } diff --git a/WWW/Library/Implementation/www_tcp.h b/WWW/Library/Implementation/www_tcp.h index e808919b..4ab53b08 100644 --- a/WWW/Library/Implementation/www_tcp.h +++ b/WWW/Library/Implementation/www_tcp.h @@ -112,6 +112,11 @@ Default values #ifdef __CYGWIN__ #define _WINDOWS_NSL #define WIN_EX +#else +#ifdef WIN_EX +#define HAVE_FTIME 1 +#define HAVE_SYS_TIMEB_H 1 +#endif #endif /* __CYGWIN__ */ #ifdef HAVE_FCNTL_H @@ -156,6 +161,8 @@ extern unsigned char IBM1047[]; #endif /* EBCDIC */ #endif /* !TOASCII */ +/* convert a char to an unsigned, needed if we have signed characters for ctype.h */ +#define UCH(ch) ((unsigned char)(ch)) /* IBM-PC running Windows NT |