--- ray/src/px/x11image.c 2003/06/26 00:58:10 2.60 +++ ray/src/px/x11image.c 2003/07/27 22:12:03 2.64 @@ -18,6 +18,7 @@ static const char RCSid[] = "$Id"; #include "standard.h" +#include #include #include #include @@ -383,12 +384,12 @@ char *err; register int es; int cs; - if (es = err != NULL) + if ( (es = err != NULL) ) fprintf(stderr, "%s: %s: %s\n", progname, fname==NULL?"":fname, err); if (thedisplay != NULL) XCloseDisplay(thedisplay); - if (parent < 0 & sigrecv == 0) + if ((parent < 0) & (sigrecv == 0)) kill(getppid(), SIGCONT); while (parent > 0 && wait(&cs) != -1) { /* wait for any children */ if (es == 0) @@ -493,7 +494,7 @@ static char vistype[][12] = { if (viscmp(&xvi[i],&ourvis) > 0) quiterr("inadequate visuals on this screen"); /* OK, we'll use it */ - copystruct(&ourvis, &xvi[i]); + ourvis = xvi[i]; #ifdef DEBUG fprintf(stderr, "Selected visual type %s, depth %d\n", vistype[ourvis.class], ourvis.depth); @@ -536,7 +537,7 @@ getras() /* get raster file */ if (ourras == NULL) goto fail; getmono(); - } else if (ourvis.class == TrueColor | ourvis.class == DirectColor) { + } else if ((ourvis.class == TrueColor) | (ourvis.class == DirectColor)) { int datsiz = ourvis.depth>16 ? sizeof(int32) : sizeof(int16); ourdata = (unsigned char *)malloc(datsiz*xmax*ymax); if (ourdata == NULL) @@ -584,7 +585,7 @@ getevent() /* process the next event */ map_rcolors(ourras, wind); if (fast) make_rpixmap(ourras, wind); - if (!sequential & parent < 0 & sigrecv == 0) { + if ((!sequential) & (parent < 0) & (sigrecv == 0)) { kill(getppid(), SIGCONT); sigrecv--; } @@ -793,7 +794,7 @@ XKeyPressedEvent *ekey; free_rpixmap(ourras); return(0); case '0': /* recenter origin */ - if (xoff == 0 & yoff == 0) + if ((xoff == 0) & (yoff == 0)) return(0); xoff = yoff = 0; XClearWindow(thedisplay, wind); @@ -891,7 +892,7 @@ int x0, y0, x1, y1; } -int +void colavg(scn, n, cavg) register COLR *scn; register int n; @@ -925,7 +926,7 @@ COLOR cavg; int dobox(f, p) /* run function over bbox */ -int (*f)(); /* function to call for each subscan */ +void (*f)(); /* function to call for each subscan */ char *p; /* pointer to private data */ { int left, right, top, bottom; @@ -956,7 +957,7 @@ char *p; /* pointer to private data */ } -int +void addfix(scn, n) /* add fixation points to histogram */ COLR *scn; int n; @@ -1309,7 +1310,7 @@ int y; static int trunced = -1; /* truncated file? */ skipit: if (trunced >= 0 && y >= trunced) { - bzero(scanline, xmax*sizeof(COLR)); + memset(scanline, '\0', xmax*sizeof(COLR)); return(-1); } if (y != cury) {