X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e30285abc6cb45d7e2cd66ddfe3eb460821f57ae..d6a7ca317ff8ca63e468aaa72818d17211d7476b:/src/common/imagpcx.cpp diff --git a/src/common/imagpcx.cpp b/src/common/imagpcx.cpp index 975252e0e1..58eb0034c2 100644 --- a/src/common/imagpcx.cpp +++ b/src/common/imagpcx.cpp @@ -8,10 +8,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "imagpcx.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -21,6 +17,7 @@ #ifndef WX_PRECOMP # include "wx/defs.h" +# include "wx/palette.h" #endif #if wxUSE_IMAGE && wxUSE_PCX @@ -107,7 +104,7 @@ void RLEdecode(unsigned char *p, unsigned int size, wxInputStream& s) // If ((data & 0xC0) != 0xC0), then the value read is a data // byte. Else, it is a counter (cont = val & 0x3F) and the // next byte is the data byte. - // + if ((data & 0xC0) != 0xC0) { *(p++) = (unsigned char)data; @@ -317,7 +314,7 @@ int SavePCX(wxImage *image, wxOutputStream& stream) unsigned char *src; // pointer into wxImage data unsigned int width, height; // size of the image unsigned int bytesperline; // bytes per line (each plane) - int nplanes = 3; // number of planes + unsigned char nplanes = 3; // number of planes int format = wxPCX_24BIT; // image format (8 bit, 24 bit) wxImageHistogram histogram; // image histogram unsigned long key; // key in the hashtable @@ -415,9 +412,9 @@ int SavePCX(wxImage *image, wxOutputStream& stream) memset(pal, 0, sizeof(pal)); unsigned long index; - + for (wxImageHistogram::iterator entry = histogram.begin(); - entry != histogram.end(); entry++ ) + entry != histogram.end(); ++entry ) { key = entry->first; index = entry->second.index; @@ -446,7 +443,7 @@ bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose if (verbose) wxLogError(_("PCX: this is not a PCX file.")); - return FALSE; + return false; } image->Destroy(); @@ -464,10 +461,10 @@ bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose } } image->Destroy(); - return FALSE; + return false; } - return TRUE; + return true; } bool wxPCXHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose ) @@ -494,7 +491,7 @@ bool wxPCXHandler::DoCanRead( wxInputStream& stream ) { unsigned char c = stream.GetC(); if ( !stream ) - return FALSE; + return false; // not very safe, but this is all we can get from PCX header :-( return c == 10;