compressionlibs/ziplib/test/rtest/inflateprimetest/zran.cpp
changeset 18 47c74d1534e1
parent 0 e4d67989cc36
child 45 4b03adbd26ca
child 57 2efc27d87e1c
equal deleted inserted replaced
0:e4d67989cc36 18:47c74d1534e1
   165     off_t last;                 /* totout value of last access point */
   165     off_t last;                 /* totout value of last access point */
   166     struct access *index;       /* access points being generated */
   166     struct access *index;       /* access points being generated */
   167     z_stream strm;
   167     z_stream strm;
   168     unsigned char input[CHUNK];
   168     unsigned char input[CHUNK];
   169     unsigned char window[WINSIZE];
   169     unsigned char window[WINSIZE];
       
   170 	struct point *next = NULL;
   170 
   171 
   171     /* initialize inflate */
   172     /* initialize inflate */
   172     strm.zalloc = Z_NULL;
   173     strm.zalloc = Z_NULL;
   173     strm.zfree = Z_NULL;
   174     strm.zfree = Z_NULL;
   174     strm.opaque = Z_NULL;
   175     strm.opaque = Z_NULL;
   242     } while (ret != Z_STREAM_END);
   243     } while (ret != Z_STREAM_END);
   243 
   244 
   244     /* clean up and return index (release unused entries in list) */
   245     /* clean up and return index (release unused entries in list) */
   245     (void)inflateEnd(&strm);
   246     (void)inflateEnd(&strm);
   246     
   247     
   247     struct point *next = (struct point *)realloc(index->list, sizeof(struct point) * index->have);
   248     next = (struct point *)realloc(index->list, sizeof(struct point) * index->have);
   248     if (next == NULL) {
   249     if (next == NULL) {
   249         free_index(index);
   250         free_index(index);
   250         return Z_MEM_ERROR;
   251         return Z_MEM_ERROR;
   251     }
   252     }
   252     index->list = next;
   253     index->list = next;