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
This commit is contained in:
Stefan Csomor
2011-01-27 11:00:26 +00:00
parent 6c894d4e65
commit df04f800b8
11 changed files with 24 additions and 21 deletions

View File

@@ -225,7 +225,7 @@ public:
if (it.m_rep) if (it.m_rep)
it.m_rep.AddRef(); it.m_rep.AddRef();
if (m_rep) if (m_rep)
m_rep.UnRef(); this->m_rep.UnRef();
m_rep = it.m_rep; m_rep = it.m_rep;
return *this; return *this;
} }

View File

@@ -260,7 +260,7 @@ public:
{ {
if ( len == wxNO_LEN ) if ( len == wxNO_LEN )
len = wxStrlen(str); len = wxStrlen(str);
this->m_data = new Data(StrCopy(str, len), len); this->m_data = new Data(this->StrCopy(str, len), len);
} }
else else
{ {
@@ -295,7 +295,7 @@ public:
wxCharTypeBuffer(const wxScopedCharTypeBuffer<T>& src) wxCharTypeBuffer(const wxScopedCharTypeBuffer<T>& src)
{ {
MakeOwnedCopyOf(src); this->MakeOwnedCopyOf(src);
} }
wxCharTypeBuffer& operator=(const wxScopedCharTypeBuffer<T>& src) wxCharTypeBuffer& operator=(const wxScopedCharTypeBuffer<T>& src)

View File

@@ -19,6 +19,7 @@
#endif #endif
#include "wx/control.h" #include "wx/control.h"
DECLARE_WXCOCOA_OBJC_CLASS(WebView);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Web Kit Control // Web Kit Control
@@ -107,13 +108,11 @@ private:
wxString m_currentURL; wxString m_currentURL;
wxString m_pageTitle; wxString m_pageTitle;
struct objc_object *m_webView; WX_WebView m_webView;
// we may use this later to setup our own mouse events, // we may use this later to setup our own mouse events,
// so leave it in for now. // so leave it in for now.
void* m_webKitCtrlEventHandler; 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.
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -34,6 +34,8 @@ public:
wxGenericValidator(bool* val); wxGenericValidator(bool* val);
// wxChoice, wxGauge, wxRadioBox, wxScrollBar, wxSlider, wxSpinButton // wxChoice, wxGauge, wxRadioBox, wxScrollBar, wxSlider, wxSpinButton
wxGenericValidator(int* val); wxGenericValidator(int* val);
wxGenericValidator(float* val);
wxGenericValidator(double* val);
// wxComboBox, wxTextCtrl, wxButton, wxStaticText (read-only) // wxComboBox, wxTextCtrl, wxButton, wxStaticText (read-only)
wxGenericValidator(wxString* val); wxGenericValidator(wxString* val);
// wxListBox, wxCheckListBox // wxListBox, wxCheckListBox
@@ -68,6 +70,8 @@ protected:
bool* m_pBool; bool* m_pBool;
int* m_pInt; int* m_pInt;
float* m_pFloat;
double* m_pDouble;
wxString* m_pString; wxString* m_pString;
wxArrayInt* m_pArrayInt; wxArrayInt* m_pArrayInt;
#if wxUSE_DATETIME #if wxUSE_DATETIME

View File

@@ -192,7 +192,7 @@ public:
else if ( !BaseValidator::FromString(s, &value) ) else if ( !BaseValidator::FromString(s, &value) )
return false; return false;
if ( !IsInRange(value) ) if ( !this->IsInRange(value) )
return false; return false;
*m_value = static_cast<ValueType>(value); *m_value = static_cast<ValueType>(value);
@@ -225,7 +225,7 @@ private:
{ {
wxString s; wxString s;
if ( value != 0 || !BaseValidator::HasFlag(wxNUM_VAL_ZERO_AS_BLANK) ) if ( value != 0 || !BaseValidator::HasFlag(wxNUM_VAL_ZERO_AS_BLANK) )
s = ToString(value); s = this->ToString(value);
return s; return s;
} }
@@ -314,8 +314,8 @@ public:
wxIntegerValidator(ValueType *value = NULL, int style = wxNUM_VAL_DEFAULT) wxIntegerValidator(ValueType *value = NULL, int style = wxNUM_VAL_DEFAULT)
: Base(value, style) : Base(value, style)
{ {
DoSetMin(std::numeric_limits<ValueType>::min()); this->DoSetMin(std::numeric_limits<ValueType>::min());
DoSetMax(std::numeric_limits<ValueType>::max()); this->DoSetMax(std::numeric_limits<ValueType>::max());
} }
virtual wxObject *Clone() const { return new wxIntegerValidator(*this); } 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 // NB: Do not use min(), it's not the smallest representable value for
// the floating point types but rather the smallest representable // the floating point types but rather the smallest representable
// positive value. // positive value.
DoSetMin(-std::numeric_limits<ValueType>::max()); this->DoSetMin(-std::numeric_limits<ValueType>::max());
DoSetMax( std::numeric_limits<ValueType>::max()); this->DoSetMax( std::numeric_limits<ValueType>::max());
} }
}; };

