From edad1978e61f52a5e107dcf09a9bb65251827e2e Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 9 Oct 1994 15:40:07 +0000 Subject: Back out part of ctype fixes, unneded with new ctypoe --- usr.bin/more/ch.c | 6 +++--- usr.bin/more/command.c | 12 ++++++------ usr.bin/more/line.c | 8 ++++---- usr.bin/more/output.c | 2 +- usr.bin/more/prim.c | 6 +++--- usr.bin/more/ttyin.c | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/usr.bin/more/ch.c b/usr.bin/more/ch.c index a971c76..ab12946 100644 --- a/usr.bin/more/ch.c +++ b/usr.bin/more/ch.c @@ -96,7 +96,7 @@ static off_t last_piped_pos; #define ch_get() \ ((buf_head->block == ch_block && \ ch_offset < buf_head->datasize) ? \ - buf_head->data[ch_offset] & 0xff : fch_get()) + (unsigned char)buf_head->data[ch_offset] : fch_get()) static fch_get() @@ -130,7 +130,7 @@ fch_get() * find it already buffered. */ if (ispipe) - return(bp->data[ch_offset] & 0xff); + return((unsigned char)bp->data[ch_offset]); goto found; } /* @@ -233,7 +233,7 @@ found: */ goto read_more; - return(bp->data[ch_offset] & 0xff); + return((unsigned char)bp->data[ch_offset]); } /* diff --git a/usr.bin/more/command.c b/usr.bin/more/command.c index dcab842..cf86e60 100644 --- a/usr.bin/more/command.c +++ b/usr.bin/more/command.c @@ -85,7 +85,7 @@ cmd_erase() return(1); /* erase an extra character, for the carat. */ - c = *--cp & 0xff; + c = *--cp; if (CONTROL_CHAR(c)) { backspace(); --cmd_col; @@ -121,9 +121,9 @@ cmd_char(c) /* in this order, in case werase == erase_char */ if (c == werase_char) { if (cp > cmdbuf) { - while (isspace(cp[-1] & 0xff) && !cmd_erase()); - while (!isspace(cp[-1] & 0xff) && !cmd_erase()); - while (isspace(cp[-1] & 0xff) && !cmd_erase()); + while (isspace(cp[-1]) && !cmd_erase()); + while (!isspace(cp[-1]) && !cmd_erase()); + while (isspace(cp[-1]) && !cmd_erase()); } return(cp == cmdbuf); } @@ -276,11 +276,11 @@ exec_mca() (void)search(0, cmdbuf, number, wsearch); break; case A_EXAMINE: - for (p = cmdbuf; isspace(*p & 0xff); ++p); + for (p = cmdbuf; isspace(*p); ++p); (void)edit(glob(p)); break; case A_TAGFILE: - for (p = cmdbuf; isspace(*p & 0xff); ++p); + for (p = cmdbuf; isspace(*p); ++p); findtag(p); if (tagfile == NULL) break; diff --git a/usr.bin/more/line.c b/usr.bin/more/line.c index bdef948..5d07f55 100644 --- a/usr.bin/more/line.c +++ b/usr.bin/more/line.c @@ -169,7 +169,7 @@ pappend(c) if (curr <= linebuf + 1 || curr[-1] != '\b') break; - if (c == (curr[-2] & 0xff)) + if (c == ((unsigned char)curr[-2])) goto enter_boldface; if (c == '_' || curr[-2] == '_') goto enter_underline; @@ -242,7 +242,7 @@ enter_underline: /* * Termination of a sequence "_\bX" or "X\b_". */ - if (c != '_' && curr[-2] != '_' && c == (curr[-2] & 0xff)) + if (c != '_' && curr[-2] != '_' && c == ((unsigned char)curr[-2])) { /* * We seem to have run on from underlining @@ -259,7 +259,7 @@ enter_underline: } ln_ul_xb_case: if (c == '_') - c = curr[-2] & 0xff; + c = (unsigned char)curr[-2]; curr -= 2; ln_state = LN_UNDERLINE; break; @@ -267,7 +267,7 @@ ln_ul_xb_case: /* * Termination of a sequnce "X\bX". */ - if (c != (curr[-2] & 0xff) && (c == '_' || curr[-2] == '_')) + if (c != ((unsigned char)curr[-2]) && (c == '_' || curr[-2] == '_')) { /* * We seem to have run on from diff --git a/usr.bin/more/output.c b/usr.bin/more/output.c index 4524bd5..38142db 100644 --- a/usr.bin/more/output.c +++ b/usr.bin/more/output.c @@ -85,7 +85,7 @@ put_line() column = 0; for (p = line; *p != '\0'; p++) { - switch ((char)(c = *p & 0xff)) + switch ((char)(c = (unsigned char)*p)) { case UL_CHAR: ul_enter(); diff --git a/usr.bin/more/prim.c b/usr.bin/more/prim.c index 99361cc..d5af8f3 100644 --- a/usr.bin/more/prim.c +++ b/usr.bin/more/prim.c @@ -611,8 +611,8 @@ search(search_forward, pattern, n, wantmatch) */ if (caseless && pattern != NULL) for (p = pattern; *p; p++) - if (isupper(*p & 0xff)) - *p = tolower(*p & 0xff); + if (isupper(*p)) + *p = tolower(*p); #ifdef RECOMP /* @@ -764,7 +764,7 @@ search(search_forward, pattern, n, wantmatch) */ if (caseless) for (p = q = line; *p; p++, q++) - *q = isupper(*p & 0xff) ? tolower(*p & 0xff) : *p; + *q = isupper(*p) ? tolower(*p) : *p; /* * Remove any backspaces along with the preceeding char. diff --git a/usr.bin/more/ttyin.c b/usr.bin/more/ttyin.c index 2d3567e..51376cd 100644 --- a/usr.bin/more/ttyin.c +++ b/usr.bin/more/ttyin.c @@ -75,5 +75,5 @@ getchr() quit(); } } while (result != 1); - return (c & 0xff); + return ((unsigned char)c); } -- cgit v1.1