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

Comparing ray/src/common/caldefn.c (file contents):
Revision 2.32 by greg, Wed Mar 30 16:00:56 2022 UTC vs.
Revision 2.34 by greg, Tue Feb 7 20:28:16 2023 UTC

# Line 78 | Line 78 | fcompile(                      /* get definitions from a file */
78          eputs(": cannot open\n");
79          quit(1);
80      }
81 <    initfile(fp, fname, 0);
81 > #ifdef getc_unlocked                    /* avoid stupid semaphores */
82 >    flockfile(fp);
83 > #endif
84 >   initfile(fp, fname, 0);
85      while (nextc != EOF)
86          getstatement();
87      if (fname != NULL)
88          fclose(fp);
89 + #ifdef getc_unlocked
90 +    else
91 +        funlockfile(fp);
92 + #endif
93   }
94  
95  
# Line 443 | Line 450 | libupdate(                     /* update library links */
450                                          /* if fn is NULL then relink all */
451      for (i = 0; i < NHASH; i++)
452          for (vp = hashtbl[i]; vp != NULL; vp = vp->next)
453 <            if (vp->lib != NULL || fn == NULL || !strcmp(fn, vp->name))
453 >            if ((vp->lib != NULL) | (fn == NULL) || !strcmp(fn, vp->name))
454                  vp->lib = liblookup(vp->name);
455   }
456  
# Line 621 | Line 628 | getdefn(void)
628   {
629      EPNODE  *ep1, *ep2;
630  
631 <    if (!isalpha(nextc) && nextc != CNTXMARK)
631 >    if (!isalpha(nextc) & (nextc != CNTXMARK))
632          syntax("illegal variable name");
633  
634      ep1 = newnode();
# Line 650 | Line 657 | getdefn(void)
657          curfunc = ep1;
658      }
659  
660 <    if (nextc != '=' && nextc != ':')
660 >    if ((nextc != '=') & (nextc != ':'))
661          syntax("'=' or ':' expected");
662  
663      ep2 = newnode();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines