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

Comparing ray/src/util/idmap.c (file contents):
Revision 2.1 by greg, Fri Jul 19 22:25:03 2019 UTC vs.
Revision 2.2 by greg, Tue Jul 23 17:20:20 2019 UTC

# Line 134 | Line 134 | seekerr:
134   }
135  
136  
137 < /* Read the next ID from input */
138 < const char *
139 < idmap_next(IDMAP *idmp)
137 > /* Read the next ID index from input */
138 > int
139 > idmap_next_i(IDMAP *idmp)
140   {
141          int     ndx = getint(idmp->bytespi, idmp->finp);
142  
143          if (ndx == EOF && feof(idmp->finp))
144 <                return NULL;
144 >                return -1;
145  
146          idmp->curpos += idmp->bytespi;
147  
148          ndx &= (1<<(idmp->bytespi<<3)) - 1;     /* undo sign extension */
149 +
150 +        return ndx;
151 + }
152 +
153 +
154 + /* Read the next ID from input */
155 + const char *
156 + idmap_next(IDMAP *idmp)
157 + {
158 +        int     ndx = idmap_next_i(idmp);
159 +
160 +        if (ndx < 0)
161 +                return NULL;
162  
163          return mapID(idmp, ndx);
164   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines