--- ray/src/px/x11image.c 2003/06/20 00:25:50 2.59 +++ ray/src/px/x11image.c 2004/01/02 12:47:01 2.65 @@ -18,6 +18,7 @@ static const char RCSid[] = "$Id"; #include "standard.h" +#include #include #include #include @@ -127,12 +128,13 @@ int sigrecv; void onsig(int i) { sigrecv++; } +static gethfunc headline; + main(argc, argv) int argc; char *argv[]; { - int headline(); int i; int pid; @@ -245,9 +247,11 @@ userr: } -int -headline(s) /* get relevant info from header */ -char *s; +static int +headline( /* get relevant info from header */ + char *s, + void *p +) { char fmt[32]; @@ -383,12 +387,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 +497,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 +540,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 +588,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--; } @@ -625,7 +629,7 @@ getevent() /* process the next event */ traceray(xpos, ypos) /* print requested pixel data */ int xpos, ypos; { - FLOAT hv[2]; + RREAL hv[2]; FVECT rorg, rdir; COLOR cval; register char *cp; @@ -673,7 +677,7 @@ XKeyPressedEvent *ekey; XColor cvx; int com, n; double comp; - FLOAT hv[2]; + RREAL hv[2]; n = XLookupString(ekey, buf, sizeof(buf), NULL, NULL); if (n == 0) @@ -793,7 +797,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 +895,7 @@ int x0, y0, x1, y1; } -int +void colavg(scn, n, cavg) register COLR *scn; register int n; @@ -925,7 +929,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 +960,7 @@ char *p; /* pointer to private data */ } -int +void addfix(scn, n) /* add fixation points to histogram */ COLR *scn; int n; @@ -1309,7 +1313,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) {