Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.
This commit is contained in:
parent
226d80b821
commit
cbeb0b26e4
492 changed files with 3218 additions and 3167 deletions
|
|
@ -248,7 +248,7 @@ new(Image *i, int hideit, int scrollit, int pid, char *dir, char *cmd, char **ar
|
|||
error("new: channel alloc failed");
|
||||
mc = emalloc(sizeof(Mousectl));
|
||||
*mc = *mousectl;
|
||||
// mc->image = i;
|
||||
/* mc->image = i; */
|
||||
mc->c = cm;
|
||||
w = wmk(i, mc, ck, cctl, scrollit);
|
||||
free(mc); /* wmk copies *mc */
|
||||
|
|
@ -282,7 +282,7 @@ enum
|
|||
Plumb,
|
||||
Send,
|
||||
Scroll,
|
||||
Cook,
|
||||
Cook
|
||||
};
|
||||
|
||||
char *menu2str[] = {
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@ enum
|
|||
Scrollgap = 4, /* gap right of scroll bar */
|
||||
BIG = 3, /* factor by which window dimension can exceed screen */
|
||||
TRUE = 1,
|
||||
FALSE = 0,
|
||||
FALSE = 0
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
Kscrolloneup = KF|0x20,
|
||||
Kscrollonedown = KF|0x21,
|
||||
Kscrollonedown = KF|0x21
|
||||
};
|
||||
|
||||
enum /* control messages */
|
||||
|
|
@ -45,7 +45,7 @@ enum /* control messages */
|
|||
Holdon,
|
||||
Holdoff,
|
||||
Deleted,
|
||||
Exited,
|
||||
Exited
|
||||
};
|
||||
|
||||
struct Wctlmesg
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ Cursor l = {
|
|||
Cursor *corners[9] = {
|
||||
&tl, &t, &tr,
|
||||
&l, nil, &r,
|
||||
&bl, &b, &br,
|
||||
&bl, &b, &br
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ Event blank = {
|
|||
'X',
|
||||
0, 0, 0, 1, 1,
|
||||
{ ' ', 0 },
|
||||
{ ' ', 0 },
|
||||
{ ' ', 0 }
|
||||
};
|
||||
|
||||
struct Q
|
||||
|
|
@ -47,7 +47,7 @@ CFid *eventfd;
|
|||
CFid *addrfd;
|
||||
CFid *datafd;
|
||||
CFid *ctlfd;
|
||||
// int bodyfd;
|
||||
/* int bodyfd; */
|
||||
|
||||
char *typing;
|
||||
int ntypeb;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ enum
|
|||
{
|
||||
HiWater = 640000, /* max size of history */
|
||||
LoWater = 400000, /* min size of history after max'ed */
|
||||
MinWater = 20000, /* room to leave available when reallocating */
|
||||
MinWater = 20000 /* room to leave available when reallocating */
|
||||
};
|
||||
|
||||
static int topped;
|
||||
|
|
@ -121,8 +121,8 @@ fprint(2, "res %p %p\n", w->i, i);
|
|||
freeimage(w->i);
|
||||
w->i = i;
|
||||
}
|
||||
// wsetname(w);
|
||||
//XXX w->mc.image = i;
|
||||
/* wsetname(w); */
|
||||
/*XXX w->mc.image = i; */
|
||||
r = insetrect(i->r, Selborder+1);
|
||||
w->scrollr = r;
|
||||
w->scrollr.max.x = r.min.x+Scrollwid;
|
||||
|
|
@ -276,9 +276,9 @@ winctl(void *arg)
|
|||
case WKey:
|
||||
for(i=0; kbdr[i]!=L'\0'; i++)
|
||||
wkeyctl(w, kbdr[i]);
|
||||
// wkeyctl(w, r);
|
||||
// while(nbrecv(w->ck, &r))
|
||||
// wkeyctl(w, r);
|
||||
/* wkeyctl(w, r); */
|
||||
/* while(nbrecv(w->ck, &r)) */
|
||||
/* wkeyctl(w, r); */
|
||||
break;
|
||||
case WMouse:
|
||||
if(w->mouseopen) {
|
||||
|
|
@ -307,9 +307,10 @@ winctl(void *arg)
|
|||
m = w->mouse.queue[w->mouse.ri];
|
||||
if(++w->mouse.ri == nelem(w->mouse.queue))
|
||||
w->mouse.ri = 0;
|
||||
} else
|
||||
m = (Mousestate){w->mc.m, w->mouse.counter};
|
||||
|
||||
} else {
|
||||
m.m = w->mc.m;
|
||||
m.counter = w->mouse.counter;
|
||||
}
|
||||
w->mouse.lastcounter = m.counter;
|
||||
send(mrm.cm, &m.m);
|
||||
continue;
|
||||
|
|
@ -393,13 +394,13 @@ winctl(void *arg)
|
|||
c = t[i]; /* knows break characters fit in a byte */
|
||||
i += wid;
|
||||
if(!w->rawing && (c == '\n' || c=='\004')){
|
||||
// if(c == '\004')
|
||||
// i--;
|
||||
/* if(c == '\004') */
|
||||
/* i--; */
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if(i==nb && w->qh<w->nr && w->r[w->qh]=='\004')
|
||||
// w->qh++;
|
||||
/* if(i==nb && w->qh<w->nr && w->r[w->qh]=='\004') */
|
||||
/* w->qh++; */
|
||||
if(i > nb){
|
||||
npart = i-nb;
|
||||
memmove(part, t+nb, npart);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue