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

Comparing ray/src/common/calfunc.c (file contents):
Revision 2.6 by greg, Sun Nov 22 12:11:48 1992 UTC vs.
Revision 2.7 by greg, Sun Nov 22 17:29:46 1992 UTC

# Line 104 | Line 104 | int
104   fundefined(fname)               /* return # of arguments for function */
105   char  *fname;
106   {
107 <    LIBR  *lp;
107 >    register LIBR  *lp;
108      register VARDEF  *vp;
109  
110 <    if ((vp = varlookup(fname)) == NULL || vp->def == NULL
111 <                || vp->def->v.kid->type != FUNC)
112 <        if ((lp = liblookup(fname)) == NULL)
113 <            return(0);
114 <        else
115 <            return(lp->nargs);
116 <    else
110 >    if ((vp = varlookup(fname)) != NULL && vp->def != NULL
111 >                && vp->def->v.kid->type == FUNC)
112          return(nekids(vp->def->v.kid) - 1);
113 +    lp = vp != NULL ? vp->lib : liblookup(fname);
114 +    if (lp == NULL)
115 +        return(0);
116 +    return(lp->nargs);
117   }
118  
119  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines