corrected warnings when compiling with -Wall -W

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Gilles Depeyrot
2002-05-08 14:00:23 +00:00
parent 3475a005d6
commit f2af4afb82
8 changed files with 106 additions and 54 deletions

View File

@@ -92,14 +92,14 @@ class WXDLLEXPORT wxListKey
{ {
public: public:
// implicit ctors // implicit ctors
wxListKey() wxListKey() : m_keyType(wxKEY_NONE)
{ m_keyType = wxKEY_NONE; } { }
wxListKey(long i) wxListKey(long i) : m_keyType(wxKEY_INTEGER)
{ m_keyType = wxKEY_INTEGER; m_key.integer = i; } { m_key.integer = i; }
wxListKey(const wxChar *s) wxListKey(const wxChar *s) : m_keyType(wxKEY_STRING)
{ m_keyType = wxKEY_STRING; m_key.string = wxStrdup(s); } { m_key.string = wxStrdup(s); }
wxListKey(const wxString& s) wxListKey(const wxString& s) : m_keyType(wxKEY_STRING)
{ m_keyType = wxKEY_STRING; m_key.string = wxStrdup(s.c_str()); } { m_key.string = wxStrdup(s.c_str()); }
// accessors // accessors
wxKeyType GetKeyType() const { return m_keyType; } wxKeyType GetKeyType() const { return m_keyType; }
@@ -183,6 +183,8 @@ private:
*m_previous; *m_previous;
wxListBase *m_list; // list we belong to 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) void Init(wxKeyType keyType = wxKEY_NONE); // Must be declared before it's used (for VC++ 1.5)
public: public:
// default ctor & dtor // default ctor & dtor
wxListBase(wxKeyType keyType = wxKEY_NONE) { Init(keyType); } wxListBase(wxKeyType keyType = wxKEY_NONE)
{ Init(keyType); }
virtual ~wxListBase(); virtual ~wxListBase();
// accessors // accessors
@@ -399,7 +402,7 @@ private:
: wxListBase(count, (void **)elements) { } \ : wxListBase(count, (void **)elements) { } \
\ \
name& operator=(const name& list) \ name& operator=(const name& list) \
{ return (name&)wxListBase::operator=(list); } \ { (void) wxListBase::operator=(list); return *this; } \
\ \
nodetype *GetFirst() const \ nodetype *GetFirst() const \
{ return (nodetype *)wxListBase::GetFirst(); } \ { return (nodetype *)wxListBase::GetFirst(); } \
@@ -506,7 +509,7 @@ public:
~wxList() { } ~wxList() { }
wxList& operator=(const wxList& list) wxList& operator=(const wxList& list)
{ return (wxList&)wxListBase::operator=(list); } { (void) wxListBase::operator=(list); return *this; }
// compatibility methods // compatibility methods
void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); } void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); }

View File

@@ -21,20 +21,40 @@ class WXDLLEXPORT wxFontRefData: public wxGDIRefData
friend class WXDLLEXPORT wxFont; friend class WXDLLEXPORT wxFont;
public: public:
wxFontRefData() 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, Init(10, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE,
"Geneva", wxFONTENCODING_DEFAULT); "Geneva", wxFONTENCODING_DEFAULT);
} }
wxFontRefData(const wxFontRefData& data) 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, Init(data.m_pointSize, data.m_family, data.m_style, data.m_weight,
data.m_underlined, data.m_faceName, data.m_encoding); 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, wxFontRefData(int size,
@@ -44,6 +64,18 @@ public:
bool underlined, bool underlined,
const wxString& faceName, const wxString& faceName,
wxFontEncoding encoding) 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); Init(size, family, style, weight, underlined, faceName, encoding);
} }
@@ -69,12 +101,12 @@ protected:
wxString m_faceName; wxString m_faceName;
wxFontEncoding m_encoding; wxFontEncoding m_encoding;
public : public:
short m_macFontNum ; short m_macFontNum;
short m_macFontSize ; short m_macFontSize;
unsigned char m_macFontStyle ; unsigned char m_macFontStyle;
wxUint32 m_macATSUFontID ; wxUint32 m_macATSUFontID;
public : public:
void MacFindFont() ; void MacFindFont() ;
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -86,7 +118,12 @@ class WXDLLEXPORT wxFont : public wxFontBase
public: public:
// ctors and such // ctors and such
wxFont() { Init(); } wxFont() { Init(); }
wxFont(const wxFont& font) { Init(); Ref(font); } wxFont(const wxFont& font)
: wxFontBase()
{
Init();
Ref(font);
}
wxFont(int size, wxFont(int size,
int family, int family,

View File

@@ -28,22 +28,26 @@ WXDLLEXPORT_DATA(extern const char*) wxMessageBoxCaptionStr;
class WXDLLEXPORT wxMessageDialog: public wxDialog class WXDLLEXPORT wxMessageDialog: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS(wxMessageDialog) DECLARE_DYNAMIC_CLASS(wxMessageDialog)
protected: protected:
wxString m_caption; wxString m_caption;
wxString m_message; wxString m_message;
long m_dialogStyle; long m_dialogStyle;
wxWindow * m_parent; wxWindow * m_parent;
public: public:
wxMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxMessageBoxCaptionStr, wxMessageDialog(wxWindow *parent,
long style = wxOK|wxCENTRE, const wxPoint& pos = wxDefaultPosition); const wxString& message,
const wxString& caption = wxMessageBoxCaptionStr,
long style = wxOK|wxCENTRE,
const wxPoint& pos = wxDefaultPosition);
int ShowModal(); int ShowModal();
// not supported for message dialog, RR // not supported for message dialog, RR
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
int width, int height, int WXUNUSED(width), int WXUNUSED(height),
int sizeFlags = wxSIZE_AUTO) {} int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
}; };

View File

@@ -30,6 +30,8 @@ public:
wxPenRefData(const wxPenRefData& data); wxPenRefData(const wxPenRefData& data);
~wxPenRefData(); ~wxPenRefData();
wxPenRefData& operator=(const wxPenRefData& data);
protected: protected:
int m_width; int m_width;
int m_style; int m_style;
@@ -54,7 +56,9 @@ public:
wxPen(); wxPen();
wxPen(const wxColour& col, int width, int style); wxPen(const wxColour& col, int width, int style);
wxPen(const wxBitmap& stipple, int width); wxPen(const wxBitmap& stipple, int width);
inline wxPen(const wxPen& pen) { Ref(pen); } wxPen(const wxPen& pen)
: wxGDIObject()
{ Ref(pen); }
~wxPen(); ~wxPen();
inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; } inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }

View File

@@ -61,7 +61,7 @@ void wxCheckBox::Command (wxCommandEvent & event)
ProcessCommand (event); ProcessCommand (event);
} }
void wxCheckBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart ) void wxCheckBox::MacHandleControlClick( WXWidget WXUNUSED(control), wxInt16 WXUNUSED(controlpart) )
{ {
SetValue( !GetValue() ) ; SetValue( !GetValue() ) ;
wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId ); wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId );
@@ -71,7 +71,8 @@ void wxCheckBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
} }
// Bitmap checkbox // Bitmap checkbox
bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *label, bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id,
const wxBitmap *label,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, long style, const wxSize& size, long style,
const wxValidator& validator, const wxValidator& validator,

View File

@@ -490,8 +490,9 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind
return(noErr); return(noErr);
} }
pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow, void *handlerRefCon, pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow,
DragReference theDrag) void *handlerRefCon,
DragReference theDrag)
{ {
MacTrackingGlobals* trackingGlobals = (MacTrackingGlobals*) handlerRefCon; MacTrackingGlobals* trackingGlobals = (MacTrackingGlobals*) handlerRefCon;
if ( trackingGlobals->m_currentTarget ) if ( trackingGlobals->m_currentTarget )

View File

@@ -61,7 +61,7 @@ void wxCheckBox::Command (wxCommandEvent & event)
ProcessCommand (event); ProcessCommand (event);
} }
void wxCheckBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart ) void wxCheckBox::MacHandleControlClick( WXWidget WXUNUSED(control), wxInt16 WXUNUSED(controlpart) )
{ {
SetValue( !GetValue() ) ; SetValue( !GetValue() ) ;
wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId ); wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId );
@@ -71,7 +71,8 @@ void wxCheckBox::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
} }
// Bitmap checkbox // Bitmap checkbox
bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *label, bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id,
const wxBitmap *label,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, long style, const wxSize& size, long style,
const wxValidator& validator, const wxValidator& validator,

View File

@@ -490,8 +490,9 @@ pascal OSErr wxMacWindowDragTrackingHandler(DragTrackingMessage theMessage, Wind
return(noErr); return(noErr);
} }
pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow, void *handlerRefCon, pascal OSErr wxMacWindowDragReceiveHandler(WindowPtr theWindow,
DragReference theDrag) void *handlerRefCon,
DragReference theDrag)
{ {
MacTrackingGlobals* trackingGlobals = (MacTrackingGlobals*) handlerRefCon; MacTrackingGlobals* trackingGlobals = (MacTrackingGlobals*) handlerRefCon;
if ( trackingGlobals->m_currentTarget ) if ( trackingGlobals->m_currentTarget )