ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/x11image.c
(Generate patch)

Comparing ray/src/px/x11image.c (file contents):
Revision 2.59 by greg, Fri Jun 20 00:25:50 2003 UTC vs.
Revision 2.65 by schorsch, Fri Jan 2 12:47:01 2004 UTC

# Line 18 | Line 18 | static const char RCSid[] = "$Id";
18  
19   #include  "standard.h"
20  
21 + #include  <string.h>
22   #include  <signal.h>
23   #include  <X11/Xlib.h>
24   #include  <X11/cursorfont.h>
# Line 127 | Line 128 | int  sigrecv;
128  
129   void  onsig(int i) { sigrecv++; }
130  
131 + static gethfunc headline;
132  
133 +
134   main(argc, argv)
135   int  argc;
136   char  *argv[];
137   {
135        int  headline();
138          int  i;
139          int  pid;
140          
# Line 245 | Line 247 | userr:
247   }
248  
249  
250 < int
251 < headline(s)             /* get relevant info from header */
252 < char  *s;
250 > static int
251 > headline(               /* get relevant info from header */
252 >        char    *s,
253 >        void    *p
254 > )
255   {
256          char  fmt[32];
257  
# Line 383 | Line 387 | char  *err;
387          register int  es;
388          int  cs;
389  
390 <        if (es = err != NULL)
390 >        if ( (es = err != NULL) )
391                  fprintf(stderr, "%s: %s: %s\n", progname,
392                                  fname==NULL?"<stdin>":fname, err);
393          if (thedisplay != NULL)
394                  XCloseDisplay(thedisplay);
395 <        if (parent < 0 & sigrecv == 0)
395 >        if ((parent < 0) & (sigrecv == 0))
396                  kill(getppid(), SIGCONT);
397          while (parent > 0 && wait(&cs) != -1) { /* wait for any children */
398                  if (es == 0)
# Line 493 | Line 497 | static char  vistype[][12] = {
497          if (viscmp(&xvi[i],&ourvis) > 0)
498                  quiterr("inadequate visuals on this screen");
499                                          /* OK, we'll use it */
500 <        copystruct(&ourvis, &xvi[i]);
500 >        ourvis = xvi[i];
501   #ifdef DEBUG
502          fprintf(stderr, "Selected visual type %s, depth %d\n",
503                          vistype[ourvis.class], ourvis.depth);
# Line 536 | Line 540 | getras()                               /* get raster file */
540                  if (ourras == NULL)
541                          goto fail;
542                  getmono();
543 <        } else if (ourvis.class == TrueColor | ourvis.class == DirectColor) {
543 >        } else if ((ourvis.class == TrueColor) | (ourvis.class == DirectColor)) {
544                  int  datsiz = ourvis.depth>16 ? sizeof(int32) : sizeof(int16);
545                  ourdata = (unsigned char *)malloc(datsiz*xmax*ymax);
546                  if (ourdata == NULL)
# Line 584 | Line 588 | getevent()                             /* process the next event */
588                  map_rcolors(ourras, wind);
589                  if (fast)
590                          make_rpixmap(ourras, wind);
591 <                if (!sequential & parent < 0 & sigrecv == 0) {
591 >                if ((!sequential) & (parent < 0) & (sigrecv == 0)) {
592                          kill(getppid(), SIGCONT);
593                          sigrecv--;
594                  }
# Line 625 | Line 629 | getevent()                             /* process the next event */
629   traceray(xpos, ypos)                    /* print requested pixel data */
630   int  xpos, ypos;
631   {
632 <        FLOAT  hv[2];
632 >        RREAL  hv[2];
633          FVECT  rorg, rdir;
634          COLOR  cval;
635          register char  *cp;
# Line 673 | Line 677 | XKeyPressedEvent  *ekey;
677          XColor  cvx;
678          int  com, n;
679          double  comp;
680 <        FLOAT  hv[2];
680 >        RREAL  hv[2];
681  
682          n = XLookupString(ekey, buf, sizeof(buf), NULL, NULL);
683          if (n == 0)
# Line 793 | Line 797 | XKeyPressedEvent  *ekey;
797                  free_rpixmap(ourras);
798                  return(0);
799          case '0':                               /* recenter origin */
800 <                if (xoff == 0 & yoff == 0)
800 >                if ((xoff == 0) & (yoff == 0))
801                          return(0);
802                  xoff = yoff = 0;
803                  XClearWindow(thedisplay, wind);
# Line 891 | Line 895 | int  x0, y0, x1, y1;
895   }
896  
897  
898 < int
898 > void
899   colavg(scn, n, cavg)
900   register COLR   *scn;
901   register int    n;
# Line 925 | Line 929 | COLOR  cavg;
929  
930   int
931   dobox(f, p)                             /* run function over bbox */
932 < int     (*f)();                 /* function to call for each subscan */
932 > void    (*f)();                 /* function to call for each subscan */
933   char    *p;                     /* pointer to private data */
934   {
935          int  left, right, top, bottom;
# Line 956 | Line 960 | char   *p;                     /* pointer to private data */
960   }
961  
962  
963 < int
963 > void
964   addfix(scn, n)                  /* add fixation points to histogram */
965   COLR    *scn;
966   int     n;
# Line 1309 | Line 1313 | int  y;
1313          static int  trunced = -1;               /* truncated file? */
1314   skipit:
1315          if (trunced >= 0 && y >= trunced) {
1316 <                bzero(scanline, xmax*sizeof(COLR));
1316 >                memset(scanline, '\0', xmax*sizeof(COLR));
1317                  return(-1);
1318          }
1319          if (y != cury) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines