]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/xpmdecod.cpp
Readd wxStringList::Add when wxUSE_STL=1, for compatibility with
[wxWidgets.git] / src / common / xpmdecod.cpp
index 3b33f948acb91f734f01538aa29ffaec4acfa9d5..b97af0c98b6d13711c27690fd290733f19247999 100644 (file)
@@ -115,9 +115,7 @@ license is as follows:
 #include "wx/intl.h"
 #include <string.h>
 
-#ifdef __VISUALC__
 #include <ctype.h>
-#endif
 
 #include "wx/xpmdecod.h"
 
@@ -129,7 +127,7 @@ bool wxXPMDecoder::CanRead(wxInputStream& stream)
     if ( !stream.Read(buf, WXSIZEOF(buf)) )
         return FALSE;
 
-    stream.SeekI(-WXSIZEOF(buf), wxFromCurrent);
+    stream.SeekI(-(off_t)WXSIZEOF(buf), wxFromCurrent);
 
     return memcmp(buf, "/* XPM */", WXSIZEOF(buf)) == 0;
 }
@@ -145,7 +143,7 @@ wxImage wxXPMDecoder::ReadFile(wxInputStream& stream)
     wxCharBuffer buffer(length);
 
     char *xpm_buffer = (char *)buffer.data();
-    if ( stream.Read(xpm_buffer, length).LastError() == wxSTREAM_READ_ERROR )
+    if ( stream.Read(xpm_buffer, length).GetLastError() == wxSTREAM_READ_ERROR )
         return wxNullImage;
     xpm_buffer[length] = '\0';
 
@@ -490,6 +488,7 @@ static rgbRecord theRGBRecords[] =
     {"seagreen", myRGB(82, 149, 132)},
     {"seashell", myRGB(255, 245, 238)},
     {"sienna", myRGB(150, 82, 45)},
+    {"silver", myRGB(192, 192, 192)},
     {"skyblue", myRGB(114, 159, 255)},
     {"slateblue", myRGB(126, 136, 171)},
     {"slategray", myRGB(112, 128, 144)},
@@ -510,7 +509,7 @@ static rgbRecord theRGBRecords[] =
     {"yellowgreen", myRGB(50, 216, 56)},
     {NULL, myRGB(0, 0, 0)}
 };
-static int numTheRGBRecords = 234;
+static int numTheRGBRecords = 235;
 
 static unsigned char ParseHexadecimal(char digit1, char digit2)
 {
@@ -552,7 +551,13 @@ static bool GetRGBFromName(const char *inname, bool *isNone,
         return TRUE;
     }
 
-    name = strdup(inname);
+#ifdef __WXWINCE__
+    // TODO: is this right? How come it compiles on other
+    // platforms?
+    name = (char*) wxStrdup((wxChar*) inname);
+#else
+    name = wxStrdup(inname);
+#endif
 
     // theRGBRecords[] has no names with spaces, and no grey, but a
     // lot of gray...
@@ -639,7 +644,7 @@ static const char *ParseColor(const char *data)
         {
             if ( *r != *q )
                 continue;
-            if ( !isspace((int) (*(r - 1))) )
+            if ( !wxIsspace((int) (*(r - 1))) )
                 continue;
             p = r;
             for (;;)
@@ -659,7 +664,7 @@ struct wxXPMColourMapData
 {
     unsigned char R,G,B;
 };
-WX_DECLARE_STRING_HASH_MAP(wxXPMColourMapData, wxXPMColourMap)
+WX_DECLARE_STRING_HASH_MAP(wxXPMColourMapData, wxXPMColourMap);
 
 wxImage wxXPMDecoder::ReadData(const char **xpm_data)
 {