]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wchar_t with int comparisons for Apple gcc.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Oct 2010 22:24:03 +0000 (22:24 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Oct 2010 22:24:03 +0000 (22:24 +0000)
Apple gcc refuses to compile comparisons between wchar_t and int for some
reason, so add explicit casts to int to make it work there.

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

src/generic/grideditors.cpp

index d764a71e09c5d66390d79c5d970702940a8560ef..620130e596bd302f08b3186f927a569145831c9d 100644 (file)
@@ -355,7 +355,7 @@ bool wxGridCellEditor::IsAcceptedKey(wxKeyEvent& event)
         return false;
 
 #if wxUSE_UNICODE
-    if ( event.GetUnicodeKey() == WXK_NONE )
+    if ( static_cast<int>(event.GetUnicodeKey()) == WXK_NONE )
         return false;
 #else
     if ( event.GetKeyCode() > WXK_START )
@@ -547,7 +547,7 @@ void wxGridCellTextEditor::StartingKey(wxKeyEvent& event)
     // a valid character, so not a whole lot of testing needs to be done.
 
     wxTextCtrl* tc = Text();
-    wxChar ch;
+    int ch;
 
     bool isPrintable;
 
@@ -558,7 +558,7 @@ void wxGridCellTextEditor::StartingKey(wxKeyEvent& event)
     else
 #endif // wxUSE_UNICODE
     {
-        ch = (wxChar)event.GetKeyCode();
+        ch = event.GetKeyCode();
         isPrintable = ch >= WXK_SPACE && ch < WXK_START;
     }
 
@@ -579,7 +579,7 @@ void wxGridCellTextEditor::StartingKey(wxKeyEvent& event)
 
         default:
             if ( isPrintable )
-                tc->WriteText(ch);
+                tc->WriteText(static_cast<wxChar>(ch));
             break;
     }
 }