summaryrefslogtreecommitdiff
path: root/src/bin/jp2/converttif.c
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2015-10-07 11:58:11 +0200
committerStefan Weil <sw@weilnetz.de>2015-10-07 20:53:57 +0200
commitc8ae3c522552271f426eaa9c6d158a72e9c5f26f (patch)
treef1694f45b7bddcbd63e9480c913a76e7410cbe14 /src/bin/jp2/converttif.c
parent07f65540b54f83919447ea8e515b95a4777d8ae0 (diff)
Fix warnings for C++
g++ complains about invalid conversions like these ones: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive] error: invalid conversion from ‘void*’ to ‘opj_precision* {aka opj_prec*}’ [-fpermissive] Signed-off-by: Stefan Weil <sw@weilnetz.de>
Diffstat (limited to 'src/bin/jp2/converttif.c')
-rw-r--r--src/bin/jp2/converttif.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/jp2/converttif.c b/src/bin/jp2/converttif.c
index f164989f..dbda0741 100644
--- a/src/bin/jp2/converttif.c
+++ b/src/bin/jp2/converttif.c
@@ -290,7 +290,7 @@ int imagetotif(opj_image_t * image, const char *outfile)
TIFFClose(tif);
return 1;
}
- buffer32s = malloc((OPJ_SIZE_T)width * numcomps * sizeof(OPJ_INT32));
+ buffer32s = (OPJ_INT32 *)malloc((OPJ_SIZE_T)width * numcomps * sizeof(OPJ_INT32));
if (buffer32s == NULL) {
_TIFFfree(buf);
TIFFClose(tif);
@@ -299,7 +299,7 @@ int imagetotif(opj_image_t * image, const char *outfile)
for (i = 0; i < image->comps[0].h; ++i) {
cvtPxToCx(planes, buffer32s, (OPJ_SIZE_T)width, adjust);
- cvt32sToTif(buffer32s, buf, (OPJ_SIZE_T)width * numcomps);
+ cvt32sToTif(buffer32s, (OPJ_BYTE *)buf, (OPJ_SIZE_T)width * numcomps);
(void)TIFFWriteEncodedStrip(tif, i, (void*)buf, strip_size);
planes[0] += width;
planes[1] += width;
@@ -590,7 +590,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
return NULL;
}
rowStride = ((OPJ_SIZE_T)w * tiSpp * tiBps + 7U) / 8U;
- buffer32s = malloc((OPJ_SIZE_T)w * tiSpp * sizeof(OPJ_INT32));
+ buffer32s = (OPJ_INT32 *)malloc((OPJ_SIZE_T)w * tiSpp * sizeof(OPJ_INT32));
if (buffer32s == NULL) {
_TIFFfree(buf);
TIFFClose(tif);