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

Comparing ray/src/common/rglinst.c (file contents):
Revision 3.11 by schorsch, Sat Jul 12 09:55:13 2003 UTC vs.
Revision 3.18 by greg, Sat Jun 7 05:09:45 2025 UTC

# Line 38 | Line 38 | static FILE  *infp;                    /* input file stream */
38   static int  objsize;                    /* size of stored OBJECT's */
39   static short  otypmap[NUMOTYPE+8];      /* object type map */
40  
41 < static unsigned long    imhash(mod) char *mod; {return((unsigned long)mod);}
41 > static unsigned long    imhash(const char *mod) {return((unsigned long)mod);}
42   static LUTAB    imtab = {imhash,NULL,NULL,NULL,0,NULL,0};
43  
44   static LUTAB    ottab = LU_SINIT(free,free);
# Line 60 | Line 60 | register OBJREC        *o;
60                                  o->oargs.nsargs-1)
61                          objerror(o, USER, "bad transform");
62                  glPushAttrib(GL_TRANSFORM_BIT);
63 <                if (xfs.sca < 1.-FTINY | xfs.sca > 1.+FTINY)
63 >                if ((xfs.sca < 1.-FTINY) | (xfs.sca > 1.+FTINY))
64                          glEnable(GL_NORMALIZE);
65                  glMatrixMode(GL_MODELVIEW);
66                  glPushMatrix();
# Line 88 | Line 88 | register OBJREC        *o;
88  
89  
90   static int
91 < buildoctlist(lp)                        /* build octree list */
92 < LUENT   *lp;
91 > buildoctlist(lp, p)                     /* build octree list */
92 > const LUENT     *lp;
93 > void    *p;
94   {
95          int     old_dolights = dolights, old_domats = domats;
96          register OCTINST        *op = (OCTINST *)lp->data;
# Line 116 | Line 117 | loadoctrees()                          /* load octrees we've saved up */
117          while (ottab.tsiz) {
118                  if (!levelsleft--)
119                          error(USER, "too many octree levels -- instance loop?");
120 <                copystruct(&looptab, &ottab);
120 >                looptab = ottab;
121                  ottab.tsiz = 0;
122 <                nocts += lu_doall(&looptab, buildoctlist);
122 >                nocts += lu_doall(&looptab, buildoctlist, NULL);
123                  lu_done(&looptab);
124          }
125          return(nocts);
# Line 145 | Line 146 | char   *name;
146                  path = getpath(name, getrlibpath(), R_OK);
147                  if (path == NULL) {
148                          sprintf(errmsg, "cannot find octree \"%s\"", name);
149 <                        error(USER, errmsg);
149 >                        error(SYSTEM, errmsg);
150                  }
151                  op = (OCTINST *)(lp->data = (char *)malloc(sizeof(OCTINST)));
152                  strcpy(op->octfile, path);
# Line 156 | Line 157 | char   *name;
157          return(op);
158   memerr:
159          error(SYSTEM, "out of memory in getoct");
160 +        return NULL; /* pro forma return */
161   }
162  
163  
# Line 338 | Line 340 | loadobj()                              /* get next object */
340                                          /* get name id */
341          ob.oname = ogetstr(idbuf);
342                                          /* get string arguments */
343 <        if (ob.oargs.nsargs = ogetint(2)) {
343 >        if ((ob.oargs.nsargs = ogetint(2))) {
344                  ob.oargs.sarg = (char **)malloc
345                                  (ob.oargs.nsargs*sizeof(char *));
346                  if (ob.oargs.sarg == NULL)
# Line 360 | Line 362 | loadobj()                              /* get next object */
362                  ob.oargs.iarg = NULL;
363   #endif
364                                          /* get real arguments */
365 <        if (ob.oargs.nfargs = ogetint(2)) {
365 >        if ((ob.oargs.nfargs = ogetint(2))) {
366                  ob.oargs.farg = (RREAL *)malloc
367                                  (ob.oargs.nfargs*sizeof(RREAL));
368                  if (ob.oargs.farg == NULL)
# Line 373 | Line 375 | loadobj()                              /* get next object */
375          (*ofun[ob.otype].funp)(&ob);
376                                          /* record material if modifier */
377          if (ismodifier(ob.otype)) {
378 <                if ((lep = lu_find(&imtab, (char *)nobjects)) == NULL)
378 >                if ((lep = lu_find(&imtab, (char *)(size_t)nobjects)) == NULL)
379                          goto memerr;
380 <                lep->key = (char *)nobjects;
380 >                lep->key = (char *)(size_t)nobjects;
381                  lep->data = (char *)getmatp(ob.oname);
382          }
383          freefargs(&ob.oargs);           /* free arguments */
384          return(nobjects++);             /* return object id */
385   memerr:
386          error(SYSTEM, "out of memory in loadobj");
387 +        return OVOID; /* pro forma return */
388   }
389  
390  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines