From d84afea9d1ec41ee4e2ebb3bf6b87926cf5f04d1 Mon Sep 17 00:00:00 2001 From: Gilles Depeyrot Date: Tue, 7 May 2002 21:58:27 +0000 Subject: [PATCH] corrected warnings when compiling with -Wall -W git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/arrimpl.cpp | 2 +- include/wx/bmpbuttn.h | 5 ++- include/wx/clntdata.h | 2 +- include/wx/date.h | 2 +- include/wx/fontenc.h | 6 ++- include/wx/generic/accel.h | 3 +- include/wx/gtk/brush.h | 4 +- include/wx/gtk/colour.h | 4 +- include/wx/gtk/pen.h | 4 +- include/wx/gtk/region.h | 4 +- include/wx/gtk1/brush.h | 4 +- include/wx/gtk1/colour.h | 4 +- include/wx/gtk1/pen.h | 4 +- include/wx/gtk1/region.h | 4 +- include/wx/hash.h | 6 ++- include/wx/iconbndl.h | 8 ++-- include/wx/image.h | 4 +- include/wx/mac/accel.h | 16 +++++--- include/wx/mac/brush.h | 13 ++++-- include/wx/mac/choice.h | 13 +++--- include/wx/mac/colour.h | 12 ++++-- include/wx/mac/control.h | 10 ++--- include/wx/mac/filedlg.h | 6 +-- include/wx/mac/listbox.h | 46 ++++++++++----------- include/wx/mac/private.h | 80 ++++++++++++++++++++----------------- include/wx/mac/statline.h | 3 +- include/wx/mac/stattext.h | 2 +- include/wx/mac/toolbar.h | 10 +++-- include/wx/mac/toplevel.h | 51 +++++++++++------------ include/wx/memtext.h | 10 ++--- include/wx/quantize.h | 3 +- include/wx/time.h | 2 +- src/common/artstd.cpp | 2 +- src/common/valgen.cpp | 1 + src/common/valtext.cpp | 1 + src/common/variant.cpp | 1 + src/generic/accel.cpp | 1 + src/generic/fdrepdlg.cpp | 8 ++-- src/generic/filedlgg.cpp | 2 +- src/gtk/bitmap.cpp | 1 + src/gtk/brush.cpp | 1 + src/gtk/colour.cpp | 1 + src/gtk/cursor.cpp | 1 + src/gtk/font.cpp | 1 + src/gtk/pen.cpp | 1 + src/gtk/region.cpp | 5 ++- src/gtk1/bitmap.cpp | 1 + src/gtk1/brush.cpp | 1 + src/gtk1/colour.cpp | 1 + src/gtk1/cursor.cpp | 1 + src/gtk1/font.cpp | 1 + src/gtk1/pen.cpp | 1 + src/gtk1/region.cpp | 5 ++- src/mac/accel.cpp | 4 +- src/mac/brush.cpp | 5 ++- src/mac/carbon/accel.cpp | 4 +- src/mac/carbon/brush.cpp | 5 ++- src/mac/carbon/colour.cpp | 3 +- src/mac/carbon/dc.cpp | 5 +-- src/mac/carbon/dcmemory.cpp | 4 +- src/mac/carbon/font.cpp | 6 +-- src/mac/carbon/gsocket.c | 2 + src/mac/carbon/icon.cpp | 7 ++-- src/mac/carbon/spinbutt.cpp | 2 +- src/mac/carbon/statbrma.cpp | 2 +- src/mac/carbon/stattext.cpp | 1 - src/mac/carbon/textctrl.cpp | 10 ++--- src/mac/carbon/thread.cpp | 5 +-- src/mac/carbon/toolbar.cpp | 10 ++--- src/mac/carbon/utilsexc.cpp | 2 +- src/mac/carbon/window.cpp | 6 ++- src/mac/colour.cpp | 3 +- src/mac/dc.cpp | 5 +-- src/mac/dcmemory.cpp | 4 +- src/mac/font.cpp | 6 +-- src/mac/gsocket.c | 2 + src/mac/icon.cpp | 7 ++-- src/mac/spinbutt.cpp | 2 +- src/mac/statbrma.cpp | 2 +- src/mac/stattext.cpp | 1 - src/mac/textctrl.cpp | 10 ++--- src/mac/thread.cpp | 5 +-- src/mac/toolbar.cpp | 10 ++--- src/mac/utilsexc.cpp | 2 +- src/mac/window.cpp | 6 ++- src/unix/gsocket.c | 26 ++++++------ src/unix/mimetype.cpp | 21 +++++----- 87 files changed, 334 insertions(+), 246 deletions(-) diff --git a/include/wx/arrimpl.cpp b/include/wx/arrimpl.cpp index 844eb4b751..8296608a01 100644 --- a/include/wx/arrimpl.cpp +++ b/include/wx/arrimpl.cpp @@ -52,7 +52,7 @@ name& name::operator=(const name& src) \ return *this; \ } \ \ -name::name(const name& src) \ +name::name(const name& src) : wxArrayPtrVoid() \ { \ DoCopy(src); \ } \ diff --git a/include/wx/bmpbuttn.h b/include/wx/bmpbuttn.h index 884796042a..ee7a64bf0b 100644 --- a/include/wx/bmpbuttn.h +++ b/include/wx/bmpbuttn.h @@ -27,7 +27,10 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr; class WXDLLEXPORT wxBitmapButtonBase : public wxButton { public: - wxBitmapButtonBase() { m_marginX = m_marginY = 0; } + wxBitmapButtonBase() + : m_bmpNormal(), m_bmpSelected(), m_bmpFocus(), m_bmpDisabled() + , m_marginX(0), m_marginY(0) + { } // set the bitmaps void SetBitmapLabel(const wxBitmap& bitmap) diff --git a/include/wx/clntdata.h b/include/wx/clntdata.h index a632635ad8..1b0f1792aa 100644 --- a/include/wx/clntdata.h +++ b/include/wx/clntdata.h @@ -39,7 +39,7 @@ public: class WXDLLEXPORT wxStringClientData : public wxClientData { public: - wxStringClientData() { } + wxStringClientData() : m_data() { } wxStringClientData( const wxString &data ) : m_data(data) { } void SetData( const wxString &data ) { m_data = data; } const wxString& GetData() const { return m_data; } diff --git a/include/wx/date.h b/include/wx/date.h index 635457d9d3..b3b8dd9779 100644 --- a/include/wx/date.h +++ b/include/wx/date.h @@ -55,7 +55,7 @@ public: wxDate(long j) : m_date((double)(j + 0.5)) { Init(); } wxDate(int m, int d, int y) : m_date(d, (wxDateTime::Month)m, y) { Init(); } wxDate(const wxString& dat) { Init(); (void)m_date.ParseDate(dat); } - wxDate(const wxDate &date) { *this = date; } + wxDate(const wxDate &date) : wxObject() { *this = date; } wxDate(const wxDateTime& dt) { Init(); m_date = dt; } diff --git a/include/wx/fontenc.h b/include/wx/fontenc.h index d4a9ee6a1e..73c832a771 100644 --- a/include/wx/fontenc.h +++ b/include/wx/fontenc.h @@ -103,7 +103,11 @@ struct WXDLLEXPORT wxNativeEncodingInfo wxFontEncoding encoding; // so that we know what this struct represents #if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMAC__) - wxNativeEncodingInfo() { charset = 0; /* ANSI_CHARSET */ } + wxNativeEncodingInfo() + : facename() + , encoding(wxFONTENCODING_SYSTEM) + , charset(0) /* ANSI_CHARSET */ + { } int charset; #elif defined(_WX_X_FONTLIKE) diff --git a/include/wx/generic/accel.h b/include/wx/generic/accel.h index bdd4ff8a85..290de47d1a 100644 --- a/include/wx/generic/accel.h +++ b/include/wx/generic/accel.h @@ -28,7 +28,8 @@ public: virtual ~wxAcceleratorTable(); wxAcceleratorTable(const wxAcceleratorTable& accel) - { Ref(accel); } + : wxObject() + { Ref(accel); } wxAcceleratorTable& operator=(const wxAcceleratorTable& accel) { if ( m_refData != accel.m_refData ) Ref(accel); return *this; } diff --git a/include/wx/gtk/brush.h b/include/wx/gtk/brush.h index 2859c6ad39..dd20823aed 100644 --- a/include/wx/gtk/brush.h +++ b/include/wx/gtk/brush.h @@ -40,7 +40,9 @@ public: wxBrush( const wxBitmap &stippleBitmap ); ~wxBrush(); - wxBrush( const wxBrush &brush ) { Ref(brush); } + wxBrush( const wxBrush &brush ) + : wxGDIObject() + { Ref(brush); } wxBrush& operator = ( const wxBrush& brush ) { Ref(brush); return *this; } bool Ok() const { return m_refData != NULL; } diff --git a/include/wx/gtk/colour.h b/include/wx/gtk/colour.h index bce0560ddb..e399d074b2 100644 --- a/include/wx/gtk/colour.h +++ b/include/wx/gtk/colour.h @@ -49,7 +49,9 @@ public: wxColour( const wxString &colourName ) { InitFromName(colourName); } wxColour( const char *colourName ) { InitFromName(colourName); } - wxColour( const wxColour& col ) { Ref(col); } + wxColour( const wxColour& col ) + : wxGDIObject() + { Ref(col); } wxColour& operator = ( const wxColour& col ) { Ref(col); return *this; } ~wxColour(); diff --git a/include/wx/gtk/pen.h b/include/wx/gtk/pen.h index cf1464fdb1..9f9fe6e9c5 100644 --- a/include/wx/gtk/pen.h +++ b/include/wx/gtk/pen.h @@ -45,7 +45,9 @@ public: wxPen( const wxColour &colour, int width, int style ); ~wxPen(); - wxPen( const wxPen& pen ) { Ref(pen); } + wxPen( const wxPen& pen ) + : wxGDIObject() + { Ref(pen); } wxPen& operator = ( const wxPen& pen ) { Ref(pen); return *this; } bool Ok() const { return m_refData != NULL; } diff --git a/include/wx/gtk/region.h b/include/wx/gtk/region.h index c4f58a97d7..5adf4edeb9 100644 --- a/include/wx/gtk/region.h +++ b/include/wx/gtk/region.h @@ -73,7 +73,9 @@ public: wxRegion( size_t n, const wxPoint *points, int fillStyle = wxODDEVEN_RULE ); ~wxRegion(); - wxRegion( const wxRegion& region ) { Ref(region); } + wxRegion( const wxRegion& region ) + : wxGDIObject() + { Ref(region); } wxRegion& operator = ( const wxRegion& region ) { Ref(region); return *this; } bool Ok() const { return m_refData != NULL; } diff --git a/include/wx/gtk1/brush.h b/include/wx/gtk1/brush.h index 2859c6ad39..dd20823aed 100644 --- a/include/wx/gtk1/brush.h +++ b/include/wx/gtk1/brush.h @@ -40,7 +40,9 @@ public: wxBrush( const wxBitmap &stippleBitmap ); ~wxBrush(); - wxBrush( const wxBrush &brush ) { Ref(brush); } + wxBrush( const wxBrush &brush ) + : wxGDIObject() + { Ref(brush); } wxBrush& operator = ( const wxBrush& brush ) { Ref(brush); return *this; } bool Ok() const { return m_refData != NULL; } diff --git a/include/wx/gtk1/colour.h b/include/wx/gtk1/colour.h index bce0560ddb..e399d074b2 100644 --- a/include/wx/gtk1/colour.h +++ b/include/wx/gtk1/colour.h @@ -49,7 +49,9 @@ public: wxColour( const wxString &colourName ) { InitFromName(colourName); } wxColour( const char *colourName ) { InitFromName(colourName); } - wxColour( const wxColour& col ) { Ref(col); } + wxColour( const wxColour& col ) + : wxGDIObject() + { Ref(col); } wxColour& operator = ( const wxColour& col ) { Ref(col); return *this; } ~wxColour(); diff --git a/include/wx/gtk1/pen.h b/include/wx/gtk1/pen.h index cf1464fdb1..9f9fe6e9c5 100644 --- a/include/wx/gtk1/pen.h +++ b/include/wx/gtk1/pen.h @@ -45,7 +45,9 @@ public: wxPen( const wxColour &colour, int width, int style ); ~wxPen(); - wxPen( const wxPen& pen ) { Ref(pen); } + wxPen( const wxPen& pen ) + : wxGDIObject() + { Ref(pen); } wxPen& operator = ( const wxPen& pen ) { Ref(pen); return *this; } bool Ok() const { return m_refData != NULL; } diff --git a/include/wx/gtk1/region.h b/include/wx/gtk1/region.h index c4f58a97d7..5adf4edeb9 100644 --- a/include/wx/gtk1/region.h +++ b/include/wx/gtk1/region.h @@ -73,7 +73,9 @@ public: wxRegion( size_t n, const wxPoint *points, int fillStyle = wxODDEVEN_RULE ); ~wxRegion(); - wxRegion( const wxRegion& region ) { Ref(region); } + wxRegion( const wxRegion& region ) + : wxGDIObject() + { Ref(region); } wxRegion& operator = ( const wxRegion& region ) { Ref(region); return *this; } bool Ok() const { return m_refData != NULL; } diff --git a/include/wx/hash.h b/include/wx/hash.h index 5868ef8dff..557238d6a4 100644 --- a/include/wx/hash.h +++ b/include/wx/hash.h @@ -79,7 +79,8 @@ private: class WXDLLEXPORT wxHashTableLong : public wxObject { public: - wxHashTableLong(size_t size = wxHASH_SIZE_DEFAULT) { Init(size); } + wxHashTableLong(size_t size = wxHASH_SIZE_DEFAULT) + { Init(size); } virtual ~wxHashTableLong(); void Create(size_t size = wxHASH_SIZE_DEFAULT); @@ -158,7 +159,8 @@ public: ~wxHashTable(); // copy ctor and assignment operator - wxHashTable(const wxHashTable& table) : wxObject() { DoCopy(table); } + wxHashTable(const wxHashTable& table) : wxObject() + { DoCopy(table); } wxHashTable& operator=(const wxHashTable& table) { Clear(); DoCopy(table); return *this; } diff --git a/include/wx/iconbndl.h b/include/wx/iconbndl.h index fa7dae30cd..e70715ff7a 100644 --- a/include/wx/iconbndl.h +++ b/include/wx/iconbndl.h @@ -32,16 +32,16 @@ class WXDLLEXPORT wxIconBundle { public: // default constructor - wxIconBundle() {} + wxIconBundle() : m_icons() {} // initializes the bundle with the icon(s) found in the file - wxIconBundle( const wxString& file, long type ) + wxIconBundle( const wxString& file, long type ) : m_icons() { AddIcon( file, type ); } // initializes the bundle with a single icon - wxIconBundle( const wxIcon& icon ) + wxIconBundle( const wxIcon& icon ) : m_icons() { AddIcon( icon ); } const wxIconBundle& operator =( const wxIconBundle& ic ); - wxIconBundle( const wxIconBundle& ic ) + wxIconBundle( const wxIconBundle& ic ) : m_icons() { *this = ic; } ~wxIconBundle() { DeleteIcons(); } diff --git a/include/wx/image.h b/include/wx/image.h index 7522d06854..6df67faa3c 100644 --- a/include/wx/image.h +++ b/include/wx/image.h @@ -43,7 +43,9 @@ class WXDLLEXPORT wxImage; class WXDLLEXPORT wxImageHandler: public wxObject { public: - wxImageHandler() { m_name = ""; m_extension = ""; m_type = 0; } + wxImageHandler() + : m_name(""), m_extension(""), m_mime(), m_type(0) + { } #if wxUSE_STREAMS virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 ); diff --git a/include/wx/mac/accel.h b/include/wx/mac/accel.h index fd7d76e277..3586e6cefb 100644 --- a/include/wx/mac/accel.h +++ b/include/wx/mac/accel.h @@ -27,14 +27,20 @@ public: wxAcceleratorTable(int n, wxAcceleratorEntry entries[]); // Load from array // Copy constructors - inline wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); } - inline wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); } + wxAcceleratorTable(const wxAcceleratorTable& accel) + : wxObject() + { Ref(accel); } + wxAcceleratorTable(const wxAcceleratorTable* accel) + { if (accel) Ref(*accel); } ~wxAcceleratorTable(); - inline wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; } - inline bool operator == (const wxAcceleratorTable& accel) { return m_refData == accel.m_refData; } - inline bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; } + wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) + { if (*this == accel) return (*this); Ref(accel); return *this; } + bool operator == (const wxAcceleratorTable& accel) + { return m_refData == accel.m_refData; } + bool operator != (const wxAcceleratorTable& accel) + { return m_refData != accel.m_refData; } bool Ok() const; diff --git a/include/wx/mac/brush.h b/include/wx/mac/brush.h index 0fbf591753..af030c9dbe 100644 --- a/include/wx/mac/brush.h +++ b/include/wx/mac/brush.h @@ -39,7 +39,9 @@ public: wxBrush(short macThemeBrush ) ; wxBrush(const wxColour& col, int style); wxBrush(const wxBitmap& stipple); - inline wxBrush(const wxBrush& brush) { Ref(brush); } + wxBrush(const wxBrush& brush) + : wxGDIObject() + { Ref(brush); } ~wxBrush(); virtual void SetColour(const wxColour& col) ; @@ -49,9 +51,12 @@ public: virtual void SetMacTheme(short macThemeBrush) ; virtual void SetMacThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ; - inline wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; } - inline bool operator == (const wxBrush& brush) { return m_refData == brush.m_refData; } - inline bool operator != (const wxBrush& brush) { return m_refData != brush.m_refData; } + wxBrush& operator = (const wxBrush& brush) + { if (*this == brush) return (*this); Ref(brush); return *this; } + bool operator == (const wxBrush& brush) + { return m_refData == brush.m_refData; } + bool operator != (const wxBrush& brush) + { return m_refData != brush.m_refData; } wxMacBrushKind MacGetBrushKind() const ; diff --git a/include/wx/mac/choice.h b/include/wx/mac/choice.h index 998f06d203..82c7a52228 100644 --- a/include/wx/mac/choice.h +++ b/include/wx/mac/choice.h @@ -27,11 +27,14 @@ WX_DEFINE_ARRAY( char * , wxChoiceDataArray ) ; // Choice item class WXDLLEXPORT wxChoice: public wxChoiceBase { - DECLARE_DYNAMIC_CLASS(wxChoice) - - public: - wxChoice() {} - virtual ~wxChoice() ; + DECLARE_DYNAMIC_CLASS(wxChoice) + +public: + wxChoice() + : m_strings(), m_datas(), m_macPopUpMenuHandle(NULL) + {} + + virtual ~wxChoice() ; wxChoice(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, diff --git a/include/wx/mac/colour.h b/include/wx/mac/colour.h index 13f24cc716..f4afea1ba2 100644 --- a/include/wx/mac/colour.h +++ b/include/wx/mac/colour.h @@ -28,11 +28,17 @@ public: wxColour(); // from RGB wxColour( unsigned char red, unsigned char green, unsigned char blue ); - wxColour( unsigned long colRGB ) { Set(colRGB); } + wxColour( unsigned long colRGB ) + : m_isInit(FALSE), m_red(0), m_blue(0), m_green(0) + { Set(colRGB); } // implicit conversion from the colour name - wxColour( const wxString &colourName ) { InitFromName(colourName); } - wxColour( const char *colourName ) { InitFromName(colourName); } + wxColour( const wxString &colourName ) + : m_isInit(FALSE), m_red(0), m_blue(0), m_green(0) + { InitFromName(colourName); } + wxColour( const char *colourName ) + : m_isInit(FALSE), m_red(0), m_blue(0), m_green(0) + { InitFromName(colourName); } // copy ctors and assignment operators wxColour( const wxColour& col ); diff --git a/include/wx/mac/control.h b/include/wx/mac/control.h index 02f59ad05e..cef07af9c5 100644 --- a/include/wx/mac/control.h +++ b/include/wx/mac/control.h @@ -102,11 +102,11 @@ protected: protected: // For controls like radiobuttons which are really composite - WXWidget m_macControl ; - bool m_macControlIsShown ; - wxList m_subControls; - int m_macHorizontalBorder ; - int m_macVerticalBorder ; + WXWidget m_macControl ; + bool m_macControlIsShown ; + wxList m_subControls; + int m_macHorizontalBorder ; + int m_macVerticalBorder ; virtual wxSize DoGetBestSize() const; diff --git a/include/wx/mac/filedlg.h b/include/wx/mac/filedlg.h index be26bc0250..c0b724ecbb 100644 --- a/include/wx/mac/filedlg.h +++ b/include/wx/mac/filedlg.h @@ -65,9 +65,9 @@ public: int ShowModal(); // not supported for file 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/listbox.h b/include/wx/mac/listbox.h index 0d1f1f7ad5..126567e96c 100644 --- a/include/wx/mac/listbox.h +++ b/include/wx/mac/listbox.h @@ -92,7 +92,7 @@ public: virtual void* DoGetItemClientData(int n) const; virtual void DoSetItemClientObject(int n, wxClientData* clientData); virtual wxClientData* DoGetItemClientObject(int n) const; - virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ; + virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ; // wxCheckListBox support #if wxUSE_OWNER_DRAWN @@ -108,29 +108,29 @@ public: // Windows callbacks - virtual void SetupColours(); - virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ; + virtual void SetupColours(); + virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ; - void* m_macList ; - wxArrayString m_stringArray ; - wxListDataArray m_dataArray ; - wxArrayInt m_selectionPreImage ; - void MacSetRedraw( bool doDraw ) ; + void* m_macList ; + wxArrayString m_stringArray ; + wxListDataArray m_dataArray ; + wxArrayInt m_selectionPreImage ; + void MacSetRedraw( bool doDraw ) ; protected: - void MacDestroy() ; - void MacDelete( int n ) ; - void MacInsert( int n , const char * text) ; - void MacAppend( const char * text) ; - void MacSet( int n , const char *text ) ; - void MacClear() ; - void MacSetSelection( int n , bool select ) ; - int MacGetSelection() const ; - int MacGetSelections(wxArrayInt& aSelections) const ; - bool MacIsSelected( int n ) const ; - void MacScrollTo( int n ) ; - void OnSize( const wxSizeEvent &size ) ; - void MacDoClick() ; - void MacDoDoubleClick() ; + void MacDestroy() ; + void MacDelete( int n ) ; + void MacInsert( int n , const char * text) ; + void MacAppend( const char * text) ; + void MacSet( int n , const char *text ) ; + void MacClear() ; + void MacSetSelection( int n , bool select ) ; + int MacGetSelection() const ; + int MacGetSelections(wxArrayInt& aSelections) const ; + bool MacIsSelected( int n ) const ; + void MacScrollTo( int n ) ; + void OnSize( const wxSizeEvent &size ) ; + void MacDoClick() ; + void MacDoDoubleClick() ; // do we have multiple selections? bool HasMultipleSelection() const; @@ -150,7 +150,7 @@ protected: private: DECLARE_DYNAMIC_CLASS(wxListBox) - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; #endif diff --git a/include/wx/mac/private.h b/include/wx/mac/private.h index 2afc85b372..af3ab308ec 100644 --- a/include/wx/mac/private.h +++ b/include/wx/mac/private.h @@ -37,53 +37,59 @@ class wxMacPortStateHelper { -public : - wxMacPortStateHelper( GrafPtr newport) ; - wxMacPortStateHelper() ; - ~wxMacPortStateHelper() ; + DECLARE_NO_COPY_CLASS(wxMacPortStateHelper) + +public: + wxMacPortStateHelper( GrafPtr newport) ; + wxMacPortStateHelper() ; + ~wxMacPortStateHelper() ; - void Setup( GrafPtr newport ) ; - void Clear() ; - bool IsCleared() { return m_clip == NULL ; } - GrafPtr GetCurrentPort() { return m_currentPort ; } + void Setup( GrafPtr newport ) ; + void Clear() ; + bool IsCleared() { return m_clip == NULL ; } + GrafPtr GetCurrentPort() { return m_currentPort ; } -private : - GrafPtr m_currentPort ; - GrafPtr m_oldPort ; - RgnHandle m_clip ; - ThemeDrawingState m_drawingState ; - short m_textFont ; - short m_textSize ; - short m_textStyle ; - short m_textMode ; +private: + GrafPtr m_currentPort ; + GrafPtr m_oldPort ; + RgnHandle m_clip ; + ThemeDrawingState m_drawingState ; + short m_textFont ; + short m_textSize ; + short m_textStyle ; + short m_textMode ; } ; class WXDLLEXPORT wxMacPortSetter { -public : - wxMacPortSetter( const wxDC* dc ) ; - ~wxMacPortSetter() ; -private : - wxMacPortStateHelper m_ph ; - const wxDC* m_dc ; + DECLARE_NO_COPY_CLASS(wxMacPortSetter) + +public: + wxMacPortSetter( const wxDC* dc ) ; + ~wxMacPortSetter() ; +private: + wxMacPortStateHelper m_ph ; + const wxDC* m_dc ; } ; class wxMacDrawingHelper { -public : - wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ; - ~wxMacDrawingHelper() ; - bool Ok() { return m_ok ; } - void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; } - void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; } - void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; } - const Point& GetOrigin() { return m_origin ; } -private : - Point m_origin ; - GrafPtr m_formerPort ; - GrafPtr m_currentPort ; - PenState m_savedPenState ; - bool m_ok ; + DECLARE_NO_COPY_CLASS(wxMacDrawingHelper) + +public: + wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ; + ~wxMacDrawingHelper() ; + bool Ok() { return m_ok ; } + void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; } + void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; } + void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; } + const Point& GetOrigin() { return m_origin ; } +private: + Point m_origin ; + GrafPtr m_formerPort ; + GrafPtr m_currentPort ; + PenState m_savedPenState ; + bool m_ok ; } ; diff --git a/include/wx/mac/statline.h b/include/wx/mac/statline.h index af6516c90d..51eda50002 100644 --- a/include/wx/mac/statline.h +++ b/include/wx/mac/statline.h @@ -27,7 +27,7 @@ class WXDLLEXPORT wxStaticLine : public wxStaticLineBase public: // constructors and pseudo-constructors - wxStaticLine() { } + wxStaticLine() : m_statbox(NULL) { } wxStaticLine( wxWindow *parent, wxWindowID id, @@ -35,6 +35,7 @@ public: const wxSize &size = wxDefaultSize, long style = wxLI_HORIZONTAL, const wxString &name = wxStaticTextNameStr ) + : m_statbox(NULL) { Create(parent, id, pos, size, style, name); } diff --git a/include/wx/mac/stattext.h b/include/wx/mac/stattext.h index 934d7e8118..fb9fdff70f 100644 --- a/include/wx/mac/stattext.h +++ b/include/wx/mac/stattext.h @@ -20,7 +20,7 @@ class WXDLLEXPORT wxStaticText: public wxStaticTextBase { DECLARE_DYNAMIC_CLASS(wxStaticText) public: - inline wxStaticText() { } + inline wxStaticText() : m_label() { } inline wxStaticText(wxWindow *parent, wxWindowID id, const wxString& label, diff --git a/include/wx/mac/toolbar.h b/include/wx/mac/toolbar.h index 2bc339b013..2c24882618 100644 --- a/include/wx/mac/toolbar.h +++ b/include/wx/mac/toolbar.h @@ -31,12 +31,14 @@ class WXDLLEXPORT wxToolBar: public wxToolBarBase * Public interface */ - wxToolBar() { Init(); } + wxToolBar() : m_macToolHandles() { Init(); } - inline wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxNO_BORDER|wxTB_HORIZONTAL, - const wxString& name = wxToolBarNameStr) + inline wxToolBar(wxWindow *parent, wxWindowID id, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = wxNO_BORDER|wxTB_HORIZONTAL, + const wxString& name = wxToolBarNameStr) + : m_macToolHandles() { Init(); Create(parent, id, pos, size, style, name); diff --git a/include/wx/mac/toplevel.h b/include/wx/mac/toplevel.h index 89f8cc9580..8d51f95e79 100644 --- a/include/wx/mac/toplevel.h +++ b/include/wx/mac/toplevel.h @@ -58,35 +58,36 @@ public: virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); } virtual void Restore(); - virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) { return FALSE; } + virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style) = wxFULLSCREEN_ALL) + { return FALSE; } virtual bool IsFullScreen() const { return FALSE; } // implementation from now on // -------------------------- - virtual void MacCreateRealWindow( const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name ) ; - static WXWindow MacGetWindowInUpdate() { return s_macWindowInUpdate ; } - virtual void MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin ) ; - virtual void Clear() ; - virtual WXWidget MacGetContainerForEmbedding() ; - WXWindow MacGetWindowRef() { return m_macWindow ; } - virtual void MacActivate( WXEVENTREF ev , bool inIsActivating ) ; - virtual void MacUpdate( long timestamp ) ; - virtual void MacMouseDown( WXEVENTREF ev , short windowPart ) ; - virtual void MacMouseUp( WXEVENTREF ev , short windowPart ) ; - virtual void MacMouseMoved( WXEVENTREF ev , short windowPart ) ; - virtual void MacKeyDown( WXEVENTREF ev ) ; - virtual void MacFireMouseEvent( WXEVENTREF ev ) ; - virtual void Raise(); - virtual void Lower(); - virtual void SetTitle( const wxString& title); - virtual bool Show( bool show = TRUE ); - virtual void DoMoveWindow(int x, int y, int width, int height); - void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ; + virtual void MacCreateRealWindow( const wxString& title, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name ) ; + static WXWindow MacGetWindowInUpdate() { return s_macWindowInUpdate ; } + virtual void MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin ) ; + virtual void Clear() ; + virtual WXWidget MacGetContainerForEmbedding() ; + WXWindow MacGetWindowRef() { return m_macWindow ; } + virtual void MacActivate( WXEVENTREF ev , bool inIsActivating ) ; + virtual void MacUpdate( long timestamp ) ; + virtual void MacMouseDown( WXEVENTREF ev , short windowPart ) ; + virtual void MacMouseUp( WXEVENTREF ev , short windowPart ) ; + virtual void MacMouseMoved( WXEVENTREF ev , short windowPart ) ; + virtual void MacKeyDown( WXEVENTREF ev ) ; + virtual void MacFireMouseEvent( WXEVENTREF ev ) ; + virtual void Raise(); + virtual void Lower(); + virtual void SetTitle( const wxString& title); + virtual bool Show( bool show = TRUE ); + virtual void DoMoveWindow(int x, int y, int width, int height); + void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ; protected: // common part of all ctors void Init(); @@ -105,7 +106,7 @@ protected: WXHRGN m_macNoEraseUpdateRgn ; bool m_macNeedsErasing ; - static WXWindow s_macWindowInUpdate ; + static WXWindow s_macWindowInUpdate ; }; // list of all frames and modeless dialogs diff --git a/include/wx/memtext.h b/include/wx/memtext.h index de373e5546..92617b24f1 100644 --- a/include/wx/memtext.h +++ b/include/wx/memtext.h @@ -30,18 +30,18 @@ protected: virtual bool OnExists() const { return FALSE; } - virtual bool OnOpen(const wxString &strBufferName, - wxTextBufferOpenMode OpenMode) + virtual bool OnOpen(const wxString & WXUNUSED(strBufferName), + wxTextBufferOpenMode WXUNUSED(OpenMode)) { return TRUE; } virtual bool OnClose() { return TRUE; } - virtual bool OnRead(wxMBConv& conv) + virtual bool OnRead(wxMBConv& WXUNUSED(conv)) { return TRUE; } - virtual bool OnWrite(wxTextFileType typeNew, - wxMBConv& conv = wxConvLibc) + virtual bool OnWrite(wxTextFileType WXUNUSED(typeNew), + wxMBConv& WXUNUSED(conv) = wxConvLibc) { return TRUE; } }; diff --git a/include/wx/quantize.h b/include/wx/quantize.h index 4d68a6901e..fac092df9a 100644 --- a/include/wx/quantize.h +++ b/include/wx/quantize.h @@ -42,7 +42,8 @@ DECLARE_DYNAMIC_CLASS(wxQuantize) //// Constructor - wxQuantize() {}; + wxQuantize() {} + ~wxQuantize() {} //// Operations diff --git a/include/wx/time.h b/include/wx/time.h index af2e71a502..4e4bdf1535 100644 --- a/include/wx/time.h +++ b/include/wx/time.h @@ -47,7 +47,7 @@ public: wxTime() : m_time(wxDateTime::Now()) { } wxTime(clockTy s) : m_time((time_t)(s - wxTIME_EPOCH_DIFF)) { } void operator=(const wxTime& t) { m_time = t.m_time; } - wxTime(const wxTime& t) { *this = t; } + wxTime(const wxTime& t) : wxObject() { *this = t; } wxTime(hourTy h, minuteTy m, secondTy s = 0, bool WXUNUSED(dst) = FALSE) : m_time(h, m, s) { } diff --git a/src/common/artstd.cpp b/src/common/artstd.cpp index cc08b0d756..9a8e4f53eb 100644 --- a/src/common/artstd.cpp +++ b/src/common/artstd.cpp @@ -169,7 +169,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxDefaultArtProviderModule, wxModule) wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id, const wxArtClient& client, - const wxSize& size) + const wxSize& WXUNUSED(size)) { // wxMessageBox icons: ART_MSGBOX(wxART_ERROR, wxICON_ERROR, error) diff --git a/src/common/valgen.cpp b/src/common/valgen.cpp index 706dfe892e..02da993d25 100644 --- a/src/common/valgen.cpp +++ b/src/common/valgen.cpp @@ -81,6 +81,7 @@ wxGenericValidator::wxGenericValidator(wxArrayInt *val) } wxGenericValidator::wxGenericValidator(const wxGenericValidator& val) + : wxValidator() { Copy(val); } diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index 4c8a474868..fc7bc3e4c7 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -61,6 +61,7 @@ wxTextValidator::wxTextValidator(long style, wxString *val) } wxTextValidator::wxTextValidator(const wxTextValidator& val) + : wxValidator() { Copy(val); } diff --git a/src/common/variant.cpp b/src/common/variant.cpp index 894c1cf9aa..abbd2de6e5 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -1390,6 +1390,7 @@ wxVariant::wxVariant(const wxArrayString& val, const wxString& name) // Strings } wxVariant::wxVariant(const wxVariant& variant) + : wxObject() { if (!variant.IsNull()) { diff --git a/src/generic/accel.cpp b/src/generic/accel.cpp index 21a745b598..ff0483376b 100644 --- a/src/generic/accel.cpp +++ b/src/generic/accel.cpp @@ -59,6 +59,7 @@ public: } wxAccelRefData(const wxAccelRefData& data) + : wxObjectRefData() { m_accels.DeleteContents(TRUE); m_accels = data.m_accels; diff --git a/src/generic/fdrepdlg.cpp b/src/generic/fdrepdlg.cpp index a5a0040077..d613e1e4c9 100644 --- a/src/generic/fdrepdlg.cpp +++ b/src/generic/fdrepdlg.cpp @@ -251,22 +251,22 @@ void wxGenericFindReplaceDialog::SendEvent(const wxEventType& evtType) // event handlers // ---------------------------------------------------------------------------- -void wxGenericFindReplaceDialog::OnFind(wxCommandEvent& event) +void wxGenericFindReplaceDialog::OnFind(wxCommandEvent& WXUNUSED(event)) { SendEvent(wxEVT_COMMAND_FIND_NEXT); } -void wxGenericFindReplaceDialog::OnReplace(wxCommandEvent& event) +void wxGenericFindReplaceDialog::OnReplace(wxCommandEvent& WXUNUSED(event)) { SendEvent(wxEVT_COMMAND_FIND_REPLACE); } -void wxGenericFindReplaceDialog::OnReplaceAll(wxCommandEvent& event) +void wxGenericFindReplaceDialog::OnReplaceAll(wxCommandEvent& WXUNUSED(event)) { SendEvent(wxEVT_COMMAND_FIND_REPLACE_ALL); } -void wxGenericFindReplaceDialog::OnCancel(wxCommandEvent& event) +void wxGenericFindReplaceDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) { SendEvent(wxEVT_COMMAND_FIND_CLOSE); diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index 9d3d7bc280..00fe75da38 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -579,7 +579,7 @@ void wxFileData::MakeItem( wxListItem &item ) // wxFileCtrl //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxFileCtrl,wxListCtrl); +IMPLEMENT_DYNAMIC_CLASS(wxFileCtrl,wxListCtrl) BEGIN_EVENT_TABLE(wxFileCtrl,wxListCtrl) EVT_LIST_DELETE_ITEM(-1, wxFileCtrl::OnListDeleteItem) diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index 1b3afbebba..033071565e 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -814,6 +814,7 @@ wxImage wxBitmap::ConvertToImage() const } wxBitmap::wxBitmap( const wxBitmap& bmp ) + : wxGDIObject() { Ref( bmp ); } diff --git a/src/gtk/brush.cpp b/src/gtk/brush.cpp index c6b35cc4a2..f20993f3cb 100644 --- a/src/gtk/brush.cpp +++ b/src/gtk/brush.cpp @@ -28,6 +28,7 @@ public: } wxBrushRefData( const wxBrushRefData& data ) + : wxObjectRefData() { m_style = data.m_style; m_stipple = data.m_stipple; diff --git a/src/gtk/colour.cpp b/src/gtk/colour.cpp index 1b82a30b01..84c790a329 100644 --- a/src/gtk/colour.cpp +++ b/src/gtk/colour.cpp @@ -36,6 +36,7 @@ public: } wxColourRefData(const wxColourRefData& data) + : wxObjectRefData() { m_color = data.m_color; m_colormap = data.m_colormap; diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 8bcc0d0ce1..159bb4bffa 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -142,6 +142,7 @@ wxCursor::wxCursor(const char bits[], int width, int height, wxCursor::wxCursor( const wxCursor &cursor ) + : wxObject() { Ref( cursor ); } diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index 1fd76d1df0..79921f481a 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -174,6 +174,7 @@ void wxFontRefData::Init(int pointSize, } wxFontRefData::wxFontRefData( const wxFontRefData& data ) + : wxObjectRefData() { m_pointSize = data.m_pointSize; m_family = data.m_family; diff --git a/src/gtk/pen.cpp b/src/gtk/pen.cpp index 7ba9b5940d..11f787bd32 100644 --- a/src/gtk/pen.cpp +++ b/src/gtk/pen.cpp @@ -34,6 +34,7 @@ public: } wxPenRefData( const wxPenRefData& data ) + : wxObjectRefData() { m_style = data.m_style; m_width = data.m_width; diff --git a/src/gtk/region.cpp b/src/gtk/region.cpp index 91b9d1f043..11ca072cd3 100644 --- a/src/gtk/region.cpp +++ b/src/gtk/region.cpp @@ -39,6 +39,7 @@ public: } wxRegionRefData(const wxRegionRefData& refData) + : wxObjectRefData() { #ifdef __WXGTK20__ m_region = gdk_region_copy(refData.m_region); @@ -66,8 +67,8 @@ public: #define M_REGIONDATA ((wxRegionRefData *)m_refData) #define M_REGIONDATA_OF(rgn) ((wxRegionRefData *)(rgn.m_refData)) -IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject); -IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator,wxObject); +IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) +IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator,wxObject) // ---------------------------------------------------------------------------- // wxRegion construction diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index 1b3afbebba..033071565e 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -814,6 +814,7 @@ wxImage wxBitmap::ConvertToImage() const } wxBitmap::wxBitmap( const wxBitmap& bmp ) + : wxGDIObject() { Ref( bmp ); } diff --git a/src/gtk1/brush.cpp b/src/gtk1/brush.cpp index c6b35cc4a2..f20993f3cb 100644 --- a/src/gtk1/brush.cpp +++ b/src/gtk1/brush.cpp @@ -28,6 +28,7 @@ public: } wxBrushRefData( const wxBrushRefData& data ) + : wxObjectRefData() { m_style = data.m_style; m_stipple = data.m_stipple; diff --git a/src/gtk1/colour.cpp b/src/gtk1/colour.cpp index 1b82a30b01..84c790a329 100644 --- a/src/gtk1/colour.cpp +++ b/src/gtk1/colour.cpp @@ -36,6 +36,7 @@ public: } wxColourRefData(const wxColourRefData& data) + : wxObjectRefData() { m_color = data.m_color; m_colormap = data.m_colormap; diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index 8bcc0d0ce1..159bb4bffa 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -142,6 +142,7 @@ wxCursor::wxCursor(const char bits[], int width, int height, wxCursor::wxCursor( const wxCursor &cursor ) + : wxObject() { Ref( cursor ); } diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index 1fd76d1df0..79921f481a 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -174,6 +174,7 @@ void wxFontRefData::Init(int pointSize, } wxFontRefData::wxFontRefData( const wxFontRefData& data ) + : wxObjectRefData() { m_pointSize = data.m_pointSize; m_family = data.m_family; diff --git a/src/gtk1/pen.cpp b/src/gtk1/pen.cpp index 7ba9b5940d..11f787bd32 100644 --- a/src/gtk1/pen.cpp +++ b/src/gtk1/pen.cpp @@ -34,6 +34,7 @@ public: } wxPenRefData( const wxPenRefData& data ) + : wxObjectRefData() { m_style = data.m_style; m_width = data.m_width; diff --git a/src/gtk1/region.cpp b/src/gtk1/region.cpp index 91b9d1f043..11ca072cd3 100644 --- a/src/gtk1/region.cpp +++ b/src/gtk1/region.cpp @@ -39,6 +39,7 @@ public: } wxRegionRefData(const wxRegionRefData& refData) + : wxObjectRefData() { #ifdef __WXGTK20__ m_region = gdk_region_copy(refData.m_region); @@ -66,8 +67,8 @@ public: #define M_REGIONDATA ((wxRegionRefData *)m_refData) #define M_REGIONDATA_OF(rgn) ((wxRegionRefData *)(rgn.m_refData)) -IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject); -IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator,wxObject); +IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) +IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator,wxObject) // ---------------------------------------------------------------------------- // wxRegion construction diff --git a/src/mac/accel.cpp b/src/mac/accel.cpp index 181460adf4..798aa72026 100644 --- a/src/mac/accel.cpp +++ b/src/mac/accel.cpp @@ -46,8 +46,8 @@ public: #define M_ACCELDATA ((wxAcceleratorRefData *)m_refData) wxAcceleratorRefData::wxAcceleratorRefData() + : m_accels() { - m_accels.DeleteContents( TRUE ); } wxAcceleratorRefData::~wxAcceleratorRefData() @@ -57,7 +57,7 @@ wxAcceleratorRefData::~wxAcceleratorRefData() wxAcceleratorTable::wxAcceleratorTable() { - m_refData = NULL; + m_refData = NULL; } wxAcceleratorTable::~wxAcceleratorTable() diff --git a/src/mac/brush.cpp b/src/mac/brush.cpp index f38b3782d9..ba06a370e2 100644 --- a/src/mac/brush.cpp +++ b/src/mac/brush.cpp @@ -46,14 +46,15 @@ protected: #define M_BRUSHDATA ((wxBrushRefData *)m_refData) wxBrushRefData::wxBrushRefData() + : m_style(wxSOLID) { - m_style = wxSOLID; m_macBrushKind = kwxMacBrushColour ; } wxBrushRefData::wxBrushRefData(const wxBrushRefData& data) + : wxGDIRefData() + , m_style(data.m_style) { - m_style = data.m_style; m_stipple = data.m_stipple; m_colour = data.m_colour; m_macBrushKind = data.m_macBrushKind ; diff --git a/src/mac/carbon/accel.cpp b/src/mac/carbon/accel.cpp index 181460adf4..798aa72026 100644 --- a/src/mac/carbon/accel.cpp +++ b/src/mac/carbon/accel.cpp @@ -46,8 +46,8 @@ public: #define M_ACCELDATA ((wxAcceleratorRefData *)m_refData) wxAcceleratorRefData::wxAcceleratorRefData() + : m_accels() { - m_accels.DeleteContents( TRUE ); } wxAcceleratorRefData::~wxAcceleratorRefData() @@ -57,7 +57,7 @@ wxAcceleratorRefData::~wxAcceleratorRefData() wxAcceleratorTable::wxAcceleratorTable() { - m_refData = NULL; + m_refData = NULL; } wxAcceleratorTable::~wxAcceleratorTable() diff --git a/src/mac/carbon/brush.cpp b/src/mac/carbon/brush.cpp index f38b3782d9..ba06a370e2 100644 --- a/src/mac/carbon/brush.cpp +++ b/src/mac/carbon/brush.cpp @@ -46,14 +46,15 @@ protected: #define M_BRUSHDATA ((wxBrushRefData *)m_refData) wxBrushRefData::wxBrushRefData() + : m_style(wxSOLID) { - m_style = wxSOLID; m_macBrushKind = kwxMacBrushColour ; } wxBrushRefData::wxBrushRefData(const wxBrushRefData& data) + : wxGDIRefData() + , m_style(data.m_style) { - m_style = data.m_style; m_stipple = data.m_stipple; m_colour = data.m_colour; m_macBrushKind = data.m_macBrushKind ; diff --git a/src/mac/carbon/colour.cpp b/src/mac/carbon/colour.cpp index 82fb8a7928..5755910b26 100644 --- a/src/mac/carbon/colour.cpp +++ b/src/mac/carbon/colour.cpp @@ -52,6 +52,7 @@ wxColour::wxColour (unsigned char r, unsigned char g, unsigned char b) } wxColour::wxColour (const wxColour& col) + : wxObject() { m_red = col.m_red; m_green = col.m_green; @@ -125,4 +126,4 @@ void wxColour::Set( const WXCOLORREF* color ) m_red = col->red>>8 ; m_blue = col->blue>>8 ; m_green = col->green>>8 ; -} \ No newline at end of file +} diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index fcd86ce283..c6f0d29f89 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -909,8 +909,8 @@ void wxDC::DoDrawLines(int n, wxPoint points[], } void wxDC::DoDrawPolygon(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle ) + wxCoord xoffset, wxCoord yoffset, + int fillStyle ) { wxCHECK_RET(Ok(), wxT("Invalid DC")); wxMacPortSetter helper(this) ; @@ -1201,7 +1201,6 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, if ( LockPixels(bmappixels) ) { wxMacPortSetter helper(this) ; - RGBColor tempColor ; if ( source->GetDepth() == 1 ) { diff --git a/src/mac/carbon/dcmemory.cpp b/src/mac/carbon/dcmemory.cpp index 9985a00b9e..5e3f603ce8 100644 --- a/src/mac/carbon/dcmemory.cpp +++ b/src/mac/carbon/dcmemory.cpp @@ -23,6 +23,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC) wxMemoryDC::wxMemoryDC(void) + : m_selected() { m_ok = TRUE; SetBackground(*wxWHITE_BRUSH); @@ -32,8 +33,9 @@ wxMemoryDC::wxMemoryDC(void) }; wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) ) + : m_selected() { - m_ok = TRUE; + m_ok = TRUE; SetBackground(*wxWHITE_BRUSH); SetBrush(*wxWHITE_BRUSH); SetPen(*wxBLACK_PEN); diff --git a/src/mac/carbon/font.cpp b/src/mac/carbon/font.cpp index ab906cad67..d30015eaf9 100644 --- a/src/mac/carbon/font.cpp +++ b/src/mac/carbon/font.cpp @@ -54,9 +54,9 @@ void wxFontRefData::Init(int pointSize, m_faceName = faceName; m_encoding = encoding; - m_macFontNum = 0 ; - m_macFontSize = 0; - m_macFontStyle = 0; + m_macFontNum = 0 ; + m_macFontSize = 0; + m_macFontStyle = 0; m_fontId = 0; } diff --git a/src/mac/carbon/gsocket.c b/src/mac/carbon/gsocket.c index 290f75ee64..bbeaa29fcf 100644 --- a/src/mac/carbon/gsocket.c +++ b/src/mac/carbon/gsocket.c @@ -1650,10 +1650,12 @@ void _GSocket_Internal_Proc(unsigned long e , void* d ) /* Hack added for Mac OS X */ GSocketError GAddress_UNIX_GetPath(GAddress *addr, char *path, size_t buf) { + return GSOCK_INVADDR; } GSocketError GAddress_UNIX_SetPath(GAddress *addr, const char *path) { + return GSOCK_INVADDR; } #endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */ diff --git a/src/mac/carbon/icon.cpp b/src/mac/carbon/icon.cpp index e886c1073c..5ec5f3ec80 100644 --- a/src/mac/carbon/icon.cpp +++ b/src/mac/carbon/icon.cpp @@ -31,24 +31,23 @@ wxIcon::wxIcon() } wxIcon::wxIcon(const char bits[], int width, int height) : - wxBitmap(bits,width,height ) + wxBitmap(bits, width, height) { } wxIcon::wxIcon( const char **bits ) : - wxBitmap(bits ) + wxBitmap(bits) { } wxIcon::wxIcon( char **bits ) : - wxBitmap(bits ) + wxBitmap(bits) { } wxIcon::wxIcon(const wxString& icon_file, int flags, int desiredWidth, int desiredHeight) - { LoadFile(icon_file, (wxBitmapType) flags, desiredWidth, desiredHeight); } diff --git a/src/mac/carbon/spinbutt.cpp b/src/mac/carbon/spinbutt.cpp index e3beab7322..91a05baddd 100644 --- a/src/mac/carbon/spinbutt.cpp +++ b/src/mac/carbon/spinbutt.cpp @@ -27,7 +27,7 @@ #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl) - IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent); + IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent) #endif wxSpinButton::wxSpinButton() diff --git a/src/mac/carbon/statbrma.cpp b/src/mac/carbon/statbrma.cpp index 139b505f8e..59f6573dae 100644 --- a/src/mac/carbon/statbrma.cpp +++ b/src/mac/carbon/statbrma.cpp @@ -147,4 +147,4 @@ void wxStatusBarMac::MacSuperEnabled( bool enabled ) { Refresh(FALSE) ; wxWindow::MacSuperEnabled( enabled ) ; -} \ No newline at end of file +} diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index 2982b7c5c4..c36ecf6845 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -164,7 +164,6 @@ void wxStaticText::OnPaint( wxPaintEvent &event ) wxSize wxStaticText::DoGetBestSize() const { - int x,y ; int widthTextMax = 0, widthLine, heightTextTotal = 0, heightLineDefault = 0, heightLine = 0; diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index 7ab6489709..f479c01bb7 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -253,7 +253,6 @@ bool wxTextCtrl::CanPaste() const if (!IsEditable()) return FALSE; - long offset ; #if TARGET_CARBON OSStatus err = noErr; ScrapRef scrapRef; @@ -275,6 +274,7 @@ bool wxTextCtrl::CanPaste() const return FALSE; #else + long offset ; if ( GetScrap( NULL , 'TEXT' , &offset ) > 0 ) { return TRUE ; @@ -304,7 +304,7 @@ void wxTextCtrl::SetInsertionPointEnd() long wxTextCtrl::GetInsertionPoint() const { - ControlEditTextSelectionRec selection ; + // ControlEditTextSelectionRec selection ; TEHandle teH ; long size ; @@ -315,7 +315,7 @@ long wxTextCtrl::GetInsertionPoint() const long wxTextCtrl::GetLastPosition() const { - ControlEditTextSelectionRec selection ; + // ControlEditTextSelectionRec selection ; TEHandle teH ; long size ; @@ -393,8 +393,8 @@ void wxTextCtrl::WriteText(const wxString& text) ::GetControlData( (ControlHandle) m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ; - TEInsert( wxBuffer , strlen( wxBuffer) , teH ) ; - Refresh() ; + TEInsert( wxBuffer , strlen( wxBuffer) , teH ) ; + Refresh() ; } void wxTextCtrl::AppendText(const wxString& text) diff --git a/src/mac/carbon/thread.cpp b/src/mac/carbon/thread.cpp index 88f837d669..75db6e539e 100644 --- a/src/mac/carbon/thread.cpp +++ b/src/mac/carbon/thread.cpp @@ -146,7 +146,6 @@ wxMutexError wxMutex::TryLock() wxMacStCritical critical ; if ( UMASystemIsInitialized() ) { - OSErr err ; ThreadID current = kNoThreadID; ::MacGetCurrentThread(¤t); // if we are not the owner, give an error back @@ -285,7 +284,7 @@ void wxCondition::Broadcast() // this works because all these threads are already waiting and so each // SetEvent() inside Signal() is really a PulseEvent() because the event // state is immediately returned to non-signaled - for ( int i = 0; i < m_internal->m_waiters.Count(); i++ ) + for ( size_t i = 0; i < m_internal->m_waiters.Count(); i++ ) { Signal(); } @@ -477,7 +476,7 @@ wxThread *wxThread::This() err = MacGetCurrentThread( ¤t ) ; - for ( int i = 0 ; i < s_threads.Count() ; ++i ) + for ( size_t i = 0 ; i < s_threads.Count() ; ++i ) { if ( ( (wxThread*) s_threads[i] )->GetId() == current ) return (wxThread*) s_threads[i] ; diff --git a/src/mac/carbon/toolbar.cpp b/src/mac/carbon/toolbar.cpp index 152e1aaddf..77662d2dbe 100644 --- a/src/mac/carbon/toolbar.cpp +++ b/src/mac/carbon/toolbar.cpp @@ -169,9 +169,9 @@ bool wxToolBar::Realize() return FALSE; Point localOrigin ; - Rect clipRect ; + // Rect clipRect ; WindowRef window = (WindowRef) MacGetRootWindow() ; - wxWindow *win ; + // wxWindow *win ; int lx , ly ; lx = ly = 0 ; @@ -360,9 +360,9 @@ void wxToolBar::MacSuperChangedPosition() { Point localOrigin ; - Rect clipRect ; - WindowRef window ; - wxWindow *win ; + // Rect clipRect ; + // WindowRef window ; + // wxWindow *win ; int lx , ly ; lx = ly = 0 ; MacWindowToRootWindow( &lx , &ly ) ; diff --git a/src/mac/carbon/utilsexc.cpp b/src/mac/carbon/utilsexc.cpp index c97c35e443..699008b38b 100644 --- a/src/mac/carbon/utilsexc.cpp +++ b/src/mac/carbon/utilsexc.cpp @@ -35,7 +35,7 @@ long wxExecute(const wxString& command, int flags, wxProcess *handler) #ifdef __DARWIN__ int wxAddProcessCallback(wxEndProcessData *proc_data, int fd) { - wxFAIL_MSG(wxT("wxAddProcessCallback() function not ready")); + wxFAIL_MSG( _T("wxAddProcessCallback() function not yet implemented") ); return 0; } #endif diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index e6b1ba5c7c..0708958546 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -124,6 +124,8 @@ void wxWindowMac::Init() m_hScrollBar = NULL ; m_vScrollBar = NULL ; + + m_label = wxEmptyString; } // Destructor @@ -676,12 +678,12 @@ wxPoint wxWindowMac::GetClientAreaOrigin() const return wxPoint(MacGetLeftBorderSize( ) , MacGetTopBorderSize( ) ); } -void wxWindow::SetTitle(const wxString& title) +void wxWindowMac::SetTitle(const wxString& title) { m_label = title ; } -wxString wxWindow::GetTitle() const +wxString wxWindowMac::GetTitle() const { return m_label ; } diff --git a/src/mac/colour.cpp b/src/mac/colour.cpp index 82fb8a7928..5755910b26 100644 --- a/src/mac/colour.cpp +++ b/src/mac/colour.cpp @@ -52,6 +52,7 @@ wxColour::wxColour (unsigned char r, unsigned char g, unsigned char b) } wxColour::wxColour (const wxColour& col) + : wxObject() { m_red = col.m_red; m_green = col.m_green; @@ -125,4 +126,4 @@ void wxColour::Set( const WXCOLORREF* color ) m_red = col->red>>8 ; m_blue = col->blue>>8 ; m_green = col->green>>8 ; -} \ No newline at end of file +} diff --git a/src/mac/dc.cpp b/src/mac/dc.cpp index fcd86ce283..c6f0d29f89 100644 --- a/src/mac/dc.cpp +++ b/src/mac/dc.cpp @@ -909,8 +909,8 @@ void wxDC::DoDrawLines(int n, wxPoint points[], } void wxDC::DoDrawPolygon(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle ) + wxCoord xoffset, wxCoord yoffset, + int fillStyle ) { wxCHECK_RET(Ok(), wxT("Invalid DC")); wxMacPortSetter helper(this) ; @@ -1201,7 +1201,6 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, if ( LockPixels(bmappixels) ) { wxMacPortSetter helper(this) ; - RGBColor tempColor ; if ( source->GetDepth() == 1 ) { diff --git a/src/mac/dcmemory.cpp b/src/mac/dcmemory.cpp index 9985a00b9e..5e3f603ce8 100644 --- a/src/mac/dcmemory.cpp +++ b/src/mac/dcmemory.cpp @@ -23,6 +23,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC) wxMemoryDC::wxMemoryDC(void) + : m_selected() { m_ok = TRUE; SetBackground(*wxWHITE_BRUSH); @@ -32,8 +33,9 @@ wxMemoryDC::wxMemoryDC(void) }; wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) ) + : m_selected() { - m_ok = TRUE; + m_ok = TRUE; SetBackground(*wxWHITE_BRUSH); SetBrush(*wxWHITE_BRUSH); SetPen(*wxBLACK_PEN); diff --git a/src/mac/font.cpp b/src/mac/font.cpp index ab906cad67..d30015eaf9 100644 --- a/src/mac/font.cpp +++ b/src/mac/font.cpp @@ -54,9 +54,9 @@ void wxFontRefData::Init(int pointSize, m_faceName = faceName; m_encoding = encoding; - m_macFontNum = 0 ; - m_macFontSize = 0; - m_macFontStyle = 0; + m_macFontNum = 0 ; + m_macFontSize = 0; + m_macFontStyle = 0; m_fontId = 0; } diff --git a/src/mac/gsocket.c b/src/mac/gsocket.c index 290f75ee64..bbeaa29fcf 100644 --- a/src/mac/gsocket.c +++ b/src/mac/gsocket.c @@ -1650,10 +1650,12 @@ void _GSocket_Internal_Proc(unsigned long e , void* d ) /* Hack added for Mac OS X */ GSocketError GAddress_UNIX_GetPath(GAddress *addr, char *path, size_t buf) { + return GSOCK_INVADDR; } GSocketError GAddress_UNIX_SetPath(GAddress *addr, const char *path) { + return GSOCK_INVADDR; } #endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */ diff --git a/src/mac/icon.cpp b/src/mac/icon.cpp index e886c1073c..5ec5f3ec80 100644 --- a/src/mac/icon.cpp +++ b/src/mac/icon.cpp @@ -31,24 +31,23 @@ wxIcon::wxIcon() } wxIcon::wxIcon(const char bits[], int width, int height) : - wxBitmap(bits,width,height ) + wxBitmap(bits, width, height) { } wxIcon::wxIcon( const char **bits ) : - wxBitmap(bits ) + wxBitmap(bits) { } wxIcon::wxIcon( char **bits ) : - wxBitmap(bits ) + wxBitmap(bits) { } wxIcon::wxIcon(const wxString& icon_file, int flags, int desiredWidth, int desiredHeight) - { LoadFile(icon_file, (wxBitmapType) flags, desiredWidth, desiredHeight); } diff --git a/src/mac/spinbutt.cpp b/src/mac/spinbutt.cpp index e3beab7322..91a05baddd 100644 --- a/src/mac/spinbutt.cpp +++ b/src/mac/spinbutt.cpp @@ -27,7 +27,7 @@ #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl) - IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent); + IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent) #endif wxSpinButton::wxSpinButton() diff --git a/src/mac/statbrma.cpp b/src/mac/statbrma.cpp index 139b505f8e..59f6573dae 100644 --- a/src/mac/statbrma.cpp +++ b/src/mac/statbrma.cpp @@ -147,4 +147,4 @@ void wxStatusBarMac::MacSuperEnabled( bool enabled ) { Refresh(FALSE) ; wxWindow::MacSuperEnabled( enabled ) ; -} \ No newline at end of file +} diff --git a/src/mac/stattext.cpp b/src/mac/stattext.cpp index 2982b7c5c4..c36ecf6845 100644 --- a/src/mac/stattext.cpp +++ b/src/mac/stattext.cpp @@ -164,7 +164,6 @@ void wxStaticText::OnPaint( wxPaintEvent &event ) wxSize wxStaticText::DoGetBestSize() const { - int x,y ; int widthTextMax = 0, widthLine, heightTextTotal = 0, heightLineDefault = 0, heightLine = 0; diff --git a/src/mac/textctrl.cpp b/src/mac/textctrl.cpp index 7ab6489709..f479c01bb7 100644 --- a/src/mac/textctrl.cpp +++ b/src/mac/textctrl.cpp @@ -253,7 +253,6 @@ bool wxTextCtrl::CanPaste() const if (!IsEditable()) return FALSE; - long offset ; #if TARGET_CARBON OSStatus err = noErr; ScrapRef scrapRef; @@ -275,6 +274,7 @@ bool wxTextCtrl::CanPaste() const return FALSE; #else + long offset ; if ( GetScrap( NULL , 'TEXT' , &offset ) > 0 ) { return TRUE ; @@ -304,7 +304,7 @@ void wxTextCtrl::SetInsertionPointEnd() long wxTextCtrl::GetInsertionPoint() const { - ControlEditTextSelectionRec selection ; + // ControlEditTextSelectionRec selection ; TEHandle teH ; long size ; @@ -315,7 +315,7 @@ long wxTextCtrl::GetInsertionPoint() const long wxTextCtrl::GetLastPosition() const { - ControlEditTextSelectionRec selection ; + // ControlEditTextSelectionRec selection ; TEHandle teH ; long size ; @@ -393,8 +393,8 @@ void wxTextCtrl::WriteText(const wxString& text) ::GetControlData( (ControlHandle) m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*) &teH , &size ) ; - TEInsert( wxBuffer , strlen( wxBuffer) , teH ) ; - Refresh() ; + TEInsert( wxBuffer , strlen( wxBuffer) , teH ) ; + Refresh() ; } void wxTextCtrl::AppendText(const wxString& text) diff --git a/src/mac/thread.cpp b/src/mac/thread.cpp index 88f837d669..75db6e539e 100644 --- a/src/mac/thread.cpp +++ b/src/mac/thread.cpp @@ -146,7 +146,6 @@ wxMutexError wxMutex::TryLock() wxMacStCritical critical ; if ( UMASystemIsInitialized() ) { - OSErr err ; ThreadID current = kNoThreadID; ::MacGetCurrentThread(¤t); // if we are not the owner, give an error back @@ -285,7 +284,7 @@ void wxCondition::Broadcast() // this works because all these threads are already waiting and so each // SetEvent() inside Signal() is really a PulseEvent() because the event // state is immediately returned to non-signaled - for ( int i = 0; i < m_internal->m_waiters.Count(); i++ ) + for ( size_t i = 0; i < m_internal->m_waiters.Count(); i++ ) { Signal(); } @@ -477,7 +476,7 @@ wxThread *wxThread::This() err = MacGetCurrentThread( ¤t ) ; - for ( int i = 0 ; i < s_threads.Count() ; ++i ) + for ( size_t i = 0 ; i < s_threads.Count() ; ++i ) { if ( ( (wxThread*) s_threads[i] )->GetId() == current ) return (wxThread*) s_threads[i] ; diff --git a/src/mac/toolbar.cpp b/src/mac/toolbar.cpp index 152e1aaddf..77662d2dbe 100644 --- a/src/mac/toolbar.cpp +++ b/src/mac/toolbar.cpp @@ -169,9 +169,9 @@ bool wxToolBar::Realize() return FALSE; Point localOrigin ; - Rect clipRect ; + // Rect clipRect ; WindowRef window = (WindowRef) MacGetRootWindow() ; - wxWindow *win ; + // wxWindow *win ; int lx , ly ; lx = ly = 0 ; @@ -360,9 +360,9 @@ void wxToolBar::MacSuperChangedPosition() { Point localOrigin ; - Rect clipRect ; - WindowRef window ; - wxWindow *win ; + // Rect clipRect ; + // WindowRef window ; + // wxWindow *win ; int lx , ly ; lx = ly = 0 ; MacWindowToRootWindow( &lx , &ly ) ; diff --git a/src/mac/utilsexc.cpp b/src/mac/utilsexc.cpp index c97c35e443..699008b38b 100644 --- a/src/mac/utilsexc.cpp +++ b/src/mac/utilsexc.cpp @@ -35,7 +35,7 @@ long wxExecute(const wxString& command, int flags, wxProcess *handler) #ifdef __DARWIN__ int wxAddProcessCallback(wxEndProcessData *proc_data, int fd) { - wxFAIL_MSG(wxT("wxAddProcessCallback() function not ready")); + wxFAIL_MSG( _T("wxAddProcessCallback() function not yet implemented") ); return 0; } #endif diff --git a/src/mac/window.cpp b/src/mac/window.cpp index e6b1ba5c7c..0708958546 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -124,6 +124,8 @@ void wxWindowMac::Init() m_hScrollBar = NULL ; m_vScrollBar = NULL ; + + m_label = wxEmptyString; } // Destructor @@ -676,12 +678,12 @@ wxPoint wxWindowMac::GetClientAreaOrigin() const return wxPoint(MacGetLeftBorderSize( ) , MacGetTopBorderSize( ) ); } -void wxWindow::SetTitle(const wxString& title) +void wxWindowMac::SetTitle(const wxString& title) { m_label = title ; } -wxString wxWindow::GetTitle() const +wxString wxWindowMac::GetTitle() const { return m_label ; } diff --git a/src/unix/gsocket.c b/src/unix/gsocket.c index 85a38c699f..335fa5897a 100644 --- a/src/unix/gsocket.c +++ b/src/unix/gsocket.c @@ -1042,10 +1042,10 @@ GSocketError _GSocket_Input_Timeout(GSocket *socket) if (ret == -1) { GSocket_Debug(( "GSocket_Input_Timeout, select returned -1\n" )); - if (errno == EBADF) GSocket_Debug(( "Invalid file descriptor\n" )); - if (errno == EINTR) GSocket_Debug(( "A non blocked signal was caught\n" )); - if (errno == EINVAL) GSocket_Debug(( "The highest number descriptor is negative\n" )); - if (errno == ENOMEM) GSocket_Debug(( "Not enough memory\n" )); + if (errno == EBADF) { GSocket_Debug(( "Invalid file descriptor\n" )); } + if (errno == EINTR) { GSocket_Debug(( "A non blocked signal was caught\n" )); } + if (errno == EINVAL) { GSocket_Debug(( "The highest number descriptor is negative\n" )); } + if (errno == ENOMEM) { GSocket_Debug(( "Not enough memory\n" )); } socket->m_error = GSOCK_TIMEDOUT; return GSOCK_TIMEDOUT; } @@ -1083,17 +1083,19 @@ GSocketError _GSocket_Output_Timeout(GSocket *socket) if (ret == -1) { GSocket_Debug(( "GSocket_Output_Timeout, select returned -1\n" )); - if (errno == EBADF) GSocket_Debug(( "Invalid file descriptor\n" )); - if (errno == EINTR) GSocket_Debug(( "A non blocked signal was caught\n" )); - if (errno == EINVAL) GSocket_Debug(( "The highest number descriptor is negative\n" )); - if (errno == ENOMEM) GSocket_Debug(( "Not enough memory\n" )); + if (errno == EBADF) { GSocket_Debug(( "Invalid file descriptor\n" )); } + if (errno == EINTR) { GSocket_Debug(( "A non blocked signal was caught\n" )); } + if (errno == EINVAL) { GSocket_Debug(( "The highest number descriptor is negative\n" )); } + if (errno == ENOMEM) { GSocket_Debug(( "Not enough memory\n" )); } socket->m_error = GSOCK_TIMEDOUT; return GSOCK_TIMEDOUT; } - if ( ! FD_ISSET(socket->m_fd, &writefds) ) - GSocket_Debug(( "GSocket_Output_Timeout is buggy!\n" )); - else - GSocket_Debug(( "GSocket_Output_Timeout seems correct\n" )); + if ( ! FD_ISSET(socket->m_fd, &writefds) ) { + GSocket_Debug(( "GSocket_Output_Timeout is buggy!\n" )); + } + else { + GSocket_Debug(( "GSocket_Output_Timeout seems correct\n" )); + } } else { diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index 4913cd53d5..70aaee69b2 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -1238,7 +1238,7 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) // overwriteprompt is TRUE, but this is currently ignored as *Associate* has // no overwrite prompt bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt /*= TRUE*/) - { +{ wxArrayString strExtensions; wxString strDesc, strIcon ; @@ -1252,17 +1252,17 @@ bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, bool size_t i; bool Ok = TRUE; for (i = 0; i < strTypes.GetCount(); i++) - { + { if (!m_manager->DoAssociation (strTypes[i], strIcon, entry, strExtensions, strDesc)) - Ok = FALSE; - } + Ok = FALSE; + } return Ok; - } +} // ignore index on the grouds that we only have one icon in a Unix file bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon /*= wxEmptyString*/, int /*index = 0*/) - { +{ if (strIcon.IsEmpty()) return FALSE; wxArrayString strExtensions; wxString strDesc; @@ -1276,13 +1276,14 @@ bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon /*= wxEmptyString*/, size_t i; bool Ok = TRUE; for (i = 0; i < strTypes.GetCount(); i++) - { + { if (!m_manager->DoAssociation (strTypes[i], strIcon, entry, strExtensions, strDesc)) - Ok = FALSE; - } + Ok = FALSE; + } return Ok; - } +} + // ---------------------------------------------------------------------------- // wxMimeTypesManagerImpl (Unix) // ---------------------------------------------------------------------------- -- 2.45.2