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 int
isjolietfrog(Rune r) isjolietfrog(Rune r)
{ {
return r==L'*' || r==L'/' || r==L':' return r=='*' || r=='/' || r==':'
|| r==';' || r=='?' || r=='\\'; || r==';' || r=='?' || r=='\\';
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -100,7 +100,7 @@ quotestrdup(char *s)
*u++ = '\''; *u++ = '\'';
for(t=s; *t; t++){ for(t=s; *t; t++){
r = *t; r = *t;
if(r == L'\'') if(r == '\'')
*u++ = r; /* double the quote */ *u++ = r; /* double the quote */
*u++ = r; *u++ = r;
} }
@ -126,7 +126,7 @@ quoterunestrdup(Rune *s)
*u++ = '\''; *u++ = '\'';
for(t=s; *t; t++){ for(t=s; *t; t++){
r = *t; r = *t;
if(r == L'\'') if(r == '\'')
*u++ = r; /* double the quote */ *u++ = r; /* double the quote */
*u++ = r; *u++ = r;
} }

View file

@ -378,7 +378,7 @@ loop:
f->new = mkpath(mkaux, old->new, elem); f->new = mkpath(mkaux, old->new, elem);
free(elem); free(elem);
f->elem = utfrrune(f->new, L'/') + 1; f->elem = utfrrune(f->new, '/') + 1;
p = getmode(mkaux, p, &f->mode); p = getmode(mkaux, p, &f->mode);
p = getname(mkaux, p, &f->uid); /* LEAK */ p = getname(mkaux, p, &f->uid); /* LEAK */
if(p == nil) if(p == nil)

View file

@ -334,7 +334,7 @@ nextc(Rune *rp)
return 1; return 1;
} }
exprp += chartorune(rp, exprp); exprp += chartorune(rp, exprp);
if(*rp == L'\\'){ if(*rp == '\\'){
exprp += chartorune(rp, exprp); exprp += chartorune(rp, exprp);
return 1; return 1;
} }
@ -358,25 +358,25 @@ lex(int literal, int dot_type)
switch(yyrune){ switch(yyrune){
case 0: case 0:
return END; return END;
case L'*': case '*':
return STAR; return STAR;
case L'?': case '?':
return QUEST; return QUEST;
case L'+': case '+':
return PLUS; return PLUS;
case L'|': case '|':
return OR; return OR;
case L'.': case '.':
return dot_type; return dot_type;
case L'(': case '(':
return LBRA; return LBRA;
case L')': case ')':
return RBRA; return RBRA;
case L'^': case '^':
return BOL; return BOL;
case L'$': case '$':
return EOL; return EOL;
case L'[': case '[':
return bldcclass(); return bldcclass();
} }
return RUNE; return RUNE;
@ -399,11 +399,11 @@ bldcclass(void)
/* SPECIAL CASE!!! negated classes don't match \n */ /* SPECIAL CASE!!! negated classes don't match \n */
ep = r; ep = r;
quoted = nextc(&rune); quoted = nextc(&rune);
if(!quoted && rune == L'^'){ if(!quoted && rune == '^'){
type = NCCLASS; type = NCCLASS;
quoted = nextc(&rune); quoted = nextc(&rune);
*ep++ = L'\n'; *ep++ = '\n';
*ep++ = L'\n'; *ep++ = '\n';
} }
/* parse class into a set of spans */ /* parse class into a set of spans */
@ -412,15 +412,15 @@ bldcclass(void)
rcerror("malformed '[]'"); rcerror("malformed '[]'");
return 0; return 0;
} }
if(!quoted && rune == L']') if(!quoted && rune == ']')
break; break;
if(!quoted && rune == L'-'){ if(!quoted && rune == '-'){
if(ep == r){ if(ep == r){
rcerror("malformed '[]'"); rcerror("malformed '[]'");
return 0; return 0;
} }
quoted = nextc(&rune); quoted = nextc(&rune);
if((!quoted && rune == L']') || rune == 0){ if((!quoted && rune == ']') || rune == 0){
rcerror("malformed '[]'"); rcerror("malformed '[]'");
return 0; return 0;
} }