Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.

This commit is contained in:
rsc 2006-04-01 19:24:03 +00:00
parent 226d80b821
commit cbeb0b26e4
492 changed files with 3218 additions and 3167 deletions

View file

@ -44,7 +44,7 @@ enum {
Ippm,
Ipng,
Iyuv,
Ibmp,
Ibmp
};
/*
@ -65,7 +65,7 @@ Convert cvt[] = {
[Iccittg4] { "ccitt-g4", "cat %a|rx nslocum /usr/lib/ocr/bin/bcp -M|fb/pcp -tcompressed -l0" },
[Ipng] { "png", "png -9 %a", "png -t9 %a" },
[Iyuv] { "yuv", "yuv -9 %a", "yuv -t9 %a" },
[Ibmp] { "bmp", "bmp -9 %a", "bmp -t9 %a" },
[Ibmp] { "bmp", "bmp -9 %a", "bmp -t9 %a" }
};
static Image* convert(Graphic*);
@ -325,7 +325,7 @@ spawnrc(char *cmd, uchar *stdinbuf, int nstdinbuf)
else
dup(open("/dev/null", OREAD), 0);
dup(pfd[0], 1);
//dup(pfd[0], 2);
/*dup(pfd[0], 2); */
execl("/bin/rc", "rc", "-c", cmd, nil);
wexits("exec");
}

View file

@ -305,10 +305,10 @@ waitgs(GSInfo *gs)
uchar buf[1024];
int n;
// gscmd(gs, "(\\n**bstack\\n) print flush\n");
// gscmd(gs, "stack flush\n");
// gscmd(gs, "(**estack\\n) print flush\n");
gscmd(gs, "(\\n//GO.SYSIN DD\\n) PAGE==\n");
/* gscmd(gs, "(\\n**bstack\\n) print flush\n"); */
/* gscmd(gs, "stack flush\n"); */
/* gscmd(gs, "(**estack\\n) print flush\n"); */
gscmd(gs, "(\\n/*GO.SYSIN DD\\n) PAGE==\n"); */
alarm(300*1000);
for(;;) {

View file

@ -23,7 +23,7 @@ int ndraw = 0;
enum {
Xaxis,
Yaxis,
Yaxis
};
static void reverse(Image*, Image*, int);
@ -229,7 +229,7 @@ swapadjacent(Image *img, Image *tmp, int axis, int imgdim, Image *mask, int mask
/*
* r0 is the lower rectangle, while r1 is the upper one.
*/
draw(tmp, tmp->r, img, nil,
draw(tmp, tmp->r, img, nil
}
void

View file

@ -22,7 +22,7 @@
int ndraw = 0;
enum {
Xaxis = 0,
Yaxis = 1,
Yaxis = 1
};
Image *mtmp;
@ -137,7 +137,7 @@ nextmask(Image *mask, int axis, int maskdim)
delta = axis==Xaxis ? Pt(maskdim,0) : Pt(0,maskdim);
drawop(mtmp, mtmp->r, mask, nil, mask->r.min, S);
gendrawop(mask, mask->r, mtmp, delta, mtmp, divpt(delta,-2), S);
// writefile("mask", mask, maskdim/2);
/* writefile("mask", mask, maskdim/2); */
return maskdim/2;
}
@ -153,13 +153,13 @@ shuffle(Image *im, Image *tmp, int axis, int n, Image *mask, int gran,
nn = n - left;
interlace(im, tmp, axis, nn, mask, gran);
// writefile("interlace", im, gran);
/* writefile("interlace", im, gran); */
gran = nextmask(mask, axis, gran);
shuffle(im, tmp, axis, n, mask, gran, nn);
// writefile("shuffle", im, gran);
/* writefile("shuffle", im, gran); */
moveup(im, tmp, lastnn, nn, n, axis);
// writefile("move", im, gran);
/* writefile("move", im, gran); */
}
void
@ -198,7 +198,7 @@ rot180(Image *im)
}
rmask.max.x = gran;
drawop(mask, rmask, display->opaque, nil, ZP, S);
// writefile("mask", mask, gran);
/* writefile("mask", mask, gran); */
shuffle(im, tmp, Xaxis, Dx(im->r), mask, gran, 0);
freeimage(mask);
freeimage(mtmp);

View file

@ -56,7 +56,7 @@ enum {
Middle = 2,
Right = 4,
RMenu = 3,
RMenu = 3
};
void
@ -265,7 +265,7 @@ enum{
Del,
Write,
Empty3,
Exit,
Exit
};
void
@ -866,7 +866,7 @@ redraw(Image *screen)
}
}
border(screen, r, -4000, gray, ZP);
// flushimage(display, 0);
/* flushimage(display, 0); */
}
void
@ -1047,7 +1047,7 @@ newwin(void)
dup(cons, 1);
dup(cons, 2);
close(cons);
// wctlfd = open("/dev/wctl", OWRITE);
/* wctlfd = open("/dev/wctl", OWRITE); */
}
Rectangle