Back out part of ctype fixes, unneded with new ctypoe

This commit is contained in:
Andrey A. Chernov 1994-10-09 15:40:07 +00:00
parent c31c20bb26
commit 833f087253
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3460
6 changed files with 18 additions and 18 deletions

View File

@ -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 @@ fch_get()
*/
goto read_more;
return(bp->data[ch_offset] & 0xff);
return((unsigned char)bp->data[ch_offset]);
}
/*

View File

@ -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;

View File

@ -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 @@ pappend(c)
/*
* 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 @@ pappend(c)
}
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 @@ pappend(c)
/*
* 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

View File

@ -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();

View File

@ -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.

View File

@ -75,5 +75,5 @@ getchr()
quit();
}
} while (result != 1);
return (c & 0xff);
return ((unsigned char)c);
}