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

Comparing ray/src/common/modobject.c (file contents):
Revision 2.14 by greg, Sun Dec 8 18:59:53 2013 UTC vs.
Revision 2.15 by greg, Sun Dec 8 19:25:36 2013 UTC

# Line 88 | Line 88 | object(                                /* get an object number from its name */
88   #endif
89  
90  
91 < static int
91 > int
92   eqreal(                         /* are two real values close enough to equal? */
93          double  d1,
94          double  d2
# Line 109 | Line 109 | eqobjects(                     /* check if two objects are equal */
109          OBJREC  *op1, *op2;
110          int     i;
111  
112 <        if (obj1 == OVOID)
113 <                return(obj2 == OVOID);
114 <        if (obj2 == OVOID)
115 <                return(0);
116 <        op1 = objptr(obj1);
117 <        op2 = objptr(obj2);
118 <        if (op1->omod != op2->omod)
119 <                return(0);
120 <        if (op1->otype != op2->otype)
121 <                return(0);
122 <        if (strcmp(op1->oname, op2->oname))
123 <                return(0);
124 <        if (op1->oargs.nsargs != op2->oargs.nsargs)
125 <                return(0);
126 <        if (op1->oargs.nfargs != op2->oargs.nfargs)
127 <                return(0);
128 < #ifdef IARGS
129 <        if (op1->oargs.niargs != op2->oargs.niargs)
130 <                return(0);
131 <        for (i = op1->oargs.niargs; i-- > 0; )
132 <                if (op1->oargs.iarg[i] != op2->oargs.iarg[i])
112 >        while (obj1 != obj2) {
113 >                if (obj1 == OVOID)
114                          return(0);
115 < #endif
135 <        for (i = op1->oargs.nfargs; i-- > 0; )
136 <                if (!eqreal(op1->oargs.farg[i], op2->oargs.farg[i]))
115 >                if (obj2 == OVOID)
116                          return(0);
117 <        for (i = op1->oargs.nsargs; i-- > 0; )
118 <                if (strcmp(op1->oargs.sarg[i], op2->oargs.sarg[i]))
117 >                op1 = objptr(obj1);
118 >                op2 = objptr(obj2);
119 >                if (op1->otype != op2->otype)
120                          return(0);
121 +                if (op1->oargs.nsargs != op2->oargs.nsargs)
122 +                        return(0);
123 +                if (op1->oargs.nfargs != op2->oargs.nfargs)
124 +                        return(0);
125 + #ifdef IARGS
126 +                if (op1->oargs.niargs != op2->oargs.niargs)
127 +                        return(0);
128 +                for (i = op1->oargs.niargs; i-- > 0; )
129 +                        if (op1->oargs.iarg[i] != op2->oargs.iarg[i])
130 +                                return(0);
131 + #endif
132 +                for (i = op1->oargs.nfargs; i-- > 0; )
133 +                        if (!eqreal(op1->oargs.farg[i], op2->oargs.farg[i]))
134 +                                return(0);
135 +                for (i = op1->oargs.nsargs; i-- > 0; )
136 +                        if (strcmp(op1->oargs.sarg[i], op2->oargs.sarg[i]))
137 +                                return(0);
138 +                obj1 = op1->omod;
139 +                obj2 = op2->omod;
140 +        }
141          return(1);
142   }
143  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines