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

Comparing ray/src/rt/rview.c (file contents):
Revision 1.12 by greg, Fri May 3 15:22:24 1991 UTC vs.
Revision 1.13 by greg, Fri May 3 15:43:32 1991 UTC

# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ LBL";
18  
19   #include  <signal.h>
20  
21 + #include  <setjmp.h>
22 +
23   #include  <ctype.h>
24  
25   VIEW  ourview = STDVIEW;                /* viewing parameters */
# Line 55 | Line 57 | PNODE  ptrunk;                         /* the base of our image */
57   RECT  pframe;                           /* current frame boundaries */
58   int  pdepth;                            /* image depth in current frame */
59  
60 + static jmp_buf  mainloop;               /* longjmp back to main loop */
61   static char  *reserve_mem = NULL;       /* pre-allocated reserve memory */
62  
63   #define RESERVE_AMT     8192            /* amount of memory to reserve */
# Line 117 | Line 120 | rview()                                /* do a view */
120  
121          devopen(devname);               /* open device */
122          newimage();                     /* set up image */
123 <
123 >        setjmp(mainloop);
124          for ( ; ; ) {                   /* quit in command() */
125                  while (hresolu <= 1<<pdepth &&
126                                  vresolu <= 1<<pdepth)
# Line 158 | Line 161 | char   *detail;
161          }
162          free(reserve_mem);
163          reserve_mem = NULL;
164 <        for ( ; ; )
164 >        do
165                  command("out of memory: ");
166 +        while (reserve_mem == NULL);
167 +        longjmp(mainloop, 1);
168   }
169  
170  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines