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.5 by greg, Fri Oct 2 15:58:31 1992 UTC vs.
Revision 2.7 by greg, Sun Nov 22 17:29:46 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# 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  
# Line 155 | Line 154 | int  nargs;
154   int  assign;
155   double  (*fptr)();
156   {
157 +    int  oldlibsize = libsize;
158      register LIBR  *lp;
159  
160      if ((lp = liblookup(fname)) == NULL) {      /* insert */
# Line 187 | Line 187 | double  (*fptr)();
187          lp[0].atyp = assign;
188          lp[0].f = fptr;
189      }
190 <    libupdate(fname);                   /* relink library */
190 >    if (libsize != oldlibsize)
191 >        libupdate(fname);                       /* relink library */
192   }
193  
194  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines