]> git.saurik.com Git - wxWidgets.git/commitdiff
make array data fully const
authorPaul Cornett <paulcor@bullseye.com>
Wed, 2 Dec 2009 17:28:45 +0000 (17:28 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Wed, 2 Dec 2009 17:28:45 +0000 (17:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

29 files changed:
include/wx/datetime.h
include/wx/propgrid/advprops.h
include/wx/propgrid/property.h
include/wx/propgrid/props.h
src/aui/auibar.cpp
src/aui/auibook.cpp
src/aui/dockart.cpp
src/common/datetime.cpp
src/common/datetimefmt.cpp
src/common/fmapbase.cpp
src/common/strconv.cpp
src/common/utilscmn.cpp
src/common/xlocale.cpp
src/common/xpmdecod.cpp
src/generic/colrdlgg.cpp
src/generic/dcpsg.cpp
src/generic/dirctrlg.cpp
src/generic/editlbox.cpp
src/generic/grid.cpp
src/generic/logg.cpp
src/generic/prntdlgg.cpp
src/msw/textctrl.cpp
src/propgrid/advprops.cpp
src/propgrid/manager.cpp
src/propgrid/property.cpp
src/propgrid/props.cpp
src/unix/dialup.cpp
src/unix/dlunix.cpp
src/unix/threadpsx.cpp

index dc59c920cdee3746c5cf16717ffc985ecf3fa216..2531c54686b3e04458dd2b979b6fb6b648bff28e 100644 (file)
@@ -128,8 +128,8 @@ WXDLLIMPEXP_BASE struct tm *wxGmtime_r(const time_t*, struct tm*);
 // wxInvalidDateTime)
 class WXDLLIMPEXP_FWD_BASE wxDateTime;
 
-extern WXDLLIMPEXP_DATA_BASE(const char *) wxDefaultDateTimeFormat;
-extern WXDLLIMPEXP_DATA_BASE(const char *) wxDefaultTimeSpanFormat;
+extern WXDLLIMPEXP_DATA_BASE(const char) wxDefaultDateTimeFormat[];
+extern WXDLLIMPEXP_DATA_BASE(const char) wxDefaultTimeSpanFormat[];
 extern WXDLLIMPEXP_DATA_BASE(const wxDateTime) wxDefaultDateTime;
 
 #define wxInvalidDateTime wxDefaultDateTime
index 45a60693b0b96bdbc16f15c20c991460b2a5aa89..388eb9349a4fe8e7acfd0d9b6e007660fa09312f 100644 (file)
@@ -257,10 +257,10 @@ protected:
 
     // Special constructors to be used by derived classes.
     wxSystemColourProperty( const wxString& label, const wxString& name,
-        const wxChar** labels, const long* values, wxPGChoices* choicesCache,
+        const wxChar* const* labels, const long* values, wxPGChoices* choicesCache,
         const wxColourPropertyValue& value );
     wxSystemColourProperty( const wxString& label, const wxString& name,
-        const wxChar** labels, const long* values, wxPGChoices* choicesCache,
+        const wxChar* const* labels, const long* values, wxPGChoices* choicesCache,
         const wxColour& value );
 
     void Init( int type, const wxColour& colour );
index 94d8b500657fcb3ad7a7f8cb82696bfa34643076..2d8b69c1d03b91e3700c94cb2f60a4401748f0cb 100644 (file)
@@ -818,7 +818,7 @@ public:
         @param values
             Values for choices. If NULL, indexes are used.
     */
-    wxPGChoices( const wxChar** labels, const long* values = NULL )
+    wxPGChoices( const wxChar* const* labels, const long* values = NULL )
     {
         Init();
         Set(labels,values);
@@ -866,7 +866,7 @@ public:
         @param values
             Values for added choices. If empty, relevant entry indexes are used.
     */
-    void Add( const wxChar** labels, const ValArrItem* values = NULL );
+    void Add( const wxChar* const* labels, const ValArrItem* values = NULL );
 
     /** Version that works with wxArrayString and wxArrayInt. */
     void Add( const wxArrayString& arr, const wxArrayInt& arrint = wxArrayInt() );
@@ -994,7 +994,7 @@ public:
 
 #ifndef SWIG
     /** Does not create copies for itself. */
-    void Set( const wxChar** labels, const long* values = NULL )
+    void Set( const wxChar* const* labels, const long* values = NULL )
     {
         Free();
         Add(labels,values);
@@ -2067,7 +2067,7 @@ public:
             return m_validator;
         return DoGetValidator();
     }
-#endif // #if wxUSE_VALIDATORS
+#endif // wxUSE_VALIDATORS
 
 #ifndef SWIG
     /** Returns client data (void*) of a property.
index 53f4db9b7c8e8382f7c2a3dbcc6b4954f8e859ad..554a2c3a29619ea6f92214b48260bea25a5762b1 100644 (file)
@@ -370,7 +370,7 @@ public:
 #ifndef SWIG
     wxEnumProperty( const wxString& label = wxPG_LABEL,
                     const wxString& name = wxPG_LABEL,
-                    const wxChar** labels = NULL,
+                    const wxChar* const* labels = NULL,
                     const long* values = NULL,
                     int value = 0 );
     wxEnumProperty( const wxString& label,
@@ -381,7 +381,7 @@ public:
     // Special constructor for caching choices (used by derived class)
     wxEnumProperty( const wxString& label,
                     const wxString& name,
-                    const wxChar** labels,
+                    const wxChar* const* labels,
                     const long* values,
                     wxPGChoices* choicesCache,
                     int value = 0 );
@@ -468,7 +468,7 @@ public:
 
     wxEditEnumProperty( const wxString& label,
                         const wxString& name,
-                        const wxChar** labels,
+                        const wxChar* const* labels,
                         const long* values,
                         const wxString& value );
     wxEditEnumProperty( const wxString& label = wxPG_LABEL,
@@ -484,7 +484,7 @@ public:
     // Special constructor for caching choices (used by derived class)
     wxEditEnumProperty( const wxString& label,
                         const wxString& name,
-                        const wxChar** labels,
+                        const wxChar* const* labels,
                         const long* values,
                         wxPGChoices* choicesCache,
                         const wxString& value );
@@ -514,7 +514,7 @@ public:
 #ifndef SWIG
     wxFlagsProperty( const wxString& label,
                      const wxString& name,
-                     const wxChar** labels,
+                     const wxChar* const* labels,
                      const long* values = NULL,
                      long value = 0 );
     wxFlagsProperty( const wxString& label,
index c7583b9d88d430e73b730f7e9d634b0671a3bac2..773ccf41df7f88f05b042e1e7d8f0f536fb249a7 100644 (file)
@@ -185,8 +185,8 @@ wxAuiDefaultToolBarArt::wxAuiDefaultToolBarArt()
     m_gripper_pen2 = wxPen(darker3_colour);
     m_gripper_pen3 = *wxWHITE_PEN;
 
-    static unsigned char button_dropdown_bits[] = { 0xe0, 0xf1, 0xfb };
-    static unsigned char overflow_bits[] = { 0x80, 0xff, 0x80, 0xc1, 0xe3, 0xf7 };
+    static const unsigned char button_dropdown_bits[] = { 0xe0, 0xf1, 0xfb };
+    static const unsigned char overflow_bits[] = { 0x80, 0xff, 0x80, 0xc1, 0xe3, 0xf7 };
 
     m_button_dropdown_bmp = wxAuiBitmapFromBits(button_dropdown_bits, 5, 3,
                                                 *wxBLACK);
index 3cdc6a6f0680d97220609fdf4eb75e97e8a91506..ca1cff4a3ae9bc10371f925cc1d305a45b291617 100644 (file)
@@ -145,33 +145,33 @@ private:
 // -- bitmaps --
 
 #if defined( __WXMAC__ )
- static unsigned char close_bits[]={
+ static const unsigned char close_bits[]={
      0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0x03, 0xF8, 0x01, 0xF0, 0x19, 0xF3,
      0xB8, 0xE3, 0xF0, 0xE1, 0xE0, 0xE0, 0xF0, 0xE1, 0xB8, 0xE3, 0x19, 0xF3,
      0x01, 0xF0, 0x03, 0xF8, 0x0F, 0xFE, 0xFF, 0xFF };
 #elif defined( __WXGTK__)
- static unsigned char close_bits[]={
+ static const unsigned char close_bits[]={
      0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xfb, 0xef, 0xdb, 0xed, 0x8b, 0xe8,
      0x1b, 0xec, 0x3b, 0xee, 0x1b, 0xec, 0x8b, 0xe8, 0xdb, 0xed, 0xfb, 0xef,
      0x07, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 #else
- static unsigned char close_bits[]={
+ static const unsigned char close_bits[]={
      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xf3, 0xcf, 0xf9,
      0x9f, 0xfc, 0x3f, 0xfe, 0x3f, 0xfe, 0x9f, 0xfc, 0xcf, 0xf9, 0xe7, 0xf3,
      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 #endif
 
-static unsigned char left_bits[] = {
+static const unsigned char left_bits[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfe, 0x3f, 0xfe,
    0x1f, 0xfe, 0x0f, 0xfe, 0x1f, 0xfe, 0x3f, 0xfe, 0x7f, 0xfe, 0xff, 0xfe,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
-static unsigned char right_bits[] = {
+static const unsigned char right_bits[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xff, 0x9f, 0xff, 0x1f, 0xff,
    0x1f, 0xfe, 0x1f, 0xfc, 0x1f, 0xfe, 0x1f, 0xff, 0x9f, 0xff, 0xdf, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
-static unsigned char list_bits[] = {
+static const unsigned char list_bits[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0x0f, 0xf8, 0xff, 0xff, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f, 0xfe, 0x7f, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
index 58b988cd1bc936763f0a5109776e6a3100c68812..227edd7a3b74edce690af7669cb01ad194b0e1de 100644 (file)
@@ -247,17 +247,17 @@ wxAuiDefaultDockArt::wxAuiDefaultDockArt()
 
     // some built in bitmaps
 #if defined( __WXMAC__ )
-     static unsigned char close_bits[]={
+     static const unsigned char close_bits[]={
          0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0x03, 0xF8, 0x01, 0xF0, 0x19, 0xF3,
          0xB8, 0xE3, 0xF0, 0xE1, 0xE0, 0xE0, 0xF0, 0xE1, 0xB8, 0xE3, 0x19, 0xF3,
          0x01, 0xF0, 0x03, 0xF8, 0x0F, 0xFE, 0xFF, 0xFF };
 #elif defined(__WXGTK__)
-     static unsigned char close_bits[]={
+     static const unsigned char close_bits[]={
          0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xfb, 0xef, 0xdb, 0xed, 0x8b, 0xe8,
          0x1b, 0xec, 0x3b, 0xee, 0x1b, 0xec, 0x8b, 0xe8, 0xdb, 0xed, 0xfb, 0xef,
          0x07, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 #else
-    static unsigned char close_bits[]={
+    static const unsigned char close_bits[]={
          // reduced height, symmetric
          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xf3, 0x9f, 0xf9,
          0x3f, 0xfc, 0x7f, 0xfe, 0x3f, 0xfc, 0x9f, 0xf9, 0xcf, 0xf3, 0xff, 0xff,
@@ -270,17 +270,17 @@ wxAuiDefaultDockArt::wxAuiDefaultDockArt()
       */
 #endif
 
-    static unsigned char maximize_bits[] = {
+    static const unsigned char maximize_bits[] = {
         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xf7, 0xf7, 0x07, 0xf0,
         0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x07, 0xf0,
         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
-    static unsigned char restore_bits[]={
+    static const unsigned char restore_bits[]={
         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0x1f, 0xf0, 0xdf, 0xf7,
         0x07, 0xf4, 0x07, 0xf4, 0xf7, 0xf5, 0xf7, 0xf1, 0xf7, 0xfd, 0xf7, 0xfd,
         0x07, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
-    static unsigned char pin_bits[]={
+    static const unsigned char pin_bits[]={
         0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfc,0xdf,0xfc,0xdf,0xfc,
         0xdf,0xfc,0xdf,0xfc,0xdf,0xfc,0x0f,0xf8,0x7f,0xff,0x7f,0xff,
         0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
index 827cb51a22a690f9cc9894e0d678e9b1b1a0cc2f..e20225d5938a2f0167dd3722ed88ec896f2c30c2 100644 (file)
@@ -323,8 +323,8 @@ const long wxDateTime::TIME_T_FACTOR = 1000l;
 // global data
 // ----------------------------------------------------------------------------
 
-const char *wxDefaultDateTimeFormat = "%c";
-const char *wxDefaultTimeSpanFormat = "%H:%M:%S";
+const char wxDefaultDateTimeFormat[] = "%c";
+const char wxDefaultTimeSpanFormat[] = "%H:%M:%S";
 
 // in the fine tradition of ANSI C we use our equivalent of (time_t)-1 to
 // indicate an invalid wxDateTime object
@@ -356,7 +356,7 @@ wxDateTime::wxDateTime_t GetNumOfDaysInMonth(int year, wxDateTime::Month month)
 {
     // the number of days in month in Julian/Gregorian calendar: the first line
     // is for normal years, the second one is for the leap ones
-    static wxDateTime::wxDateTime_t daysInMonth[2][MONTHS_IN_YEAR] =
+    static const wxDateTime::wxDateTime_t daysInMonth[2][MONTHS_IN_YEAR] =
     {
         { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
         { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
@@ -820,7 +820,7 @@ wxString wxDateTime::GetEnglishMonthName(Month month, NameFlags flags)
 {
     wxCHECK_MSG( month != Inv_Month, wxEmptyString, "invalid month" );
 
-    static const char *monthNames[2][MONTHS_IN_YEAR] =
+    static const char *const monthNames[2][MONTHS_IN_YEAR] =
     {
         { "January", "February", "March", "April", "May", "June",
           "July", "August", "September", "October", "November", "December" },
@@ -859,7 +859,7 @@ wxString wxDateTime::GetEnglishWeekDayName(WeekDay wday, NameFlags flags)
 {
     wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, wxT("invalid weekday") );
 
-    static const char *weekdayNames[2][DAYS_PER_WEEK] =
+    static const char *const weekdayNames[2][DAYS_PER_WEEK] =
     {
         { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
           "Saturday" },
index c624b6c6f0b5a39c2741bc88d145656e9960942b..39fc7f454657a842692457aadf88ab7b06e8f2ec 100644 (file)
@@ -1760,7 +1760,7 @@ wxDateTime::ParseDate(const wxString& date, wxString::const_iterator *end)
                 else // not a valid weekday name
                 {
                     // try the ordinals
-                    static const char *ordinals[] =
+                    static const char *const ordinals[] =
                     {
                         wxTRANSLATE("first"),
                         wxTRANSLATE("second"),
@@ -1937,7 +1937,7 @@ wxDateTime::ParseTime(const wxString& time, wxString::const_iterator *end)
 
     // try all time formats we may think about in the order from longest to
     // shortest
-    static const char *timeFormats[] =
+    static const char *const timeFormats[] =
     {
         "%I:%M:%S %p",  // 12hour with AM/PM
         "%H:%M:%S",     // could be the same or 24 hour one so try it too
index c7acc6c8503161dddfb176027abf20d77acd50a3..4cc35599fdf46b654228e93035415e163bb2316d 100644 (file)
@@ -55,7 +55,7 @@
 // ----------------------------------------------------------------------------
 
 // encodings supported by GetEncodingDescription
-static wxFontEncoding gs_encodings[] =
+static const wxFontEncoding gs_encodings[] =
 {
     wxFONTENCODING_ISO8859_1,
     wxFONTENCODING_ISO8859_2,
@@ -144,7 +144,7 @@ static wxFontEncoding gs_encodings[] =
 };
 
 // the descriptions for them
-static const char* gs_encodingDescs[] =
+static const char* const gs_encodingDescs[] =
 {
     wxTRANSLATE( "Western European (ISO-8859-1)" ),
     wxTRANSLATE( "Central European (ISO-8859-2)" ),
@@ -240,7 +240,7 @@ static const char* gs_encodingDescs[] =
 };
 
 // and the internal names (these are not translated on purpose!)
-static const wxChar* gs_encodingNames[WXSIZEOF(gs_encodingDescs)][9] =
+static const wxChar* const gs_encodingNames[WXSIZEOF(gs_encodingDescs)][9] =
 {
     // names from the columns correspond to these OS:
     //      Linux        Solaris and IRIX       HP-UX             AIX
@@ -642,7 +642,7 @@ wxFontMapperBase::NonInteractiveCharsetToEncoding(const wxString& charset)
 
         for ( size_t i = 0; i < WXSIZEOF(gs_encodingNames); ++i )
         {
-            for ( const wxChar** encName = gs_encodingNames[i]; *encName; ++encName )
+            for ( const wxChar* const* encName = gs_encodingNames[i]; *encName; ++encName )
             {
                 if ( cs.CmpNoCase(*encName) == 0 )
                     return gs_encodings[i];
@@ -831,17 +831,17 @@ wxString wxFontMapperBase::GetEncodingName(wxFontEncoding encoding)
 /* static */
 const wxChar** wxFontMapperBase::GetAllEncodingNames(wxFontEncoding encoding)
 {
-    static const wxChar* dummy[] = { NULL };
+    static const wxChar* const dummy[] = { NULL };
 
     for ( size_t i = 0; i < WXSIZEOF(gs_encodingNames); i++ )
     {
         if ( gs_encodings[i] == encoding )
         {
-            return gs_encodingNames[i];
+            return const_cast<const wxChar**>(gs_encodingNames[i]);
         }
     }
 
-    return dummy;
+    return const_cast<const wxChar**>(dummy);
 }
 
 /* static */
@@ -851,7 +851,7 @@ wxFontEncoding wxFontMapperBase::GetEncodingFromName(const wxString& name)
 
     for ( size_t i = 0; i < count; i++ )
     {
-        for ( const wxChar** encName = gs_encodingNames[i]; *encName; ++encName )
+        for ( const wxChar* const* encName = gs_encodingNames[i]; *encName; ++encName )
         {
             if ( name.CmpNoCase(*encName) == 0 )
                 return gs_encodings[i];
index 7ad34c9ccf44a89ee1cbddc1af9e8448f007b84d..db51e2c41b3c2cff974b000c58149a32a89ab8ce 100644 (file)
@@ -2144,9 +2144,9 @@ wxMBConv_iconv::wxMBConv_iconv(const char *name)
         wxLogTrace(TRACE_STRCONV, wxT("Looking for wide char codeset:"));
 
 #if wxUSE_FONTMAP
-        const wxChar **names = wxFontMapperBase::GetAllEncodingNames(WC_ENC);
+        const wxChar *const *names = wxFontMapperBase::GetAllEncodingNames(WC_ENC);
 #else // !wxUSE_FONTMAP
-        static const wxChar *names_static[] =
+        static const wxChar *const names_static[] =
         {
 #if SIZEOF_WCHAR_T == 4
             wxT("UCS-4"),
@@ -2155,7 +2155,7 @@ wxMBConv_iconv::wxMBConv_iconv(const char *name)
 #endif
             NULL
         };
-        const wxChar **names = names_static;
+        const wxChar *const *names = names_static;
 #endif // wxUSE_FONTMAP/!wxUSE_FONTMAP
 
         for ( ; *names && ms_wcCharsetName.empty(); ++names )
@@ -3068,7 +3068,7 @@ wxMBConv *wxCSConv::DoCreate() const
                 delete conv;
             }
 
-            const wxChar** names = wxFontMapperBase::GetAllEncodingNames(encoding);
+            const wxChar* const* names = wxFontMapperBase::GetAllEncodingNames(encoding);
             // CS : in case this does not return valid names (eg for MacRoman)
             // encoding got a 'failure' entry in the cache all the same,
             // although it just has to be created using a different method, so
index 3c6d04dcd1e55985d679f271a6756f196b8a793d..ad0c64ef16df9226de2c51702fee578f505e438f 100644 (file)
 // ============================================================================
 
 // Array used in DecToHex conversion routine.
-static wxChar hexArray[] = wxT("0123456789ABCDEF");
+static const wxChar hexArray[] = wxT("0123456789ABCDEF");
 
 // Convert 2-digit hex number to decimal
 int wxHexToDec(const wxString& buf)
index 2f71cbc8798575e083c8f0c90fb3e2449aac80ed..f89a7557661c3612e7eb6addc2503b07f6be9917 100644 (file)
@@ -194,7 +194,7 @@ void wxXLocale::Free()
 #define CTYPE_UPPER 0x0200
 #define CTYPE_XDIGIT 0x0400
 
-static unsigned int gs_lookup[] =
+static const unsigned int gs_lookup[] =
 {
     0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004,
     0x0004, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0004, 0x0004,
index 82a415f69624fe8f7d7efe9663860b40d6afbc9b..744a5db1e868d39e4fc6d9f2f6d0b40771bbf003 100644 (file)
@@ -618,7 +618,7 @@ static bool GetRGBFromName(const char *inname, bool *isNone,
 
 static const char *ParseColor(const char *data)
 {
-    static const char *targets[] =
+    static const char *const targets[] =
                         {"c ", "g ", "g4 ", "m ", "b ", "s ", NULL};
 
     const char *p, *r;
index e3e0da648994959980e0229fbc02f9659ea3df41..03c93c5e8bb3465b0c6f230affd2d4a3441a834b 100644 (file)
@@ -58,7 +58,7 @@ END_EVENT_TABLE()
 
 // don't change the number of elements (48) in this array, the code below is
 // hardcoded to use it
-static const wxChar *wxColourDialogNames[] =
+static const wxChar *const wxColourDialogNames[] =
 {
     wxT("ORANGE"),
     wxT("GOLDENROD"),
@@ -380,7 +380,7 @@ void wxGenericColourDialog::PaintBasicColours(wxDC& dc)
             int y = (i*(m_smallRectangleSize.y+m_gridSpacing) + m_standardColoursRect.y);
 
             dc.SetPen(*wxBLACK_PEN);
-            wxBrush brush(m_standardColours[ptr], wxSOLID);
+            wxBrush brush(m_standardColours[ptr]);
             dc.SetBrush(brush);
 
             dc.DrawRectangle( x, y, m_smallRectangleSize.x, m_smallRectangleSize.y);
@@ -403,7 +403,7 @@ void wxGenericColourDialog::PaintCustomColours(wxDC& dc)
 
       dc.SetPen(*wxBLACK_PEN);
 
-      wxBrush brush(m_customColours[ptr], wxSOLID);
+      wxBrush brush(m_customColours[ptr]);
       dc.SetBrush(brush);
 
       dc.DrawRectangle( x, y, m_smallRectangleSize.x, m_smallRectangleSize.y);
@@ -461,7 +461,7 @@ void wxGenericColourDialog::PaintCustomColour(wxDC& dc)
 {
     dc.SetPen(*wxBLACK_PEN);
 
-    wxBrush *brush = new wxBrush(m_colourData.m_dataColour, wxSOLID);
+    wxBrush *brush = new wxBrush(m_colourData.m_dataColour);
     dc.SetBrush(*brush);
 
     dc.DrawRectangle( m_singleCustomColourRect.x, m_singleCustomColourRect.y,
index 13af995249323b74b27d62534bf26dcc895fe43b..6319a9c73a245b5b8fa9d1cf260718ba23600e75 100644 (file)
@@ -190,7 +190,7 @@ static const char *wxPostScriptHeaderColourImage = "\
   } ifelse          % end of 'false' case\n\
 ";
 
-static char wxPostScriptHeaderReencodeISO1[] =
+static const char wxPostScriptHeaderReencodeISO1[] =
     "\n/reencodeISO {\n"
 "dup dup findfont dup length dict begin\n"
 "{ 1 index /FID ne { def }{ pop pop } ifelse } forall\n"
@@ -214,7 +214,7 @@ static char wxPostScriptHeaderReencodeISO1[] =
 "/.notdef/dotlessi/grave/acute/circumflex/tilde/macron/breve\n"
 "/dotaccent/dieresis/.notdef/ring/cedilla/.notdef/hungarumlaut\n";
 
-static char wxPostScriptHeaderReencodeISO2[] =
+static const char wxPostScriptHeaderReencodeISO2[] =
 "/ogonek/caron/space/exclamdown/cent/sterling/currency/yen/brokenbar\n"
 "/section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot\n"
 "/hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior\n"
@@ -962,7 +962,7 @@ void wxPostScriptDCImpl::DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y )
 }
 
 /* this has to be char, not wxChar */
-static char hexArray[] = "0123456789ABCDEF";
+static const char hexArray[] = "0123456789ABCDEF";
 
 void wxPostScriptDCImpl::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool WXUNUSED(useMask) )
 {
index 63b663923b40e698c802e03092abc45f4b1bd111..f071699517f2e3d366ddcfceb1086c33c6038c20 100644 (file)
@@ -1414,7 +1414,7 @@ void wxDirFilterListCtrl::FillFilterList(const wxString& filter, int defaultFilt
 
 #ifndef __WXGTK20__
 /* Computer (c) Julian Smart */
-static const char * file_icons_tbl_computer_xpm[] = {
+static const char* const file_icons_tbl_computer_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "16 16 42 1",
 "r c #4E7FD0",
index f0dc3af9b47bf50c32342cea6e6adfc4b8e3ab38..5ece81c5d3744c4be45dabbc497ce06c90258d2e 100644 (file)
@@ -32,7 +32,7 @@
 
 const char wxEditableListBoxNameStr[] = "editableListBox";
 
-static const char * eledit_xpm[] = {
+static const char* const eledit_xpm[] = {
 "16 16 3 1",
 "   c None",
 ".  c #000000",
@@ -54,7 +54,7 @@ static const char * eledit_xpm[] = {
 "                ",
 "                "};
 
-static const char * elnew_xpm[] = {
+static const char* const elnew_xpm[] = {
 "16 16 5 1",
 "   c None",
 ".  c #7F7F7F",
@@ -78,7 +78,7 @@ static const char * elnew_xpm[] = {
 "                ",
 "                "};
 
-static const char * eldel_xpm[] = {
+static const char* const eldel_xpm[] = {
 "16 16 3 1",
 "   c None",
 ".  c #7F0000",
@@ -100,7 +100,7 @@ static const char * eldel_xpm[] = {
 "   .         .  ",
 "                "};
 
-static const char * eldown_xpm[] = {
+static const char* const eldown_xpm[] = {
 "16 16 2 1",
 "   c None",
 ".  c #000000",
@@ -121,7 +121,7 @@ static const char * eldown_xpm[] = {
 "                ",
 "                "};
 
-static const char * elup_xpm[] = {
+static const char* const elup_xpm[] = {
 "16 16 2 1",
 "   c None",
 ".  c #000000",
index 04fbd31efef7c11e553c21bac314f01836f87aef..707ebedabc001cc228d051310fe4da2b1431afeb 100644 (file)
@@ -3582,7 +3582,7 @@ void wxGrid::ChangeCursorMode(CursorMode mode,
                               bool captureMouse)
 {
 #if wxUSE_LOG_TRACE
-    static const wxChar *cursorModes[] =
+    static const wxChar *const cursorModes[] =
     {
         wxT("SELECT_CELL"),
         wxT("RESIZE_ROW"),
index 74edb0cabbe9e2516c65cff376832ab1e5a7ffde..20357ead229622ace81f1e9cfa71e77c69cf6604 100644 (file)
@@ -817,7 +817,7 @@ void wxLogDialog::CreateDetailsControls(wxWindow *parent)
     wxImageList *imageList = new wxImageList(ICON_SIZE, ICON_SIZE);
 
     // order should be the same as in the switch below!
-    static const wxChar* icons[] =
+    static const wxChar* const icons[] =
     {
         wxART_ERROR,
         wxART_WARNING,
index a05eca8d07f3236da1a2bf80569b3deca4bf8c67..eb6a6fb8f1e2ed8cabe71872a4267e5d3560bf76 100644 (file)
@@ -458,7 +458,7 @@ wxDialog(parent, wxID_ANY, _("Print Setup"), wxPoint(0,0), wxSize(600, 600), wxD
 }
 
 /* XPM */
-static const char * check_xpm[] = {
+static const char* const check_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "16 16 3 1",
 /* colors */
index 90e8c472d695e69404c99822399d65ea0d39e461..b8c027b98ca31e56b601020cf9b43a46a2048ca6 100644 (file)
@@ -2811,7 +2811,7 @@ bool wxRichEditModule::Load(Version version)
         return true;
     }
 
-    static const wxChar *dllnames[] =
+    static const wxChar *const dllnames[] =
     {
         wxT("riched32"),
         wxT("riched20"),
index 22c5089f77f4f21dda3a4ed87d36e38735648de7..8be3545e6d5c11d30a6626c296582a8be60577b2 100644 (file)
@@ -559,7 +559,7 @@ void wxPGDatePickerCtrlEditor::SetValueToUnspecified( wxPGProperty* property,
 // NB: Do not use wxS here since unlike wxT it doesn't translate to wxChar*
 //
 
-static const wxChar* gs_fp_es_family_labels[] = {
+static const wxChar* const gs_fp_es_family_labels[] = {
     wxT("Default"), wxT("Decorative"),
     wxT("Roman"), wxT("Script"),
     wxT("Swiss"), wxT("Modern"),
@@ -567,34 +567,34 @@ static const wxChar* gs_fp_es_family_labels[] = {
     (const wxChar*) NULL
 };
 
-static long gs_fp_es_family_values[] = {
+static const long gs_fp_es_family_values[] = {
     wxFONTFAMILY_DEFAULT, wxFONTFAMILY_DECORATIVE,
     wxFONTFAMILY_ROMAN, wxFONTFAMILY_SCRIPT,
     wxFONTFAMILY_SWISS, wxFONTFAMILY_MODERN,
     wxFONTFAMILY_TELETYPE, wxFONTFAMILY_UNKNOWN
 };
 
-static const wxChar* gs_fp_es_style_labels[] = {
+static const wxChar* const gs_fp_es_style_labels[] = {
     wxT("Normal"),
     wxT("Slant"),
     wxT("Italic"),
     (const wxChar*) NULL
 };
 
-static long gs_fp_es_style_values[] = {
+static const long gs_fp_es_style_values[] = {
     wxNORMAL,
     wxSLANT,
     wxITALIC
 };
 
-static const wxChar* gs_fp_es_weight_labels[] = {
+static const wxChar* const gs_fp_es_weight_labels[] = {
     wxT("Normal"),
     wxT("Light"),
     wxT("Bold"),
     (const wxChar*) NULL
 };
 
-static long gs_fp_es_weight_values[] = {
+static const long gs_fp_es_weight_values[] = {
     wxNORMAL,
     wxLIGHT,
     wxBOLD
@@ -831,7 +831,7 @@ void wxFontProperty::OnCustomPaint(wxDC& dc,
 #include "wx/colordlg.h"
 
 //#define wx_cp_es_syscolours_len 25
-static const wxChar* gs_cp_es_syscolour_labels[] = {
+static const wxChar* const gs_cp_es_syscolour_labels[] = {
     wxT("AppWorkspace"),
     wxT("ActiveBorder"),
     wxT("ActiveCaption"),
@@ -860,7 +860,7 @@ static const wxChar* gs_cp_es_syscolour_labels[] = {
     (const wxChar*) NULL
 };
 
-static long gs_cp_es_syscolour_values[] = {
+static const long gs_cp_es_syscolour_values[] = {
     wxSYS_COLOUR_APPWORKSPACE,
     wxSYS_COLOUR_ACTIVEBORDER,
     wxSYS_COLOUR_ACTIVECAPTION,
@@ -934,7 +934,7 @@ wxSystemColourProperty::wxSystemColourProperty( const wxString& label, const wxS
 
 
 wxSystemColourProperty::wxSystemColourProperty( const wxString& label, const wxString& name,
-    const wxChar** labels, const long* values, wxPGChoices* choicesCache,
+    const wxChar* const* labels, const long* values, wxPGChoices* choicesCache,
     const wxColourPropertyValue& value )
     : wxEnumProperty( label, name, labels, values, choicesCache )
 {
@@ -946,7 +946,7 @@ wxSystemColourProperty::wxSystemColourProperty( const wxString& label, const wxS
 
 
 wxSystemColourProperty::wxSystemColourProperty( const wxString& label, const wxString& name,
-    const wxChar** labels, const long* values, wxPGChoices* choicesCache,
+    const wxChar* const* labels, const long* values, wxPGChoices* choicesCache,
     const wxColour& value )
     : wxEnumProperty( label, name, labels, values, choicesCache )
 {
@@ -1492,7 +1492,7 @@ bool wxSystemColourProperty::DoSetAttribute( const wxString& name, wxVariant& va
 // wxColourProperty
 // -----------------------------------------------------------------------
 
-static const wxChar* gs_cp_es_normcolour_labels[] = {
+static const wxChar* const gs_cp_es_normcolour_labels[] = {
     wxT("Black"),
     wxT("Maroon"),
     wxT("Navy"),
@@ -1515,7 +1515,7 @@ static const wxChar* gs_cp_es_normcolour_labels[] = {
     (const wxChar*) NULL
 };
 
-static unsigned long gs_cp_es_normcolour_colours[] = {
+static const unsigned long gs_cp_es_normcolour_colours[] = {
     wxPG_COLOUR(0,0,0),
     wxPG_COLOUR(128,0,0),
     wxPG_COLOUR(0,0,128),
@@ -1604,7 +1604,7 @@ wxVariant wxColourProperty::DoTranslateVal( wxColourPropertyValue& v ) const
 #define NUM_CURSORS 28
 
 //#define wx_cp_es_syscursors_len 28
-static const wxChar* gs_cp_es_syscursors_labels[NUM_CURSORS+1] = {
+static const wxChar* const gs_cp_es_syscursors_labels[NUM_CURSORS+1] = {
     wxT("Default"),
     wxT("Arrow"),
     wxT("Right Arrow"),
@@ -1636,7 +1636,7 @@ static const wxChar* gs_cp_es_syscursors_labels[NUM_CURSORS+1] = {
     (const wxChar*) NULL
 };
 
-static long gs_cp_es_syscursors_values[NUM_CURSORS] = {
+static const long gs_cp_es_syscursors_values[NUM_CURSORS] = {
     wxCURSOR_NONE,
     wxCURSOR_ARROW,
     wxCURSOR_RIGHT_ARROW,
index accb791fb8de898c4498e55bcd8148f48a9a94e0..0c1d5a726a93de6532090a034b44e8dd3c321377 100644 (file)
@@ -76,7 +76,7 @@ const char wxPropertyGridManagerNameStr[] = "wxPropertyGridManager";
 
 
 // Categoric Mode Icon
-static const char* gs_xpm_catmode[] = {
+static const char* const gs_xpm_catmode[] = {
 "16 16 5 1",
 ". c none",
 "B c black",
@@ -102,7 +102,7 @@ static const char* gs_xpm_catmode[] = {
 };
 
 // Alphabetic Mode Icon
-static const char* gs_xpm_noncatmode[] = {
+static const char* const gs_xpm_noncatmode[] = {
 "16 16 5 1",
 ". c none",
 "B c black",
@@ -128,7 +128,7 @@ static const char* gs_xpm_noncatmode[] = {
 };
 
 // Default Page Icon.
-static const char* gs_xpm_defpage[] = {
+static const char* const gs_xpm_defpage[] = {
 "16 16 5 1",
 ". c none",
 "B c black",
@@ -840,7 +840,7 @@ wxPropertyGridPage* wxPropertyGridManager::InsertPage( int index,
                 m_pToolbar->AddTool(m_nextTbInd,label,bmp,label,wxITEM_RADIO);
                 //m_pToolbar->InsertTool(index+3,m_nextTbInd,bmp);
             else
-                m_pToolbar->AddTool(m_nextTbInd,label,wxBitmap( (const char**)gs_xpm_defpage ),
+                m_pToolbar->AddTool(m_nextTbInd,label,wxBitmap(gs_xpm_defpage),
                     label,wxITEM_RADIO);
 
             m_nextTbInd++;
@@ -1274,10 +1274,10 @@ void wxPropertyGridManager::RecreateControls()
                 wxString desc1(_("Categorized Mode"));
                 wxString desc2(_("Alphabetic Mode"));
                 m_pToolbar->AddTool(baseId+ID_ADVTBITEMSBASE_OFFSET+0,
-                    desc1,wxBitmap ( (const char**)gs_xpm_catmode ),
+                    desc1,wxBitmap (gs_xpm_catmode),
                     desc1,wxITEM_RADIO);
                 m_pToolbar->AddTool(baseId+ID_ADVTBITEMSBASE_OFFSET+1,
-                    desc2,wxBitmap ( (const char**)gs_xpm_noncatmode ),
+                    desc2,wxBitmap (gs_xpm_noncatmode),
                     desc2,wxITEM_RADIO);
                 m_pToolbar->Realize();
             }
index 86ede728d1b739ac95f80e074dbd338421122b64..09f4bc8ba86266680fcf094e64ff5bdba669cf2f 100644 (file)
@@ -1707,7 +1707,7 @@ wxVariant wxPGProperty::GetAttributesAsList() const
 // Slots of utility flags are NULL
 const unsigned int gs_propFlagToStringSize = 14;
 
-static const wxChar* gs_propFlagToString[gs_propFlagToStringSize] = {
+static const wxChar* const gs_propFlagToString[gs_propFlagToStringSize] = {
     NULL,
     wxT("DISABLED"),
     wxT("HIDDEN"),
@@ -2684,12 +2684,12 @@ wxPGChoiceEntry& wxPGChoices::AddAsSorted( const wxString& label, int value )
 
 // -----------------------------------------------------------------------
 
-void wxPGChoices::Add( const wxChar** labels, const ValArrItem* values )
+void wxPGChoices::Add( const wxChar* const* labels, const ValArrItem* values )
 {
     AllocExclusive();
 
     unsigned int itemcount = 0;
-    const wxChar** p = &labels[0];
+    const wxChar* const* p = &labels[0];
     while ( *p ) { p++; itemcount++; }
 
     unsigned int i;
index 42b192d0a8f1d71f6e4f1791779102a09f613f19..eee0cca8cf32413c34d901647ba235e46025088b 100644 (file)
@@ -352,13 +352,13 @@ wxValidator* wxIntProperty::DoGetValidator() const
 
 #define wxPG_UINT_TEMPLATE_MAX 8
 
-static const wxChar* gs_uintTemplates32[wxPG_UINT_TEMPLATE_MAX] = {
+static const wxChar* const gs_uintTemplates32[wxPG_UINT_TEMPLATE_MAX] = {
     wxT("%x"),wxT("0x%x"),wxT("$%x"),
     wxT("%X"),wxT("0x%X"),wxT("$%X"),
     wxT("%u"),wxT("%o")
 };
 
-static const char* gs_uintTemplates64[wxPG_UINT_TEMPLATE_MAX] = {
+static const char* const gs_uintTemplates64[wxPG_UINT_TEMPLATE_MAX] = {
     "%" wxLongLongFmtSpec "x",
     "0x%" wxLongLongFmtSpec "x",
     "$%" wxLongLongFmtSpec "x",
@@ -874,7 +874,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxEnumProperty, wxPGProperty)
 
 WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxEnumProperty,long,Choice)
 
-wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar** labels,
+wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels,
     const long* values, int value ) : wxPGProperty(label,name)
 {
     SetIndex(0);
@@ -888,7 +888,7 @@ wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, con
     }
 }
 
-wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar** labels,
+wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels,
     const long* values, wxPGChoices* choicesCache, int value )
     : wxPGProperty(label,name)
 {
@@ -1138,14 +1138,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxEditEnumProperty, wxPGProperty)
 
 WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxEditEnumProperty,wxString,ComboBox)
 
-wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar** labels,
+wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels,
     const long* values, const wxString& value )
     : wxEnumProperty(label,name,labels,values,0)
 {
     SetValue( value );
 }
 
-wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar** labels,
+wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& name, const wxChar* const* labels,
     const long* values, wxPGChoices* choicesCache, const wxString& value )
     : wxEnumProperty(label,name,labels,values,choicesCache,0)
 {
@@ -1264,7 +1264,7 @@ void wxFlagsProperty::Init()
 }
 
 wxFlagsProperty::wxFlagsProperty( const wxString& label, const wxString& name,
-    const wxChar** labels, const long* values, long value ) : wxPGProperty(label,name)
+    const wxChar* const* labels, const long* values, long value ) : wxPGProperty(label,name)
 {
     m_oldChoicesData = NULL;
 
index 08e4817d6e7ea4cbaa7eaaef6a6fb46ded432c59..e5246b15ee17ee75861c4bbeb085b66647f417b4 100644 (file)
@@ -645,7 +645,7 @@ wxDialUpManagerImpl::CheckIfconfig()
     // first time check for ifconfig location
     if ( m_CanUseIfconfig == -1 ) // unknown
     {
-        static const wxChar *ifconfigLocations[] =
+        static const wxChar *const ifconfigLocations[] =
         {
             wxT("/sbin"),         // Linux, FreeBSD, Darwin
             wxT("/usr/sbin"),     // SunOS, Solaris, AIX, HP-UX
index d49cb3977c8ea284d886d93f18aab95cae1b877b..413c51201de50079e484ce01210eeadd0373365d 100644 (file)
@@ -116,7 +116,7 @@ static void *wx_darwin_dlopen(const char *path, int WXUNUSED(mode) /* mode is ig
     {
         handle = NULL;
 
-        static const char *errorStrings[] =
+        static const char *const errorStrings[] =
         {
             "%d: Object Image Load Failure",
             "%d: Object Image Load Success",
index 9c1afb98ded8810671038d18132362a69abd7138..700fd19324c2ab5dc83accc6c38be86657c84666 100644 (file)
@@ -725,7 +725,7 @@ public:
     void SetState(wxThreadState state)
     {
 #if wxUSE_LOG_TRACE
-        static const wxChar *stateNames[] =
+        static const wxChar *const stateNames[] =
         {
             wxT("NEW"),
             wxT("RUNNING"),