]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagpcx.cpp
added some utils (tex2rtf, helpgen, makegen) to make system
[wxWidgets.git] / src / common / imagpcx.cpp
index d28a456f6a3d13797b5acc2ccc3f08e3f667ab5f..e6f2f05a87c2d0c9bfc66f99155f3084062eef7b 100644 (file)
@@ -303,7 +303,7 @@ int SavePCX(wxImage *image, wxOutputStream& stream)
     wxHashTable h(wxKEY_INTEGER);   // image histogram
     unsigned long key;              // key in the hashtable
     unsigned int i;
+
     // See if we can save as 8 bit.
     //
     if (image->CountColours(256) <= 256)
@@ -370,7 +370,7 @@ int SavePCX(wxImage *image, wxOutputStream& stream)
                     key = (r << 16) | (g << 8) | b;
 
                     hnode = (wxHNode *) h.Get(key);
-                    p[i] = hnode->index;
+                    p[i] = (unsigned char)hnode->index;
                 }
                 break;
             }
@@ -388,7 +388,7 @@ int SavePCX(wxImage *image, wxOutputStream& stream)
 
         RLEencode(p, bytesperline * nplanes, stream);
     }
-    
+
     free(p);
 
     // For 8 bit images, build the palette and write it to the stream