From 8fdca65cf20ae4dba861fa6667d6e233cbb900cf Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sat, 12 Sep 1998 22:11:40 +0000 Subject: [PATCH] Removed warnings Added GetCount() to wxList and wxDaynArray git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/dynarray.h | 1 + include/wx/list.h | 1 + samples/sashtest/sashtest.cpp | 10 +++++----- src/Makefile.in | 2 +- src/common/config.cpp | 2 +- src/common/file.cpp | 2 +- src/common/log.cpp | 4 ++-- src/common/odbc.cpp | 2 +- src/common/postscrp.cpp | 12 ++++++++---- src/common/wxexpr.cpp | 2 +- 10 files changed, 22 insertions(+), 16 deletions(-) diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index 1afdd85316..94dc5e1798 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -97,6 +97,7 @@ public: //@{ /// number of elements in the array size_t Count() const { return m_uiCount; } + size_t GetCount() const { return m_uiCount; } /// is it empty? bool IsEmpty() const { return m_uiCount == 0; } //@} diff --git a/include/wx/list.h b/include/wx/list.h index 1a04556ba9..61466cd3aa 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -79,6 +79,7 @@ class WXDLLEXPORT wxList: public wxObject ~wxList(void); inline int Number(void) const { return n; } + inline int GetCount(void) const { return n; } // Append to end of list wxNode *Append(wxObject *object); diff --git a/samples/sashtest/sashtest.cpp b/samples/sashtest/sashtest.cpp index 1542d084eb..aa9618a3c6 100644 --- a/samples/sashtest/sashtest.cpp +++ b/samples/sashtest/sashtest.cpp @@ -144,17 +144,17 @@ MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, c m_leftWindow2 = win; } -void MyFrame::OnQuit(wxCommandEvent& event) +void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(TRUE); } -void MyFrame::OnAbout(wxCommandEvent& event) +void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { (void)wxMessageBox("wxWindows 2.0 Sash Demo\nAuthor: Julian Smart (c) 1998", "About Sash Demo"); } -void MyFrame::OnToggleWindow(wxCommandEvent& event) +void MyFrame::OnToggleWindow(wxCommandEvent& WXUNUSED(event)) { if (m_leftWindow1->IsShown()) { @@ -203,7 +203,7 @@ void MyFrame::OnSashDrag(wxSashEvent& event) GetClientWindow()->Refresh(); } -void MyFrame::OnNewWindow(wxCommandEvent& event) +void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event)) { // Make another frame, containing a canvas MyChild *subframe = new MyChild(frame, "Canvas Frame", wxPoint(10, 10), wxSize(300, 300), @@ -329,7 +329,7 @@ bool MyFrame::OnClose(void) return TRUE; } -void MyFrame::OnSize(wxSizeEvent& event) +void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event)) { wxLayoutAlgorithm layout; layout.LayoutMDIFrame(this); diff --git a/src/Makefile.in b/src/Makefile.in index 370902040a..5caeef4a46 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -95,7 +95,7 @@ install:: @cd $(WXBASEDIR)/lib/$(OS) ; \ rm -f $(libdir)/$(STATIC_LIBRARY) ; \ $(INSTALL_DATA) $(STATIC_LIBRARY) $(libdir)/$(STATIC_LIBRARY) - @if test $(WXBASEDIR)/lib/$(OS)/$(SHARED_LIBRARY) ; then \ + @if test -f $(WXBASEDIR)/lib/$(OS)/$(SHARED_LIBRARY) ; then \ echo " Copying shared library" ; \ cd $(WXBASEDIR)/lib/$(OS) ; \ rm -f $(libdir)/lib$(LIB_TARGET).so* ; \ diff --git a/src/common/config.cpp b/src/common/config.cpp index ec03c728f6..e099f0af2c 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -71,7 +71,7 @@ bool wxConfigBase::ms_bAutoCreate = TRUE; // Not all args will always be used by derived classes, but // including them all in each class ensures compatibility. wxConfigBase::wxConfigBase(const wxString& appName, const wxString& vendorName, - const wxString& localFilename, const wxString& globalFilename, long style): + const wxString& WXUNUSED(localFilename), const wxString& WXUNUSED(globalFilename), long style): m_appName(appName), m_vendorName(vendorName), m_style(style) { m_bExpandEnvVars = TRUE; m_bRecordDefaults = FALSE; diff --git a/src/common/file.cpp b/src/common/file.cpp index f3fd151385..6cb6e3f059 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -132,7 +132,7 @@ bool wxFile::Exists(const char *name) bool wxFile::Access(const char *name, OpenMode mode) { - int how; + int how = 0; switch ( mode ) { case read: diff --git a/src/common/log.cpp b/src/common/log.cpp index 6af8892fcd..6a1848932c 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -772,11 +772,11 @@ wxFrame *wxLogWindow::GetFrame() const return m_pLogFrame; } -void wxLogWindow::OnFrameCreate(wxFrame *frame) +void wxLogWindow::OnFrameCreate(wxFrame *WXUNUSED(frame)) { } -void wxLogWindow::OnFrameDelete(wxFrame *frame) +void wxLogWindow::OnFrameDelete(wxFrame *WXUNUSED(frame)) { m_pLogFrame = (wxLogFrame *) NULL; } diff --git a/src/common/odbc.cpp b/src/common/odbc.cpp index de925cc2ea..3e921cc2e7 100644 --- a/src/common/odbc.cpp +++ b/src/common/odbc.cpp @@ -614,7 +614,7 @@ bool wxRecordSet::GetResultSet(void) field1->SetType(type); field1->SetSize(len); - SQLBindCol(hStmt, i+1, SQL_C_BINARY, field1->GetData(), field1->GetSize(), &trash); + SQLBindCol(hStmt, i+1, SQL_C_BINARY, (unsigned char*)field1->GetData(), field1->GetSize(), &trash); } switch (type) { diff --git a/src/common/postscrp.cpp b/src/common/postscrp.cpp index e8e5b5bef1..f85a94d553 100644 --- a/src/common/postscrp.cpp +++ b/src/common/postscrp.cpp @@ -2050,11 +2050,15 @@ wxDialog(parent, -1, title, pos, size, style) int yPos = 40; #if defined(__WXGTK__) || defined (__WXMOTIF__) - (void) new wxStaticText(this, -1, _("Printer Command: "), wxPoint(5, yPos)); - wxTextCtrl *text_prt = new wxTextCtrl(this, wxID_PRINTER_COMMAND, wxThePrintSetupData->GetPrinterCommand(), wxPoint(100, yPos), wxSize(100, -1)); + (void) new wxStaticText( this, -1, _("Printer Command: "), + wxPoint(5, yPos) ); + (void) new wxTextCtrl( this, wxID_PRINTER_COMMAND, wxThePrintSetupData->GetPrinterCommand(), + wxPoint(100, yPos), wxSize(100, -1) ); - (void) new wxStaticText(this, -1, _("Printer Options: "), wxPoint(210, yPos)); - wxTextCtrl *text0 = new wxTextCtrl(this, wxID_PRINTER_OPTIONS, wxThePrintSetupData->GetPrinterOptions(), wxPoint(305, yPos), wxSize(150, -1)); + (void) new wxStaticText( this, -1, _("Printer Options: "), + wxPoint(210, yPos) ); + (void) new wxTextCtrl( this, wxID_PRINTER_OPTIONS, wxThePrintSetupData->GetPrinterOptions(), + wxPoint(305, yPos), wxSize(150, -1) ); yPos += 40; #endif diff --git a/src/common/wxexpr.cpp b/src/common/wxexpr.cpp index 926cae3001..f03b2900b7 100644 --- a/src/common/wxexpr.cpp +++ b/src/common/wxexpr.cpp @@ -1230,7 +1230,7 @@ void process_command(char * cexpr) add_expr(expr); } -void syntax_error(char *s) +void syntax_error(char *WXUNUSED(s)) { if (currentwxExprErrorHandler) (void)(*(currentwxExprErrorHandler))(WXEXPR_ERROR_SYNTAX, "syntax error"); -- 2.45.2