mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng15] Fixed compiler warnings with Intel and MSYS compilers.
The logical shift fix for Microsoft Visual C is required by other compilers, so this enables that fix for all compilers when using compile-time constants. Under MSYS 'byte' is a name declared in a system header file, so we changed the name of a local variable to avoid the warnings that result.
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
cb75699dff
commit
92ef313c77
12
pngrtran.c
12
pngrtran.c
@@ -2484,8 +2484,8 @@ png_do_unshift(png_row_infop row_info, png_bytep row,
|
||||
|
||||
while (bp < bp_end)
|
||||
{
|
||||
int byte = (*bp >> 1) & 0x55;
|
||||
*bp++ = (png_byte)byte;
|
||||
int b = (*bp >> 1) & 0x55;
|
||||
*bp++ = (png_byte)b;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2503,8 +2503,8 @@ png_do_unshift(png_row_infop row_info, png_bytep row,
|
||||
|
||||
while (bp < bp_end)
|
||||
{
|
||||
int byte = (*bp >> gray_shift) & mask;
|
||||
*bp++ = (png_byte)byte;
|
||||
int b = (*bp >> gray_shift) & mask;
|
||||
*bp++ = (png_byte)b;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2518,10 +2518,10 @@ png_do_unshift(png_row_infop row_info, png_bytep row,
|
||||
|
||||
while (bp < bp_end)
|
||||
{
|
||||
int byte = *bp >> shift[channel];
|
||||
int b = *bp >> shift[channel];
|
||||
if (++channel >= channels)
|
||||
channel = 0;
|
||||
*bp++ = (png_byte)byte;
|
||||
*bp++ = (png_byte)b;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user