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

Comparing ray/src/common/otypes.c (file contents):
Revision 1.6 by greg, Wed Jul 24 12:06:35 1991 UTC vs.
Revision 2.6 by greg, Sat Mar 9 19:20:31 2013 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1986 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Object type lookup and error reporting
6 + *
7 + *  External symbols declared in object.h
8   */
9  
10 + #include "copyright.h"
11 +
12   #include  "standard.h"
13  
14   #include  "object.h"
# Line 16 | Line 17 | static char SCCSid[] = "$SunId$ LBL";
17  
18  
19   int
20 < otype(ofname)                   /* get object function number from its name */
21 < register char  *ofname;
20 > otype(                          /* get object function number from its name */
21 >        char  *ofname
22 > )
23   {
24 <        register int  i;
24 >        int  i;
25  
26          for (i = 0; i < NUMOTYPE; i++)
27 <                if (!strcmp(ofun[i].funame, ofname))
27 >                if (ofun[i].funame[0] == ofname[0] &&
28 >                                !strcmp(ofun[i].funame, ofname))
29                          return(i);
30  
31          return(-1);             /* not found */
32   }
33  
34  
35 < objerror(o, etyp, msg)          /* report error related to object */
36 < OBJREC  *o;
37 < int  etyp;
38 < char  *msg;
35 > void
36 > objerror(                       /* report error related to object */
37 >        OBJREC  *o,
38 >        int  etyp,
39 >        char  *msg
40 > )
41   {
42 <        char  msgbuf[128];
42 >        char  msgbuf[512];
43  
44          sprintf(msgbuf, "%s for %s \"%s\"",
45 <                        msg, ofun[o->otype].funame, o->oname);
45 >                        msg, ofun[o->otype].funame,
46 >                        o->oname!=NULL ? o->oname : "(NULL)");
47          error(etyp, msgbuf);
48   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines