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

Comparing ray/src/common/tonemap.c (file contents):
Revision 3.7 by gregl, Mon Dec 1 09:52:00 1997 UTC vs.
Revision 3.8 by gwlarson, Mon Aug 17 17:58:47 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1997 Regents of the University of California */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4 < static char SCCSid[] = "$SunId$ LBL";
4 > static char SCCSid[] = "$SunId$ SGI";
5   #endif
6  
7   /*
# Line 186 | Line 186 | int    len;
186  
187          if (tmTop == NULL)
188                  returnErr(TM_E_TMINVAL);
189 <        if (ls == NULL | scan == NULL | len <= 0)
189 >        if (ls == NULL | scan == NULL | len < 0)
190                  returnErr(TM_E_ILLEGAL);
191          for (i = len; i--; ) {
192                  if (tmNeedMatrix(tmTop))                /* get monitor RGB */
# Line 257 | Line 257 | int    wt;
257          int     oldorig, oldlen, horig, hlen;
258          register int    i, j;
259  
260        if (len <= 0)
261                returnErr(TM_E_ILLEGAL);
260          if (tmTop == NULL)
261                  returnErr(TM_E_TMINVAL);
262 +        if (len < 0)
263 +                returnErr(TM_E_ILLEGAL);
264 +        if (len == 0)
265 +                returnOK;
266                                                  /* first, grow limits */
267          if (tmTop->histo == NULL) {
268                  for (i = len; i-- && ls[i] < MINBRT; )
# Line 448 | Line 450 | int    len;
450  
451          if (tmTop == NULL || tmTop->lumap == NULL)
452                  returnErr(TM_E_TMINVAL);
453 <        if (ps == NULL | ls == NULL | len <= 0)
453 >        if (ps == NULL | ls == NULL | len < 0)
454                  returnErr(TM_E_ILLEGAL);
455          while (len--) {
456                  if ((li = *ls++) < tmTop->mbrmin)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines