SunOS can rot in hell.

This commit is contained in:
rsc 2004-03-26 01:59:35 +00:00
parent 4e3a2cc1f9
commit be22ae2d07
52 changed files with 211 additions and 160 deletions

View file

@ -64,7 +64,7 @@ number(Mntdir *md, Text *t, Range r, int line, int dir, int size, int *evalp)
if(line<0 || line>t->file->b.nc)
goto Rescue;
*evalp = TRUE;
return (Range){line, line};
return range(line, line);
}
q0 = r.q0;
q1 = r.q1;
@ -104,7 +104,7 @@ number(Mntdir *md, Text *t, Range r, int line, int dir, int size, int *evalp)
--q0;
}
*evalp = TRUE;
return (Range){q0, q1};
return range(q0, q1);
Rescue:
if(md != nil)
@ -197,7 +197,7 @@ address(Mntdir *md, Text *t, Range lim, Range ar, void *a, uint q0, uint q1, int
if(c == '.')
r = ar;
else
r = (Range){t->file->b.nc, t->file->b.nc};
r = range(t->file->b.nc, t->file->b.nc);
if(q < q1)
dir = Fore;
else

View file

@ -106,7 +106,7 @@ Exectab exectab[] = {
{ LTab, tab, FALSE, XXX, XXX },
{ LUndo, undo, FALSE, TRUE, XXX },
{ LZerox, zeroxx, FALSE, XXX, XXX },
{ nil, nil, 0, 0, 0 },
{ nil, 0, 0, 0, 0 },
};
Exectab*

View file

@ -91,6 +91,7 @@ void flushwarnings(void);
void startplumbing(void);
Runestr runestr(Rune*, uint);
Range range(int, int);
#define runemalloc(a) (Rune*)emalloc((a)*sizeof(Rune))
#define runerealloc(a, b) (Rune*)erealloc((a), (b)*sizeof(Rune))

View file

@ -310,7 +310,7 @@ Xfid*
fsysflush(Xfid *x, Fid *f)
{
USED(f);
sendp(x->c, xfidflush);
sendp(x->c, (void*)xfidflush);
return nil;
}
@ -526,7 +526,7 @@ fsysopen(Xfid *x, Fid *f)
if(((f->dir->perm&~(DMDIR|DMAPPEND))&m) != m)
goto Deny;
sendp(x->c, xfidopen);
sendp(x->c, (void*)xfidopen);
return nil;
Deny:
@ -624,7 +624,7 @@ fsysread(Xfid *x, Fid *f)
free(b);
return x;
}
sendp(x->c, xfidread);
sendp(x->c, (void*)xfidread);
return nil;
}
@ -633,7 +633,7 @@ Xfid*
fsyswrite(Xfid *x, Fid *f)
{
USED(f);
sendp(x->c, xfidwrite);
sendp(x->c, (void*)xfidwrite);
return nil;
}
@ -642,7 +642,7 @@ Xfid*
fsysclunk(Xfid *x, Fid *f)
{
fsysdelid(f->mntdir);
sendp(x->c, xfidclose);
sendp(x->c, (void*)xfidclose);
return nil;
}

View file

@ -591,7 +591,7 @@ expandfile(Text *t, uint q0, uint q1, Expand *e)
e->u.at = t;
e->a0 = amin+1;
eval = FALSE;
address(nil, nil, (Range){-1,-1}, (Range){0, 0}, t, e->a0, amax, tgetc, &eval, (uint*)&e->a1);
address(nil, nil, range(-1,-1), range(0,0), t, e->a0, amax, tgetc, &eval, (uint*)&e->a1);
return TRUE;
Isntfile:
@ -723,7 +723,7 @@ openfile(Text *t, Expand *e)
eval = FALSE;
else{
eval = TRUE;
r = address(nil, t, (Range){-1, -1}, (Range){t->q0, t->q1}, e->u.at, e->a0, e->a1, e->agetc, &eval, &dummy);
r = address(nil, t, range(-1,-1), range(t->q0, t->q1), e->u.at, e->a0, e->a1, e->agetc, &eval, &dummy);
if(eval == FALSE)
e->jump = FALSE; /* don't jump if invalid address */
}

View file

@ -894,7 +894,7 @@ textselect(Text *t)
/* horrible botch: while asleep, may have lost selection altogether */
if(selectq > t->file->b.nc)
selectq = t->org + t->fr.p0;
t->fr.scroll = nil;
t->fr.scroll = 0;
if(selectq < t->org)
q0 = selectq;
else

View file

@ -14,6 +14,16 @@
static Point prevmouse;
static Window *mousew;
Range
range(int q0, int q1)
{
Range r;
r.q0 = q0;
r.q1 = q1;
return r;
}
Runestr
runestr(Rune *r, uint n)
{

View file

@ -47,7 +47,7 @@ xfidctl(void *arg)
threadsetname("xfidctlthread");
x = arg;
for(;;){
f = recvp(x->c);
f = (void(*)(Xfid*))recvp(x->c);
(*f)(x);
flushimage(display, 1);
sendp(cxfidfree, x);
@ -104,8 +104,8 @@ xfidopen(Xfid *x)
switch(q){
case QWaddr:
if(w->nopen[q]++ == 0){
w->addr = (Range){0,0};
w->limit = (Range){-1,-1};
w->addr = range(0,0);
w->limit = range(-1,-1);
}
break;
case QWdata:
@ -164,7 +164,7 @@ xfidopen(Xfid *x)
seq++;
filemark(t->file);
cut(t, t, nil, FALSE, TRUE, nil, 0);
w->wrselrange = (Range){t->q1, t->q1};
w->wrselrange = range(t->q1, t->q1);
w->nomark = TRUE;
break;
case QWeditout:
@ -173,7 +173,7 @@ xfidopen(Xfid *x)
respond(x, &fc, Eperm);
return;
}
w->wrselrange = (Range){t->q1, t->q1};
w->wrselrange = range(t->q1, t->q1);
break;
}
winunlock(w);