From: Stefan Csomor Date: Thu, 27 Jan 2011 11:00:26 +0000 (+0000) Subject: supporting clang 2.0 under xcode, see #12332 X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/df04f800b84a71e6f1f5020fa03c2831fa87e6f2 supporting clang 2.0 under xcode, see #12332 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/archive.h b/include/wx/archive.h index 67419a91fc..cd8438972d 100644 --- a/include/wx/archive.h +++ b/include/wx/archive.h @@ -225,7 +225,7 @@ public: if (it.m_rep) it.m_rep.AddRef(); if (m_rep) - m_rep.UnRef(); + this->m_rep.UnRef(); m_rep = it.m_rep; return *this; } diff --git a/include/wx/buffer.h b/include/wx/buffer.h index 4c5c27eede..254605edf7 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -260,7 +260,7 @@ public: { if ( len == wxNO_LEN ) len = wxStrlen(str); - this->m_data = new Data(StrCopy(str, len), len); + this->m_data = new Data(this->StrCopy(str, len), len); } else { @@ -295,7 +295,7 @@ public: wxCharTypeBuffer(const wxScopedCharTypeBuffer& src) { - MakeOwnedCopyOf(src); + this->MakeOwnedCopyOf(src); } wxCharTypeBuffer& operator=(const wxScopedCharTypeBuffer& src) diff --git a/include/wx/html/webkit.h b/include/wx/html/webkit.h index 3bf3a38754..4f7a3dc8ec 100644 --- a/include/wx/html/webkit.h +++ b/include/wx/html/webkit.h @@ -19,6 +19,7 @@ #endif #include "wx/control.h" +DECLARE_WXCOCOA_OBJC_CLASS(WebView); // ---------------------------------------------------------------------------- // Web Kit Control @@ -107,13 +108,11 @@ private: wxString m_currentURL; wxString m_pageTitle; - struct objc_object *m_webView; + WX_WebView m_webView; // we may use this later to setup our own mouse events, // so leave it in for now. void* m_webKitCtrlEventHandler; - //It should be WebView*, but WebView is an Objective-C class - //TODO: look into using DECLARE_WXCOCOA_OBJC_CLASS rather than this. }; // ---------------------------------------------------------------------------- diff --git a/include/wx/valgen.h b/include/wx/valgen.h index 63324a1962..8da3bb2efc 100644 --- a/include/wx/valgen.h +++ b/include/wx/valgen.h @@ -34,6 +34,8 @@ public: wxGenericValidator(bool* val); // wxChoice, wxGauge, wxRadioBox, wxScrollBar, wxSlider, wxSpinButton wxGenericValidator(int* val); + wxGenericValidator(float* val); + wxGenericValidator(double* val); // wxComboBox, wxTextCtrl, wxButton, wxStaticText (read-only) wxGenericValidator(wxString* val); // wxListBox, wxCheckListBox @@ -68,6 +70,8 @@ protected: bool* m_pBool; int* m_pInt; + float* m_pFloat; + double* m_pDouble; wxString* m_pString; wxArrayInt* m_pArrayInt; #if wxUSE_DATETIME diff --git a/include/wx/valnum.h b/include/wx/valnum.h index 5971e612a6..0385c9f9ad 100644 --- a/include/wx/valnum.h +++ b/include/wx/valnum.h @@ -192,7 +192,7 @@ public: else if ( !BaseValidator::FromString(s, &value) ) return false; - if ( !IsInRange(value) ) + if ( !this->IsInRange(value) ) return false; *m_value = static_cast(value); @@ -225,7 +225,7 @@ private: { wxString s; if ( value != 0 || !BaseValidator::HasFlag(wxNUM_VAL_ZERO_AS_BLANK) ) - s = ToString(value); + s = this->ToString(value); return s; } @@ -314,8 +314,8 @@ public: wxIntegerValidator(ValueType *value = NULL, int style = wxNUM_VAL_DEFAULT) : Base(value, style) { - DoSetMin(std::numeric_limits::min()); - DoSetMax(std::numeric_limits::max()); + this->DoSetMin(std::numeric_limits::min()); + this->DoSetMax(std::numeric_limits::max()); } virtual wxObject *Clone() const { return new wxIntegerValidator(*this); } @@ -434,8 +434,8 @@ private: // NB: Do not use min(), it's not the smallest representable value for // the floating point types but rather the smallest representable // positive value. - DoSetMin(-std::numeric_limits::max()); - DoSetMax( std::numeric_limits::max()); + this->DoSetMin(-std::numeric_limits::max()); + this->DoSetMax( std::numeric_limits::max()); } }; diff --git a/include/wx/weakref.h b/include/wx/weakref.h index 08878903f4..a59a7e4a0a 100644 --- a/include/wx/weakref.h +++ b/include/wx/weakref.h @@ -218,7 +218,7 @@ public: // below is not used by at least g++4 when a literal NULL is used wxWeakRef(T *pobj) { - Assign(pobj); + this->Assign(pobj); } #endif // !__VISUALC6__ @@ -239,7 +239,7 @@ public: wxWeakRef& operator=(const wxWeakRef& wr) { - AssignCopy(wr); + this->AssignCopy(wr); return *this; } diff --git a/include/wx/wxcrt.h b/include/wx/wxcrt.h index f9e68ef71e..bdac007cb7 100644 --- a/include/wx/wxcrt.h +++ b/include/wx/wxcrt.h @@ -467,7 +467,7 @@ WX_STRCMP_FUNC(wxStricmp, wxCRT_StricmpA, wxCRT_StricmpW, wxStricmp_String) // forward-declare the template and implement it below WX_STRCMP_FUNC. OTOH, // this fails to compile with VC6, so don't do it for VC. It also causes // problems with GCC visibility in newer GCC versions. -#if !(defined(__VISUALC__) || wxCHECK_GCC_VERSION(3,5)) +#if !(defined(__VISUALC__) || wxCHECK_GCC_VERSION(3,5)) || defined(__clang__) #define wxNEEDS_DECL_BEFORE_TEMPLATE #endif diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 1a07e2278d..c5d4b5b900 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -1240,7 +1240,7 @@ public : virtual void Transform( const wxGraphicsMatrixData* matrix ); // gets the bounding box enclosing all points (possibly including control points) - virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *y) const; + virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) const; virtual bool Contains( wxDouble x, wxDouble y, wxPolygonFillMode fillStyle = wxODDEVEN_RULE) const; private : diff --git a/src/osx/cocoa/button.mm b/src/osx/cocoa/button.mm index b44ef3cd92..babc50e429 100644 --- a/src/osx/cocoa/button.mm +++ b/src/osx/cocoa/button.mm @@ -178,6 +178,8 @@ private: } }; +} // anonymous namespace + extern "C" void SetBezelStyleFromBorderFlags(NSButton *v, long style); // set bezel style depending on the wxBORDER_XXX flags specified by the style @@ -200,7 +202,6 @@ void SetBezelStyleFromBorderFlags(NSButton *v, long style) } } -} // anonymous namespace wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer, wxWindowMac* WXUNUSED(parent), diff --git a/src/osx/cocoa/toolbar.mm b/src/osx/cocoa/toolbar.mm index 57c8989ccd..41d923efad 100644 --- a/src/osx/cocoa/toolbar.mm +++ b/src/osx/cocoa/toolbar.mm @@ -987,7 +987,7 @@ bool wxToolBar::Realize() } wxCFStringRef cfidentifier; - const NSString *nsItemId; + NSString *nsItemId; if (tool->GetStyle() == wxTOOL_STYLE_SEPARATOR) { nsItemId = tool->IsStretchable() ? NSToolbarFlexibleSpaceItemIdentifier @@ -1249,8 +1249,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase) #if wxOSX_USE_NATIVE_TOOLBAR if (m_macToolbar != NULL) { - const NSString * const - nsItemId = tool->IsStretchable() ? NSToolbarFlexibleSpaceItemIdentifier + NSString * nsItemId = tool->IsStretchable() ? NSToolbarFlexibleSpaceItemIdentifier : NSToolbarSeparatorItemIdentifier; NSToolbarItem* item = [[NSToolbarItem alloc] initWithItemIdentifier:nsItemId]; tool->SetToolbarItemRef( item ); diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 4a90d9ab3b..6d02169114 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -2326,9 +2326,9 @@ void wxPGProperty::AdaptListToValue( wxVariant& list, wxVariant* value ) const else allChildrenSpecified = true; - wxVariant childValue = list[0]; unsigned int i; unsigned int n = 0; + wxVariant childValue = list[n]; //wxLogDebug(wxT(">> %s.AdaptListToValue()"),GetBaseName().c_str());