View File

@@ -218,7 +218,7 @@ public:
// below is not used by at least g++4 when a literal NULL is used // below is not used by at least g++4 when a literal NULL is used
wxWeakRef(T *pobj) wxWeakRef(T *pobj)
{ {
Assign(pobj); this->Assign(pobj);
} }
#endif // !__VISUALC6__ #endif // !__VISUALC6__
@@ -239,7 +239,7 @@ public:
wxWeakRef<T>& operator=(const wxWeakRef<T>& wr) wxWeakRef<T>& operator=(const wxWeakRef<T>& wr)
{ {
AssignCopy(wr); this->AssignCopy(wr);
return *this; return *this;
} }

View File

@@ -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, // 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 // this fails to compile with VC6, so don't do it for VC. It also causes
// problems with GCC visibility in newer GCC versions. // 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 #define wxNEEDS_DECL_BEFORE_TEMPLATE
#endif #endif

View File

@@ -1240,7 +1240,7 @@ public :
virtual void Transform( const wxGraphicsMatrixData* matrix ); virtual void Transform( const wxGraphicsMatrixData* matrix );
// gets the bounding box enclosing all points (possibly including control points) // 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; virtual bool Contains( wxDouble x, wxDouble y, wxPolygonFillMode fillStyle = wxODDEVEN_RULE) const;
private : private :

View File

@@ -178,6 +178,8 @@ private:
} }
}; };
} // anonymous namespace
extern "C" void SetBezelStyleFromBorderFlags(NSButton *v, long style); extern "C" void SetBezelStyleFromBorderFlags(NSButton *v, long style);
// set bezel style depending on the wxBORDER_XXX flags specified by the 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, wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer,
wxWindowMac* WXUNUSED(parent), wxWindowMac* WXUNUSED(parent),

View File

@@ -987,7 +987,7 @@ bool wxToolBar::Realize()
} }
wxCFStringRef cfidentifier; wxCFStringRef cfidentifier;
const NSString *nsItemId; NSString *nsItemId;
if (tool->GetStyle() == wxTOOL_STYLE_SEPARATOR) if (tool->GetStyle() == wxTOOL_STYLE_SEPARATOR)
{ {
nsItemId = tool->IsStretchable() ? NSToolbarFlexibleSpaceItemIdentifier nsItemId = tool->IsStretchable() ? NSToolbarFlexibleSpaceItemIdentifier
@@ -1249,8 +1249,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase)
#if wxOSX_USE_NATIVE_TOOLBAR #if wxOSX_USE_NATIVE_TOOLBAR
if (m_macToolbar != NULL) if (m_macToolbar != NULL)
{ {
const NSString * const NSString * nsItemId = tool->IsStretchable() ? NSToolbarFlexibleSpaceItemIdentifier
nsItemId = tool->IsStretchable() ? NSToolbarFlexibleSpaceItemIdentifier
: NSToolbarSeparatorItemIdentifier; : NSToolbarSeparatorItemIdentifier;
NSToolbarItem* item = [[NSToolbarItem alloc] initWithItemIdentifier:nsItemId]; NSToolbarItem* item = [[NSToolbarItem alloc] initWithItemIdentifier:nsItemId];
tool->SetToolbarItemRef( item ); tool->SetToolbarItemRef( item );

View File

@@ -2326,9 +2326,9 @@ void wxPGProperty::AdaptListToValue( wxVariant& list, wxVariant* value ) const
else else
allChildrenSpecified = true; allChildrenSpecified = true;
wxVariant childValue = list[0];
unsigned int i; unsigned int i;
unsigned int n = 0; unsigned int n = 0;
wxVariant childValue = list[n];
//wxLogDebug(wxT(">> %s.AdaptListToValue()"),GetBaseName().c_str()); //wxLogDebug(wxT(">> %s.AdaptListToValue()"),GetBaseName().c_str());