diff options
author | bfriesen <bfriesen> | 2015-05-28 02:25:11 +0000 |
---|---|---|
committer | bfriesen <bfriesen> | 2015-05-28 02:25:11 +0000 |
commit | ae646fefaf65676aa5c98dcc148fffe1ef0d388d (patch) | |
tree | 476784daf79f23a57fc038cd92200a8193dcab4d /tools | |
parent | 0a0eef572fdb03321ef0b596295ba9c2673f6058 (diff) | |
download | libtiff-ae646fefaf65676aa5c98dcc148fffe1ef0d388d.tar.gz |
* tools/tiffmedian.c (GetInputLine): Fix Coverity 1024795 "Nesting
level does not match indentation".
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tiffmedian.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/tools/tiffmedian.c b/tools/tiffmedian.c index 6501494b..2059a9e0 100644 --- a/tools/tiffmedian.c +++ b/tools/tiffmedian.c @@ -1,4 +1,4 @@ -/* $Id: tiffmedian.c,v 1.10 2010-03-10 18:56:50 bfriesen Exp $ */ +/* $Id: tiffmedian.c,v 1.11 2015-05-28 02:25:11 bfriesen Exp $ */ /* * Apply median cut on an image. @@ -779,24 +779,28 @@ quant(TIFF* in, TIFF* out) #define SWAP(type,a,b) { type p; p = a; a = b; b = p; } -#define GetInputLine(tif, row, bad) \ - if (TIFFReadScanline(tif, inputline, row, 0) <= 0) \ - bad; \ - inptr = inputline; \ - nextptr = nextline; \ - for (j = 0; j < imagewidth; ++j) { \ - *nextptr++ = *inptr++; \ - *nextptr++ = *inptr++; \ - *nextptr++ = *inptr++; \ - } +#define GetInputLine(tif, row, bad) \ + do { \ + if (TIFFReadScanline(tif, inputline, row, 0) <= 0) \ + bad; \ + inptr = inputline; \ + nextptr = nextline; \ + for (j = 0; j < imagewidth; ++j) { \ + *nextptr++ = *inptr++; \ + *nextptr++ = *inptr++; \ + *nextptr++ = *inptr++; \ + } \ + } while (0); #define GetComponent(raw, cshift, c) \ - cshift = raw; \ - if (cshift < 0) \ - cshift = 0; \ - else if (cshift >= MAX_COLOR) \ - cshift = MAX_COLOR-1; \ - c = cshift; \ - cshift >>= COLOR_SHIFT; + do { \ + cshift = raw; \ + if (cshift < 0) \ + cshift = 0; \ + else if (cshift >= MAX_COLOR) \ + cshift = MAX_COLOR-1; \ + c = cshift; \ + cshift >>= COLOR_SHIFT; \ + } while (0); static void quant_fsdither(TIFF* in, TIFF* out) |