diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2017-09-19 12:46:20 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2017-09-19 12:46:20 +0200 |
| commit | fdef69b43ce5222ac0f2a87f2fad1442ece340e8 (patch) | |
| tree | 10efa6578035cc1f5fb6064bebac759d880c2c70 /src/lib/openjp2/sparse_array.c | |
| parent | 18f6696372f4c32334385f8dcc8d39ad8ac24601 (diff) | |
Fix warnings and errors when compiling with a c++ compiler (#1021)
Diffstat (limited to 'src/lib/openjp2/sparse_array.c')
| -rw-r--r-- | src/lib/openjp2/sparse_array.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/openjp2/sparse_array.c b/src/lib/openjp2/sparse_array.c index 6a2d8d43..67212d28 100644 --- a/src/lib/openjp2/sparse_array.c +++ b/src/lib/openjp2/sparse_array.c @@ -56,7 +56,8 @@ opj_sparse_array_int32_t* opj_sparse_array_int32_create(OPJ_UINT32 width, return NULL; } - sa = opj_calloc(1, sizeof(opj_sparse_array_int32_t)); + sa = (opj_sparse_array_int32_t*) opj_calloc(1, + sizeof(opj_sparse_array_int32_t)); sa->width = width; sa->height = height; sa->block_width = block_width; @@ -67,8 +68,8 @@ opj_sparse_array_int32_t* opj_sparse_array_int32_create(OPJ_UINT32 width, opj_free(sa); return NULL; } - sa->data_blocks = opj_calloc(sizeof(OPJ_INT32*), - sa->block_count_hor * sa->block_count_ver); + sa->data_blocks = (OPJ_INT32**) opj_calloc(sizeof(OPJ_INT32*), + sa->block_count_hor * sa->block_count_ver); if (sa->data_blocks == NULL) { opj_free(sa); return NULL; @@ -232,8 +233,8 @@ static OPJ_BOOL opj_sparse_array_int32_read_or_write( } } else { if (src_block == NULL) { - src_block = opj_calloc(1, - sa->block_width * sa->block_height * sizeof(OPJ_INT32)); + src_block = (OPJ_INT32*) opj_calloc(1, + sa->block_width * sa->block_height * sizeof(OPJ_INT32)); if (src_block == NULL) { return OPJ_FALSE; } |
