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

Comparing ray/src/hd/rhdisp.c (file contents):
Revision 3.49 by schorsch, Sun Jul 27 22:12:02 2003 UTC vs.
Revision 3.50 by schorsch, Thu Jan 1 11:21:55 2004 UTC

# Line 8 | Line 8 | static const char      RCSid[] = "$Id$";
8   #include <string.h>
9   #include <ctype.h>
10  
11 + #include "rterror.h"
12   #include "rholo.h"
13   #include "rhdisp.h"
14   #include "rhdriver.h"
# Line 57 | Line 58 | static long    nimmrays, naddrays;
58   #define RDY_DEV         02
59   #define RDY_SIN         04
60  
61 + static int disp_wait(void);
62 + static void add_holo(HDGRID *hdg, char *gfn, char *pfn);
63 + static void disp_bundle(PACKHEAD *p);
64 + static void new_view(register VIEW *v);
65 + static void set_focus(char *args);
66 + static int usr_input(void);
67 + static void printview(void);
68  
69 < main(argc, argv)
70 < int     argc;
71 < char    *argv[];
69 >
70 > int
71 > main(
72 >        int     argc,
73 >        char    *argv[]
74 > )
75   {
76          int     rdy, inp, res = 0, pause = 0;
77  
# Line 149 | Line 160 | char   *argv[];
160   #endif
161                                          /* all done */
162          quit(0);
163 +        return 0; /* pro forma return */
164   }
165  
166  
167 < int
168 < disp_wait()                     /* wait for more input */
167 > static int
168 > disp_wait(void)                 /* wait for more input */
169   {
170          fd_set  readset, errset;
171          int     flgs;
172          int     n;
161        register int    i;
173                                  /* see if we can avoid select call */
174          if (hdlist[0] == NULL)
175                  return(RDY_SRV);        /* initialize first */
# Line 203 | Line 214 | disp_wait()                    /* wait for more input */
214   }
215  
216  
217 < add_holo(hdg, gfn, pfn)         /* register a new holodeck section */
218 < HDGRID  *hdg;
219 < char    *gfn, *pfn;
217 > static void
218 > add_holo(               /* register a new holodeck section */
219 >        HDGRID  *hdg,
220 >        char    *gfn,
221 >        char    *pfn
222 > )
223   {
224          VIEW    nv;
225          double  d;
# Line 241 | Line 255 | char   *gfn, *pfn;
255   }
256  
257  
258 < disp_bundle(p)                  /* display a ray bundle */
259 < register PACKHEAD       *p;
258 > static void
259 > disp_bundle(                    /* display a ray bundle */
260 >        register PACKHEAD       *p
261 > )
262   {
263          GCOORD  gc[2];
264          FVECT   ro, rd, wp;
# Line 270 | Line 286 | register PACKHEAD      *p;
286   }
287  
288  
289 < new_view(v)                     /* change view parameters */
290 < register VIEW   *v;
289 > static void
290 > new_view(                       /* change view parameters */
291 >        register VIEW   *v
292 > )
293   {
294          static VIEW     viewhist[VIEWHISTLEN];
295          static unsigned nhist;
# Line 325 | Line 343 | again:
343   }
344  
345  
346 < set_focus(args)                 /* set focus frame */
347 < char    *args;
346 > static void
347 > set_focus(                      /* set focus frame */
348 >        char    *args
349 > )
350   {
351          double  hcent, vcent, hsiz, vsiz;
352          VIEW    *dv, vwfocus;
# Line 385 | Line 405 | char   *args;
405   }
406  
407  
408 < int
409 < usr_input()                     /* get user input and process it */
408 > static int
409 > usr_input(void)                 /* get user input and process it */
410   {
411          VIEW    vparams;
412          char    cmd[256];
# Line 457 | Line 477 | usr_input()                    /* get user input and process it */
477   }
478  
479  
480 < printview()                     /* print our current view to server stdout */
480 > static void
481 > printview(void)                 /* print our current view to server stdout */
482   {
483          fputs(VIEWSTR, sstdout);
484          fprintview(&odev.v, sstdout);
# Line 466 | Line 487 | printview()                    /* print our current view to server stdo
487   }
488  
489  
490 < int
491 < serv_result()                   /* get next server result and process it */
490 > extern int
491 > serv_result(void)                       /* get next server result and process it */
492   {
493          static char     *buf = NULL;
494          static int      bufsiz = 0;
495          MSGHEAD msg;
475        int     n;
496                                          /* read message header */
497          if (fread((char *)&msg, sizeof(MSGHEAD), 1, stdin) != 1)
498                  goto readerr;
# Line 540 | Line 560 | readerr:
560          if (feof(stdin))
561                  error(SYSTEM, "server process died");
562          error(SYSTEM, "error reading from server process");
563 +        return -1;  
564   }
565  
566  
567 < serv_request(type, nbytes, p)   /* send a request to the server process */
568 < int     type, nbytes;
569 < char    *p;
567 > extern void
568 > serv_request(   /* send a request to the server process */
569 >        int     type,
570 >        int     nbytes,
571 >        char    *p
572 > )
573   {
574          MSGHEAD msg;
575          int     m;
# Line 570 | Line 594 | char   *p;
594  
595  
596   void
597 < eputs(s)                        /* put error message to stderr */
598 < register char  *s;
597 > eputs(                  /* put error message to stderr */
598 >        register char  *s
599 > )
600   {
601          static int  midline = 0;
602  
# Line 590 | Line 615 | register char  *s;
615  
616  
617   void
618 < quit(code)                      /* clean up and exit */
619 < int     code;
618 > quit(                   /* clean up and exit */
619 >        int     code
620 > )
621   {
622          if (code)
623                  exit(code);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines