warning fixes for BCC and OW (heavily modified patch 819146)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24196 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-10-16 10:28:15 +00:00
parent 0cc66b6c0b
commit 999836aaca
62 changed files with 175 additions and 266 deletions

View File

@@ -459,7 +459,7 @@ bool wxBMPHandler::DoLoadDib(wxImage * image, int width, int height,
wxUint16 aWord;
// allocate space for palette if needed:
_cmap *cmap = NULL;
_cmap *cmap;
if ( bpp < 16 )
{
@@ -602,27 +602,23 @@ bool wxBMPHandler::DoLoadDib(wxImage * image, int width, int height,
ptr = data;
}
int line = 0;
int column = 0;
int linesize = ((width * bpp + 31) / 32) * 4;
/* BMPs are stored upside down */
for ( line = (height - 1); line >= 0; line-- )
for ( int line = (height - 1); line >= 0; line-- )
{
int linepos = 0;
for ( column = 0; column < width ; )
for ( int column = 0; column < width ; )
{
if ( bpp < 16 )
{
int index = 0;
linepos++;
aByte = stream.GetC();
if ( bpp == 1 )
{
int bit = 0;
for (bit = 0; bit < 8 && column < width; bit++)
for (int bit = 0; bit < 8 && column < width; bit++)
{
index = ((aByte & (0x80 >> bit)) ? 1 : 0);
int index = ((aByte & (0x80 >> bit)) ? 1 : 0);
ptr[poffset] = cmap[index].r;
ptr[poffset + 1] = cmap[index].g;
ptr[poffset + 2] = cmap[index].b;
@@ -700,10 +696,9 @@ bool wxBMPHandler::DoLoadDib(wxImage * image, int width, int height,
}
else
{
int nibble = 0;
for (nibble = 0; nibble < 2 && column < width; nibble++)
for (int nibble = 0; nibble < 2 && column < width; nibble++)
{
index = ((aByte & (0xF0 >> nibble * 4)) >> (!nibble * 4));
int index = ((aByte & (0xF0 >> nibble * 4)) >> (!nibble * 4));
if ( index >= 16 )
index = 15;
ptr[poffset] = cmap[index].r;