diff options
author | Nathan Baker <elitebadger@gmail.com> | 2018-02-04 23:54:17 +0000 |
---|---|---|
committer | Olivier Paquet <olivier.paquet@gmail.com> | 2018-02-04 23:54:17 +0000 |
commit | e9fa4baf1da46058e75c29d9b8d894c913199963 (patch) | |
tree | 2d0c7f7ef588a6c82e1cdfe1e7a28489bc8e06cb /tools/tiffcrop.c | |
parent | c4d31e9b06a06d3876a86fc2166ee52c641e95a0 (diff) | |
download | libtiff-git-e9fa4baf1da46058e75c29d9b8d894c913199963.tar.gz |
Fix all compiler warnings for default build
Diffstat (limited to 'tools/tiffcrop.c')
-rw-r--r-- | tools/tiffcrop.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c index d82a94c8..91a38f67 100644 --- a/tools/tiffcrop.c +++ b/tools/tiffcrop.c @@ -2210,8 +2210,9 @@ main(int argc, char* argv[]) unsigned int total_pages = 0; unsigned int total_images = 0; unsigned int end_of_input = FALSE; - int seg, length; - char temp_filename[PATH_MAX + 1]; + int seg; + size_t length; + char temp_filename[PATH_MAX + 16]; /* Extra space keeps the compiler from complaining */ little_endian = *((unsigned char *)&little_endian) & '1'; @@ -2303,8 +2304,8 @@ main(int argc, char* argv[]) if (dump.infile != NULL) fclose (dump.infile); - /* dump.infilename is guaranteed to be NUL termimated and have 20 bytes - fewer than PATH_MAX */ + /* dump.infilename is guaranteed to be NUL terminated and have 20 bytes + fewer than PATH_MAX */ snprintf(temp_filename, sizeof(temp_filename), "%s-read-%03d.%s", dump.infilename, dump_images, (dump.format == DUMP_TEXT) ? "txt" : "raw"); @@ -2322,7 +2323,7 @@ main(int argc, char* argv[]) if (dump.outfile != NULL) fclose (dump.outfile); - /* dump.outfilename is guaranteed to be NUL termimated and have 20 bytes + /* dump.outfilename is guaranteed to be NUL terminated and have 20 bytes fewer than PATH_MAX */ snprintf(temp_filename, sizeof(temp_filename), "%s-write-%03d.%s", dump.outfilename, dump_images, @@ -9055,8 +9056,9 @@ mirrorImage(uint16 spp, uint16 bps, uint16 mirror, uint32 width, uint32 length, _TIFFfree(line_buff); if (mirror == MIRROR_VERT) break; + /* Fall through */ case MIRROR_HORIZ : - if ((bps % 8) == 0) /* byte alligned data */ + if ((bps % 8) == 0) /* byte aligned data */ { for (row = 0; row < length; row++) { @@ -9201,7 +9203,7 @@ invertImage(uint16 photometric, uint16 spp, uint16 bps, uint32 width, uint32 len bytebuff2 = 4 - (uint8)(*src & 48 >> 4); bytebuff3 = 4 - (uint8)(*src & 12 >> 2); bytebuff4 = 4 - (uint8)(*src & 3); - *src = (bytebuff1 << 6) || (bytebuff2 << 4) || (bytebuff3 << 2) || bytebuff4; + *src = (bytebuff1 << 6) | (bytebuff2 << 4) | (bytebuff3 << 2) | bytebuff4; src++; } break; |