]> git.saurik.com Git - wxWidgets.git/commitdiff
Minor wxPNGHandler cleanup.
authorDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Tue, 4 Jan 2011 13:33:48 +0000 (13:33 +0000)
committerDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Tue, 4 Jan 2011 13:33:48 +0000 (13:33 +0000)
Use int instead of png_uint_16 everywhere regarding number of palette entries, similar to how libpng exposes it (internally it uses png_uint_16).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/imagpng.cpp

index 80881936174b2bf8a5c602f590c640bad5aabd85..700833b776b4f5a71439ff07dc9dca31494e4bb6 100644 (file)
@@ -650,9 +650,9 @@ error:
 // ----------------------------------------------------------------------------
 
 static int PaletteFind(const png_color& clr,
-    const png_color *pal, png_uint_16 palCount)
+    const png_color *pal, int palCount)
 {
-   for (png_uint_16 i = 0; i < palCount; i++)
+   for (int i = 0; i < palCount; ++i)
    {
       if (    (clr.red   == pal[i].red)
            && (clr.green == pal[i].green)
@@ -848,8 +848,7 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos
             return false;
         }
 
-        png_uint_16 i;
-        for (i = 0; i < palCount; ++i)
+        for (int i = 0; i < palCount; ++i)
         {
             pal.GetRGB(i, &palette[i].red, &palette[i].green, &palette[i].blue);
         }