diff --git a/include/wx/list.h b/include/wx/list.h index d2c4bf87fc..79a809ed59 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -92,14 +92,14 @@ class WXDLLEXPORT wxListKey { public: // implicit ctors - wxListKey() - { m_keyType = wxKEY_NONE; } - wxListKey(long i) - { m_keyType = wxKEY_INTEGER; m_key.integer = i; } - wxListKey(const wxChar *s) - { m_keyType = wxKEY_STRING; m_key.string = wxStrdup(s); } - wxListKey(const wxString& s) - { m_keyType = wxKEY_STRING; m_key.string = wxStrdup(s.c_str()); } + wxListKey() : m_keyType(wxKEY_NONE) + { } + wxListKey(long i) : m_keyType(wxKEY_INTEGER) + { m_key.integer = i; } + wxListKey(const wxChar *s) : m_keyType(wxKEY_STRING) + { m_key.string = wxStrdup(s); } + wxListKey(const wxString& s) : m_keyType(wxKEY_STRING) + { m_key.string = wxStrdup(s.c_str()); } // accessors wxKeyType GetKeyType() const { return m_keyType; } @@ -183,6 +183,8 @@ private: *m_previous; wxListBase *m_list; // list we belong to + + DECLARE_NO_COPY_CLASS(wxNodeBase) }; // ----------------------------------------------------------------------------- @@ -198,7 +200,8 @@ private: void Init(wxKeyType keyType = wxKEY_NONE); // Must be declared before it's used (for VC++ 1.5) public: // default ctor & dtor - wxListBase(wxKeyType keyType = wxKEY_NONE) { Init(keyType); } + wxListBase(wxKeyType keyType = wxKEY_NONE) + { Init(keyType); } virtual ~wxListBase(); // accessors @@ -399,7 +402,7 @@ private: : wxListBase(count, (void **)elements) { } \ \ name& operator=(const name& list) \ - { return (name&)wxListBase::operator=(list); } \ + { (void) wxListBase::operator=(list); return *this; } \ \ nodetype *GetFirst() const \ { return (nodetype *)wxListBase::GetFirst(); } \ @@ -506,7 +509,7 @@ public: ~wxList() { } wxList& operator=(const wxList& list) - { return (wxList&)wxListBase::operator=(list); } + { (void) wxListBase::operator=(list); return *this; } // compatibility methods void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); } diff --git a/include/wx/mac/font.h b/include/wx/mac/font.h index d9edd98f8e..09d7797a06 100644 --- a/include/wx/mac/font.h +++ b/include/wx/mac/font.h @@ -21,20 +21,40 @@ class WXDLLEXPORT wxFontRefData: public wxGDIRefData friend class WXDLLEXPORT wxFont; public: wxFontRefData() + : m_fontId(0) + , m_pointSize(10) + , m_family(wxDEFAULT) + , m_style(wxNORMAL) + , m_weight(wxNORMAL) + , m_underlined(FALSE) + , m_faceName("Geneva") + , m_encoding(wxFONTENCODING_DEFAULT) + , m_macFontNum(0) + , m_macFontSize(0) + , m_macFontStyle(0) + , m_macATSUFontID() { Init(10, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE, "Geneva", wxFONTENCODING_DEFAULT); } wxFontRefData(const wxFontRefData& data) + : wxGDIRefData() + , m_fontId(data.m_fontId) + , m_pointSize(data.m_pointSize) + , m_family(data.m_family) + , m_style(data.m_style) + , m_weight(data.m_weight) + , m_underlined(data.m_underlined) + , m_faceName(data.m_faceName) + , m_encoding(data.m_encoding) + , m_macFontNum(data.m_macFontNum) + , m_macFontSize(data.m_macFontSize) + , m_macFontStyle(data.m_macFontStyle) + , m_macATSUFontID(data.m_macATSUFontID) { Init(data.m_pointSize, data.m_family, data.m_style, data.m_weight, data.m_underlined, data.m_faceName, data.m_encoding); - - m_macFontNum = data.m_macFontNum ; - m_macFontSize = data.m_macFontSize; - m_macFontStyle = data.m_macFontStyle; - m_fontId = data.m_fontId; } wxFontRefData(int size, @@ -44,6 +64,18 @@ public: bool underlined, const wxString& faceName, wxFontEncoding encoding) + : m_fontId(0) + , m_pointSize(size) + , m_family(family) + , m_style(style) + , m_weight(weight) + , m_underlined(underlined) + , m_faceName(faceName) + , m_encoding(encoding) + , m_macFontNum(0) + , m_macFontSize(0) + , m_macFontStyle(0) + , m_macATSUFontID(0) { Init(size, family, style, weight, underlined, faceName, encoding); } @@ -60,22 +92,22 @@ protected: wxFontEncoding encoding); // font characterstics - int m_fontId; - int m_pointSize; - int m_family; - int m_style; - int m_weight; - bool m_underlined; - wxString m_faceName; + int m_fontId; + int m_pointSize; + int m_family; + int m_style; + int m_weight; + bool m_underlined; + wxString m_faceName; wxFontEncoding m_encoding; -public : - short m_macFontNum ; - short m_macFontSize ; - unsigned char m_macFontStyle ; - wxUint32 m_macATSUFontID ; -public : - void MacFindFont() ; +public: + short m_macFontNum; + short m_macFontSize; + unsigned char m_macFontStyle; + wxUint32 m_macATSUFontID; +public: + void MacFindFont() ; }; // ---------------------------------------------------------------------------- // wxFont @@ -86,7 +118,12 @@ class WXDLLEXPORT wxFont : public wxFontBase public: // ctors and such wxFont() { Init(); } - wxFont(const wxFont& font) { Init(); Ref(font); } + wxFont(const wxFont& font) + : wxFontBase() + { + Init(); + Ref(font); + } wxFont(int size, int family, diff --git a/include/wx/mac/msgdlg.h b/include/wx/mac/msgdlg.h index 4d3c8ad02b..2a237648df 100644 --- a/include/wx/mac/msgdlg.h +++ b/include/wx/mac/msgdlg.h @@ -28,22 +28,26 @@ WXDLLEXPORT_DATA(extern const char*) wxMessageBoxCaptionStr; class WXDLLEXPORT wxMessageDialog: public wxDialog { -DECLARE_DYNAMIC_CLASS(wxMessageDialog) + DECLARE_DYNAMIC_CLASS(wxMessageDialog) + protected: wxString m_caption; wxString m_message; long m_dialogStyle; wxWindow * m_parent; public: - wxMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxMessageBoxCaptionStr, - long style = wxOK|wxCENTRE, const wxPoint& pos = wxDefaultPosition); + wxMessageDialog(wxWindow *parent, + const wxString& message, + const wxString& caption = wxMessageBoxCaptionStr, + long style = wxOK|wxCENTRE, + const wxPoint& pos = wxDefaultPosition); int ShowModal(); // not supported for message dialog, RR - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO) {} + virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y), + int WXUNUSED(width), int WXUNUSED(height), + int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {} }; diff --git a/include/wx/mac/pen.h b/include/wx/mac/pen.h index 40c9b5c4ba..5a36f8aeac 100644 --- a/include/wx/mac/pen.h +++ b/include/wx/mac/pen.h @@ -30,6 +30,8 @@ public: wxPenRefData(const wxPenRefData& data); ~wxPenRefData(); + wxPenRefData& operator=(const wxPenRefData& data); + protected: int m_width; int m_style; @@ -54,7 +56,9 @@ public: wxPen(); wxPen(const wxColour& col, int width, int style); wxPen(const wxBitmap& stipple, int width); - inline wxPen(const wxPen& pen) { Ref(pen); } + wxPen(const wxPen& pen) + : wxGDIObject() + { Ref(pen); } ~wxPen(); inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; } diff --git a/src/mac/carbon/checkbox.cpp b/src/mac/carbon/checkbox.cpp index 85ebcf2391..88a00906e0 100644 --- a/src/mac/carbon/checkbox.cpp +++ b/src/mac/carbon/checkbox.cpp @@ -61,7 +61,7 @@ void wxCheckBox::Command (wxCommandEvent & event) ProcessCommand (event); } -void wxCheckBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart ) +void wxCheckBox::MacHandleControlClick( WXWidget WXUNUSED(control), wxInt16 WXUNUSED(controlpart) ) { SetValue( !GetValue() ) ; wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId ); @@ -71,11 +71,12 @@ void wxCheckBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart ) } // Bitmap checkbox -bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) +bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, + const wxBitmap *label, + const wxPoint& pos, + const wxSize& size, long style, + const wxValidator& validator, + const wxString& name) { SetName(name); SetValidator(validator); diff --git a/src/mac/carbon/dnd.cpp b/src/mac/carbon/dnd.cpp index 33ad69d413..5369a1cf34 100644 --- a/src/mac/carbon/dnd.cpp +++ b/src/mac/carbon/dnd.cpp @@ -490,8 +490,9 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind return(noErr); } -pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow, void *handlerRefCon, -DragReference theDrag) +pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow, + void *handlerRefCon, + DragReference theDrag) { MacTrackingGlobals* trackingGlobals = (MacTrackingGlobals*) handlerRefCon; if ( trackingGlobals->m_currentTarget ) diff --git a/src/mac/checkbox.cpp b/src/mac/checkbox.cpp index 85ebcf2391..88a00906e0 100644 --- a/src/mac/checkbox.cpp +++ b/src/mac/checkbox.cpp @@ -61,7 +61,7 @@ void wxCheckBox::Command (wxCommandEvent & event) ProcessCommand (event); } -void wxCheckBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart ) +void wxCheckBox::MacHandleControlClick( WXWidget WXUNUSED(control), wxInt16 WXUNUSED(controlpart) ) { SetValue( !GetValue() ) ; wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId ); @@ -71,11 +71,12 @@ void wxCheckBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart ) } // Bitmap checkbox -bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) +bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, + const wxBitmap *label, + const wxPoint& pos, + const wxSize& size, long style, + const wxValidator& validator, + const wxString& name) { SetName(name); SetValidator(validator); diff --git a/src/mac/dnd.cpp b/src/mac/dnd.cpp index 33ad69d413..5369a1cf34 100644 --- a/src/mac/dnd.cpp +++ b/src/mac/dnd.cpp @@ -490,8 +490,9 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind return(noErr); } -pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow, void *handlerRefCon, -DragReference theDrag) +pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow, + void *handlerRefCon, + DragReference theDrag) { MacTrackingGlobals* trackingGlobals = (MacTrackingGlobals*) handlerRefCon; if ( trackingGlobals->m_currentTarget )