]> git.saurik.com Git - wxWidgets.git/commitdiff
Make wxPalette ctor and Create() const-correct in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 Dec 2011 23:52:47 +0000 (23:52 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 Dec 2011 23:52:47 +0000 (23:52 +0000)
The input data is never modified so should be const (it is also documented as
being const and actually is const in the other ports).

Closes #13776.

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

include/wx/msw/palette.h
src/msw/palette.cpp

index 9d28bbfc3adee479c426f7b544835c15ee0e1a8e..7d0cacec6a958e39248a8740cffe2bbbd665188d 100644 (file)
@@ -19,13 +19,13 @@ class WXDLLIMPEXP_CORE wxPalette : public wxPaletteBase
 public:
     wxPalette() { }
     wxPalette(int n,
-              unsigned char *red, unsigned char *green, unsigned char *blue)
+              const unsigned char *red, const unsigned char *green, const unsigned char *blue)
     {
         Create(n, red, green, blue);
     }
 
     bool Create(int n,
-                unsigned char *red, unsigned char *green, unsigned char *blue);
+                const unsigned char *red, const unsigned char *green, const unsigned char *blue);
 
     virtual int GetColoursCount() const;
 
index a9c9fc8056ea2c5b25976f4cb294369df053bf42..2547d98851e78b054313b37e80cb256ace4f0cd9 100644 (file)
@@ -32,9 +32,9 @@ public:
     wxPaletteRefData() { Init(); }
 
     wxPaletteRefData(int n,
-                     unsigned char *red,
-                     unsigned char *green,
-                     unsigned char *blue)
+                     const unsigned char *red,
+                     const unsigned char *green,
+                     const unsigned char *blue)
     {
         Init();
 
@@ -117,9 +117,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject)
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
 bool wxPalette::Create(int n,
-                       unsigned char *red,
-                       unsigned char *green,
-                       unsigned char *blue)
+                       const unsigned char *red,
+                       const unsigned char *green,
+                       const unsigned char *blue)
 {
     m_refData = new wxPaletteRefData(n, red, green, blue);