summaryrefslogtreecommitdiff
path: root/src/bin/jp2/convertbmp.c
diff options
context:
space:
mode:
authorjulienmalik <julienmalik@users.noreply.github.com>2016-04-29 23:49:17 +0200
committerMatthieu Darbois <mayeut@users.noreply.github.com>2016-04-29 23:49:17 +0200
commit319fc971fef8a1e1c1c543506c26805873e3f258 (patch)
tree9c17957f208bffbf04276bdd012cd8428209e377 /src/bin/jp2/convertbmp.c
parente166e4a209d9a3e4b583e4b2cdcbab2c57967eb1 (diff)
cppcheck fix for openjp2 (#740)
Diffstat (limited to 'src/bin/jp2/convertbmp.c')
-rw-r--r--src/bin/jp2/convertbmp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/jp2/convertbmp.c b/src/bin/jp2/convertbmp.c
index 910574b8..a09c0ae5 100644
--- a/src/bin/jp2/convertbmp.c
+++ b/src/bin/jp2/convertbmp.c
@@ -181,7 +181,7 @@ static void bmpmask32toimage(const OPJ_UINT8* pData, OPJ_UINT32 stride, opj_imag
OPJ_UINT32 width, height;
OPJ_UINT32 x, y;
const OPJ_UINT8 *pSrc = NULL;
- OPJ_BOOL hasAlpha = OPJ_FALSE;
+ OPJ_BOOL hasAlpha;
OPJ_UINT32 redShift, redPrec;
OPJ_UINT32 greenShift, greenPrec;
OPJ_UINT32 blueShift, bluePrec;
@@ -239,7 +239,7 @@ static void bmpmask16toimage(const OPJ_UINT8* pData, OPJ_UINT32 stride, opj_imag
OPJ_UINT32 width, height;
OPJ_UINT32 x, y;
const OPJ_UINT8 *pSrc = NULL;
- OPJ_BOOL hasAlpha = OPJ_FALSE;
+ OPJ_BOOL hasAlpha;
OPJ_UINT32 redShift, redPrec;
OPJ_UINT32 greenShift, greenPrec;
OPJ_UINT32 blueShift, bluePrec;
@@ -891,7 +891,7 @@ int imagetobmp(opj_image_t * image, const char *outfile) {
fprintf(fdest, "%c%c%c", bc, gc, rc);
if ((i + 1) % w == 0) {
- for (pad = (3 * w) % 4 ? 4 - (3 * w) % 4 : 0; pad > 0; pad--) /* ADD */
+ for (pad = ((3 * w) % 4) ? (4 - (3 * w) % 4) : 0; pad > 0; pad--) /* ADD */
fprintf(fdest, "%c", 0);
}
}
@@ -967,7 +967,7 @@ int imagetobmp(opj_image_t * image, const char *outfile) {
fprintf(fdest, "%c", (OPJ_UINT8)r);
if ((i + 1) % w == 0) {
- for (pad = w % 4 ? 4 - w % 4 : 0; pad > 0; pad--) /* ADD */
+ for ((pad = w % 4) ? (4 - w % 4) : 0; pad > 0; pad--) /* ADD */
fprintf(fdest, "%c", 0);
}
}