no wide character constants; sigh

This commit is contained in:
rsc 2005-05-07 22:42:06 +00:00
parent bc7da02954
commit bb0266fe61
9 changed files with 43 additions and 43 deletions

View file

@ -34,7 +34,7 @@ jolietstring(uchar *buf, int len)
int
isjolietfrog(Rune r)
{
return r==L'*' || r==L'/' || r==L':'
return r=='*' || r=='/' || r==':'
|| r==';' || r=='?' || r=='\\';
}

View file

@ -479,7 +479,7 @@ s_cmd(Text *t, Cmd *cp)
buf = allocstring(0);
for(m=0; m<nrp; m++){
buf->n = 0;
buf->r[0] = L'\0';
buf->r[0] = '\0';
sel = rp[m];
for(i = 0; i<cp->u.text->n; i++)
if((c = cp->u.text->r[i])=='\\' && i<cp->u.text->n-1){
@ -761,7 +761,7 @@ pdisplay(File *f)
if(np>RBUFSIZE-1)
np = RBUFSIZE-1;
bufread(&f->b, p1, buf, np);
buf[np] = L'\0';
buf[np] = '\0';
warning(nil, "%S", buf);
p1 += np;
}

View file

@ -847,11 +847,11 @@ sce(void)
{
int n = 1;
while (C != L'\n' && !(L'0' <= c && c <= L'9'))
while (C != '\n' && !('0' <= c && c <= '9'))
;
if (c != L'\n') {
for (n = c-L'0';'0' <= C && c <= L'9';)
n = n*10 + c-L'0';
if (c != '\n') {
for (n = c-'0';'0' <= C && c <= '9';)
n = n*10 + c-'0';
}
while(n) {
if(C == '.') {

View file

@ -502,7 +502,7 @@ getpref(char *pat, Rune *pre)
case 0x7c: case 0x5e: case 0x24:
*pre = 0;
return p-pat;
case L'\\':
case '\\':
p += n;
p += chartorune(++pre, p);
pre++;
@ -542,7 +542,7 @@ getfield(Rune *rp)
if ((c = Bgetrune(bindex)) < 0)
return 0;
if(c == '\t' || c == '\n') {
*rp = L'\0';
*rp = '\0';
return 1;
}
*rp++ = c;

View file

@ -393,7 +393,7 @@ commands(void)
newline();
count = addr2 - zero;
putd();
putchr(L'\n');
putchr('\n');
continue;
case '!':
@ -419,7 +419,7 @@ printcom(void)
if(listn) {
count = a1-zero;
putd();
putchr(L'\t');
putchr('\t');
}
putshst(getline(*a1++));
} while(a1 <= addr2);
@ -624,7 +624,7 @@ exfile(int om)
io = -1;
if(vflag) {
putd();
putchr(L'\n');
putchr('\n');
}
}
@ -653,7 +653,7 @@ error1(char *s)
close(io);
io = -1;
}
putchr(L'?');
putchr('?');
putst(s);
}
@ -687,7 +687,7 @@ notifyf(void *a, char *s)
if(strcmp(s, "interrupt") == 0){
if(rescuing || waiting)
noted(NCONT);
putchr(L'\n');
putchr('\n');
lastc = '\n';
error1(Q);
notejmp(a, savej, 0);
@ -1496,7 +1496,7 @@ putd(void)
count /= 10;
if(count)
putd();
putchr(r + L'0');
putchr(r + '0');
}
void
@ -1511,7 +1511,7 @@ putst(char *sp)
break;
putchr(r);
}
putchr(L'\n');
putchr('\n');
}
void
@ -1520,7 +1520,7 @@ putshst(Rune *sp)
col = 0;
while(*sp)
putchr(*sp++);
putchr(L'\n');
putchr('\n');
}
void

View file

@ -10,16 +10,16 @@
#undef isalnum
#undef isspace
#undef tolower
#define isupper(r) (L'A' <= (r) && (r) <= L'Z')
#define islower(r) (L'a' <= (r) && (r) <= L'z')
#define isupper(r) ('A' <= (r) && (r) <= 'Z')
#define islower(r) ('a' <= (r) && (r) <= 'z')
#define isalpha(r) (isupper(r) || islower(r))
#define islatin1(r) (0xC0 <= (r) && (r) <= 0xFF)
#define isdigit(r) (L'0' <= (r) && (r) <= L'9')
#define isdigit(r) ('0' <= (r) && (r) <= '9')
#define isalnum(r) (isalpha(r) || isdigit(r))
#define isspace(r) ((r) == L' ' || (r) == L'\t' \
#define isspace(r) ((r) == ' ' || (r) == '\t' \
|| (0x0A <= (r) && (r) <= 0x0D))
#define tolower(r) ((r)-'A'+'a')
@ -263,7 +263,7 @@ rcanon(Rune *old, Rune *new)
if (islatin1(r) && latin_fold_tab[r-0xc0])
r = latin_fold_tab[r-0xc0];
if(direc)
if(!(isalnum(r) || r == L' ' || r == L'\t'))
if(!(isalnum(r) || r == ' ' || r == '\t'))
continue;
if(fold)
if(isupper(r))
@ -339,7 +339,7 @@ getword(Biobuf *f, Rune *rp, int n)
if(c < 0)
return 0;
if(c == '\n') {
*rp = L'\0';
*rp = '\0';
return 1;
}
*rp++ = c;