Commit e9fa4baf authored by Nathan Baker's avatar Nathan Baker Committed by Olivier Paquet

Fix all compiler warnings for default build

parent c4d31e9b
......@@ -926,6 +926,7 @@ int tokenizer(unsigned inflag,char *token,int tokmax,char *line,
{
case IN_WHITE:
_p_state=IN_TOKEN; /* switch states */
/* Fall through */
case IN_TOKEN: /* these 2 are */
case IN_QUOTE: /* identical here */
......
......@@ -526,14 +526,14 @@ setrow(uint8* row, uint32 nrows, const uint8* rows[])
for (i = fw; i > 8; i--)
acc += bits[*src++];
/* fall thru... */
case 8: acc += bits[*src++];
case 7: acc += bits[*src++];
case 6: acc += bits[*src++];
case 5: acc += bits[*src++];
case 4: acc += bits[*src++];
case 3: acc += bits[*src++];
case 2: acc += bits[*src++];
case 1: acc += bits[*src++];
case 8: acc += bits[*src++]; /* fall thru */
case 7: acc += bits[*src++]; /* fall thru */
case 6: acc += bits[*src++]; /* fall thru */
case 5: acc += bits[*src++]; /* fall thru */
case 4: acc += bits[*src++]; /* fall thru */
case 3: acc += bits[*src++]; /* fall thru */
case 2: acc += bits[*src++]; /* fall thru */
case 1: acc += bits[*src++]; /* fall thru */
case 0: break;
}
acc += bits[*src & mask1];
......
......@@ -3736,12 +3736,13 @@ tsize_t
t2p_sample_rgbaa_to_rgb(tdata_t data, uint32 samplecount)
{
uint32 i;
/* For the 3 first samples, there is overlapping between souce and
destination, so use memmove().
See http://bugzilla.maptools.org/show_bug.cgi?id=2577 */
for(i = 0; i < 3 && i < samplecount; i++)
memmove((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
/* For the 3 first samples, there is overlap between source and
* destination, so use memmove().
* See http://bugzilla.maptools.org/show_bug.cgi?id=2577
*/
for(i = 0; i < 3 && i < samplecount; i++)
memmove((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
for(; i < samplecount; i++)
memcpy((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
......
......@@ -436,7 +436,8 @@ PrintIntDiff(uint32 row, int sample, uint32 pix, uint32 w1, uint32 w2)
{
int32 mask1, mask2, s;
mask1 = ~((-1) << bitspersample);
/* mask1 should have the n lowest bits set, where n == bitspersample */
mask1 = ((int32)1 << bitspersample) - 1;
s = (8 - bitspersample);
mask2 = mask1 << s;
for (; mask2 && pix < imagewidth;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment