struct opj_j2k: remove unused fields, and add some documentation
[openjpeg.git] / src / lib / openjp2 / bench_dwt.c
index 0dc278f3ec8ae83b76fe08bf287a554033107936..8cb64d06690bc3f1cc0ede4649b3ec818e4a9d88 100644 (file)
@@ -62,13 +62,14 @@ void init_tilec(opj_tcd_tilecomp_t * l_tilec,
     l_tilec->y1 = y1;
     nValues = (size_t)(l_tilec->x1 - l_tilec->x0) *
               (size_t)(l_tilec->y1 - l_tilec->y0);
-    l_tilec->data = opj_malloc(sizeof(OPJ_INT32) * nValues);
+    l_tilec->data = (OPJ_INT32*) opj_malloc(sizeof(OPJ_INT32) * nValues);
     for (i = 0; i < nValues; i++) {
         l_tilec->data[i] = getValue((OPJ_UINT32)i);
     }
     l_tilec->numresolutions = numresolutions;
-    l_tilec->resolutions = opj_calloc(l_tilec->numresolutions,
-                                      sizeof(opj_tcd_resolution_t));
+    l_tilec->resolutions = (opj_tcd_resolution_t*) opj_calloc(
+                               l_tilec->numresolutions,
+                               sizeof(opj_tcd_resolution_t));
 
     l_level_no = l_tilec->numresolutions;
     l_res = l_tilec->resolutions;
@@ -256,7 +257,7 @@ int main(int argc, char** argv)
             size_t idx;
             size_t nValues = (size_t)(tilec.x1 - tilec.x0) *
                              (size_t)(tilec.y1 - tilec.y0);
-            for (idx = 0; i < (OPJ_INT32)nValues; i++) {
+            for (idx = 0; idx < nValues; idx++) {
                 if (tilec.data[idx] != getValue((OPJ_UINT32)idx)) {
                     printf("Difference found at idx = %u\n", (OPJ_UINT32)idx);
                     exit(1);