| 35 |  | mgetint(siz)                            /* get a siz-byte integer */ | 
| 36 |  | int  siz; | 
| 37 |  | { | 
| 38 | < | register long  r; | 
| 38 | > | long  r; | 
| 39 |  |  | 
| 40 |  | r = getint(siz, meshfp); | 
| 41 |  | if (feof(meshfp)) | 
| 60 |  | getfullnode()                           /* get a set, return fullnode */ | 
| 61 |  | { | 
| 62 |  | OBJECT  set[MAXSET+1]; | 
| 63 | < | register int  i; | 
| 63 | > | int  i; | 
| 64 |  |  | 
| 65 |  | if ((set[0] = mgetint(objsize)) > MAXSET) | 
| 66 |  | mesherror(USER, "bad set in getfullnode"); | 
| 73 |  | static OCTREE | 
| 74 |  | gettree()                               /* get a pre-ordered octree */ | 
| 75 |  | { | 
| 76 | < | register OCTREE  ot; | 
| 77 | < | register int  i; | 
| 76 | > | OCTREE   ot; | 
| 77 | > | int  i; | 
| 78 |  |  | 
| 79 |  | switch (getc(meshfp)) { | 
| 80 |  | case OT_EMPTY: | 
| 92 |  | default: | 
| 93 |  | mesherror(USER, "damaged mesh octree"); | 
| 94 |  | } | 
| 95 | < | return (OCTREE)NULL; /* pro forma return */ | 
| 95 | > | return (OCTREE)0;       /* pro forma return */ | 
| 96 |  | } | 
| 97 |  |  | 
| 98 |  |  | 
| 99 |  | static void | 
| 100 |  | skiptree()                              /* skip octree on input */ | 
| 101 |  | { | 
| 102 | < | register int  i; | 
| 102 | > | int  i; | 
| 103 |  |  | 
| 104 |  | switch (getc(meshfp)) { | 
| 105 |  | case OT_EMPTY: | 
| 123 |  |  | 
| 124 |  | static void | 
| 125 |  | getpatch(pp)                            /* load a mesh patch */ | 
| 126 | < | register MESHPATCH      *pp; | 
| 126 | > | MESHPATCH       *pp; | 
| 127 |  | { | 
| 128 |  | int     flags; | 
| 129 |  | int     i, j; | 
| 133 |  | mesherror(USER, "bad patch flags"); | 
| 134 |  | /* allocate vertices */ | 
| 135 |  | pp->nverts = mgetint(2); | 
| 136 | < | if (pp->nverts <= 0 || pp->nverts > 256) | 
| 136 | > | if ((pp->nverts <= 0) | (pp->nverts > 256)) | 
| 137 |  | mesherror(USER, "bad number of patch vertices"); | 
| 138 |  | pp->xyz = (uint32 (*)[3])malloc(pp->nverts*3*sizeof(uint32)); | 
| 139 |  | if (pp->xyz == NULL) | 
| 145 |  | } else | 
| 146 |  | pp->norm = NULL; | 
| 147 |  | if (flags & MT_UV) { | 
| 148 | < | pp->uv = (uint16 (*)[2])calloc(pp->nverts, 2*sizeof(uint16)); | 
| 148 | > | pp->uv = (uint32 (*)[2])calloc(pp->nverts, 2*sizeof(uint32)); | 
| 149 |  | if (pp->uv == NULL) | 
| 150 |  | goto nomem; | 
| 151 |  | } else | 
| 162 |  | if (flags & MT_UV) | 
| 163 |  | for (i = 0; i < pp->nverts; i++) | 
| 164 |  | for (j = 0; j < 2; j++) | 
| 165 | < | pp->uv[i][j] = mgetint(2); | 
| 165 | > | pp->uv[i][j] = mgetint(4); | 
| 166 |  | /* local triangles */ | 
| 167 |  | pp->ntris = mgetint(2); | 
| 168 | < | if (pp->ntris < 0 || pp->ntris > 512) | 
| 168 | > | if ((pp->ntris < 0) | (pp->ntris > 512)) | 
| 169 |  | mesherror(USER, "bad number of local triangles"); | 
| 170 |  | if (pp->ntris) { | 
| 171 |  | pp->tri = (struct PTri *)malloc(pp->ntris * | 
| 192 |  | } | 
| 193 |  | /* joiner triangles */ | 
| 194 |  | pp->nj1tris = mgetint(2); | 
| 195 | < | if (pp->nj1tris < 0 || pp->nj1tris > 512) | 
| 195 | > | if ((pp->nj1tris < 0) | (pp->nj1tris > 256)) | 
| 196 |  | mesherror(USER, "bad number of joiner triangles"); | 
| 197 |  | if (pp->nj1tris) { | 
| 198 |  | pp->j1tri = (struct PJoin1 *)malloc(pp->nj1tris * | 
| 209 |  | pp->j1tri = NULL; | 
| 210 |  | /* double joiner triangles */ | 
| 211 |  | pp->nj2tris = mgetint(2); | 
| 212 | < | if (pp->nj2tris < 0 || pp->nj2tris > 256) | 
| 212 | > | if ((pp->nj2tris < 0) | (pp->nj2tris > 256)) | 
| 213 |  | mesherror(USER, "bad number of double joiner triangles"); | 
| 214 |  | if (pp->nj2tris) { | 
| 215 |  | pp->j2tri = (struct PJoin2 *)malloc(pp->nj2tris * | 
| 254 |  | checkheader(meshfp, MESHFMT, flags&IO_INFO ? stdout : (FILE *)NULL); | 
| 255 |  | /* read format number */ | 
| 256 |  | objsize = getint(2, meshfp) - MESHMAGIC; | 
| 257 | < | if (objsize <= 0 || objsize > MAXOBJSIZ || objsize > sizeof(long)) | 
| 257 | > | if ((objsize <= 0) | (objsize > MAXOBJSIZ) | (objsize > sizeof(long))) | 
| 258 |  | mesherror(USER, "incompatible mesh format"); | 
| 259 |  | /* read boundaries */ | 
| 260 |  | if (flags & IO_BOUNDS) { |