From d1f4723592a86208a941bd486a9c1f18f43b5f51 Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Tue, 6 Apr 2004 13:19:42 +0000 Subject: [PATCH] applied patch #929947: "Various cleaning of warnings under MSW"; removed some tabs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26638 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/samples/ogl/studio/shapes.h | 10 ++--- contrib/src/ogl/lines.cpp | 6 +-- contrib/src/xrc/xmlres.cpp | 2 +- contrib/utils/wxrcedit/nodehnd.h | 2 +- contrib/utils/wxrcedit/pe_basic.cpp | 12 +++--- contrib/utils/wxrcedit/pe_basic.h | 2 +- demos/dbbrowse/browsedb.cpp | 58 ++++++++++++++--------------- demos/dbbrowse/tabpgwin.h | 2 +- demos/life/game.cpp | 4 +- samples/dnd/dnd.cpp | 8 ++-- samples/font/font.cpp | 4 +- samples/keyboard/keyboard.cpp | 4 +- samples/listbox/lboxtest.cpp | 4 +- samples/statbar/statbar.cpp | 2 +- src/xrc/xmlres.cpp | 2 +- 15 files changed, 61 insertions(+), 61 deletions(-) diff --git a/contrib/samples/ogl/studio/shapes.h b/contrib/samples/ogl/studio/shapes.h index 117721dfbe..26ca01fbe7 100644 --- a/contrib/samples/ogl/studio/shapes.h +++ b/contrib/samples/ogl/studio/shapes.h @@ -73,8 +73,8 @@ public: // Overridables // Start/end copying - virtual bool OnStartCopy(wxDiagram* diagramTo) { return TRUE; }; - virtual bool OnEndCopy(wxDiagram* diagramTo) { return TRUE; }; + virtual bool OnStartCopy(wxDiagram* WXUNUSED(diagramTo)) { return TRUE; }; + virtual bool OnEndCopy(wxDiagram* WXUNUSED(diagramTo)) { return TRUE; }; // Override this to e.g. have the shape added through a Do/Undo command system. // By default, we'll just add it directly to the destination diagram, and @@ -97,10 +97,10 @@ public: ~csDiagramClipboard() {} // Start/end copying - bool OnStartCopy(wxDiagram* diagramTo); - bool OnEndCopy(wxDiagram* diagramTo); + virtual bool OnStartCopy(wxDiagram* diagramTo); + virtual bool OnEndCopy(wxDiagram* diagramTo); - bool OnAddShape(wxDiagram* diagramTo, wxShape* newShape, wxDC* dc); + virtual bool OnAddShape(wxDiagram* diagramTo, wxShape* newShape, wxDC* dc); protected: csDiagramCommand* m_currentCmd; diff --git a/contrib/src/ogl/lines.cpp b/contrib/src/ogl/lines.cpp index 95e02cb53a..8c027c108e 100644 --- a/contrib/src/ogl/lines.cpp +++ b/contrib/src/ogl/lines.cpp @@ -594,7 +594,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p wxRealPoint *second_last_line_point = (wxRealPoint *)second_last_line_node->GetData(); // Position where we want to start drawing - double positionOnLineX, positionOnLineY; + double positionOnLineX = 0.0, positionOnLineY = 0.0; // Position of start point of line, at the end of which we draw the arrow. double startPositionX = 0.0 , startPositionY = 0.0; @@ -1090,8 +1090,8 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d // Do each end - nothing in the middle. User has to move other points // manually if necessary. - double end_x, end_y; - double other_end_x, other_end_y; + double end_x = 0.0, end_y = 0.0; + double other_end_x = 0.0, other_end_y = 0.0; wxNode *first = m_lineControlPoints->GetFirst(); /* wxRealPoint *first_point = */ (wxRealPoint *)first->GetData(); diff --git a/contrib/src/xrc/xmlres.cpp b/contrib/src/xrc/xmlres.cpp index bbe8ce47c5..d9b2c4afff 100644 --- a/contrib/src/xrc/xmlres.cpp +++ b/contrib/src/xrc/xmlres.cpp @@ -989,7 +989,7 @@ wxSize wxXmlResourceHandler::GetSize(const wxString& param) wxString s = GetParamValue(param); if (s.IsEmpty()) s = wxT("-1,-1"); bool is_dlg; - long sx, sy; + long sx, sy = 0; is_dlg = s[s.Length()-1] == wxT('d'); if (is_dlg) s.RemoveLast(); diff --git a/contrib/utils/wxrcedit/nodehnd.h b/contrib/utils/wxrcedit/nodehnd.h index 945bc76d65..bfc98bea73 100644 --- a/contrib/utils/wxrcedit/nodehnd.h +++ b/contrib/utils/wxrcedit/nodehnd.h @@ -123,7 +123,7 @@ class NodeHandlerUnknown : public NodeHandler public: NodeHandlerUnknown() : NodeHandler(new NodeInfo) {} - virtual bool CanHandle(wxXmlNode *node) { return TRUE; } + virtual bool CanHandle(wxXmlNode *WXUNUSED(node)) { return TRUE; } }; diff --git a/contrib/utils/wxrcedit/pe_basic.cpp b/contrib/utils/wxrcedit/pe_basic.cpp index ab467eb453..9e64192419 100644 --- a/contrib/utils/wxrcedit/pe_basic.cpp +++ b/contrib/utils/wxrcedit/pe_basic.cpp @@ -192,13 +192,13 @@ class PropEditCtrlCoordXY : public PropEditCtrlInt return m_c[m_which]; } - virtual wxString GetPropName(const PropertyInfo& pinfo) + virtual wxString GetPropName(const PropertyInfo& WXUNUSED(pinfo)) { if (m_which == 0) return _T("x"); else return _T("y"); } virtual bool HasClearButton() { return FALSE; } - virtual bool IsPresent(const PropertyInfo& pinfo) { return FALSE; } + virtual bool IsPresent(const PropertyInfo& WXUNUSED(pinfo)) { return FALSE; } protected: @@ -243,13 +243,13 @@ class PropEditCtrlCoordDlg : public PropEditCtrlBool return _("true"); } - virtual wxString GetPropName(const PropertyInfo& pinfo) + virtual wxString GetPropName(const PropertyInfo& WXUNUSED(pinfo)) { return _T("dlg"); } virtual bool HasClearButton() { return FALSE; } - virtual bool IsPresent(const PropertyInfo& pinfo) { return FALSE; } + virtual bool IsPresent(const PropertyInfo& WXUNUSED(pinfo)) { return FALSE; } }; @@ -318,13 +318,13 @@ class PropEditCtrlDimX : public PropEditCtrlInt return XmlReadValue(GetNode(), pi->Name).BeforeFirst(_T('d')); } - virtual wxString GetPropName(const PropertyInfo& pinfo) + virtual wxString GetPropName(const PropertyInfo& WXUNUSED(pinfo)) { return _T("val"); } virtual bool HasClearButton() { return FALSE; } - virtual bool IsPresent(const PropertyInfo& pinfo) { return FALSE; } + virtual bool IsPresent(const PropertyInfo& WXUNUSED(pinfo)) { return FALSE; } protected: diff --git a/contrib/utils/wxrcedit/pe_basic.h b/contrib/utils/wxrcedit/pe_basic.h index 10ed202739..5dff7dde76 100644 --- a/contrib/utils/wxrcedit/pe_basic.h +++ b/contrib/utils/wxrcedit/pe_basic.h @@ -26,7 +26,7 @@ class PropEditCtrlNull : public PropEditCtrl PropEditCtrlNull(PropertiesFrame *propFrame) : PropEditCtrl(propFrame) {} - virtual void BeginEdit(const wxRect& rect, wxTreeItemId ti) {} + virtual void BeginEdit(const wxRect& WXUNUSED(rect), wxTreeItemId WXUNUSED(ti)) {} virtual void EndEdit() {} virtual wxWindow* CreateEditCtrl() {return NULL;} diff --git a/demos/dbbrowse/browsedb.cpp b/demos/dbbrowse/browsedb.cpp index 9583c776b1..f5ee9c86f6 100644 --- a/demos/dbbrowse/browsedb.cpp +++ b/demos/dbbrowse/browsedb.cpp @@ -1,12 +1,12 @@ //---------------------------------------------------------------------------------------- -// Name: BrowserDB.h,cpp -// Purpose: a wxDB class -// Author: Mark Johnson +// Name: BrowserDB.h,cpp +// Purpose: a wxDB class +// Author: Mark Johnson // Modified by: -// Created: 19991127.mj10777 -// Copyright: (c) Mark Johnson -// Licence: wxWindows license -// RCS-ID: $Id$ +// Created: 19991127.mj10777 +// Copyright: (c) Mark Johnson +// Licence: wxWindows license +// RCS-ID: $Id$ //---------------------------------------------------------------------------------------- //-- 1) //---------------------------------------------------------------------------------------- @@ -38,7 +38,7 @@ wxDbConnectInf DbConnectInf; #endif //---------------------------------------------------------------------------------------- -extern WXDLLEXPORT_DATA(wxDbList*) PtrBegDbList; /* from db.cpp, used in getting back error results from db connections */ +extern WXDLLEXPORT_DATA(wxDbList*) PtrBegDbList; /* from db.cpp, used in getting back error results from db connections */ //---------------------------------------------------------------------------------------- wxChar *GetExtendedDBErrorMsg(wxChar *ErrFile, int ErrLine) @@ -127,8 +127,8 @@ bool BrowserDB::OnStartDB(int Quiet) //--------------------------------------------------------------------------------------- DlgUser *p_Dlg; p_Dlg = new DlgUser(pDoc->p_MainFrame,pDoc,_T("")); - p_Dlg->s_DSN = ODBCSource; - p_Dlg->s_User = UserName; + p_Dlg->s_DSN = ODBCSource; + p_Dlg->s_User = UserName; p_Dlg->s_Password = Password; p_Dlg->OnInit(); p_Dlg->Fit(); @@ -146,9 +146,9 @@ bool BrowserDB::OnStartDB(int Quiet) if (OK) { //-------------------------------------------------------------------------------------- - DbConnectInf.SetDsn(ODBCSource); // ODBC data source name (created with ODBC Administrator under Win95/NT) - DbConnectInf.SetUserID(UserName); // database username - must already exist in the data source - DbConnectInf.SetPassword(Password); // password database username + DbConnectInf.SetDsn(ODBCSource); // ODBC data source name (created with ODBC Administrator under Win95/NT) + DbConnectInf.SetUserID(UserName); // database username - must already exist in the data source + DbConnectInf.SetPassword(Password); // password database username db_BrowserDB = wxDbGetConnection(&DbConnectInf); // wxLogMessage(">>>%s<<<>>>%s<<<",UserName.c_str(),Password.c_str()); if (db_BrowserDB == NULL) @@ -204,12 +204,11 @@ bool BrowserDB::OnCloseDB(int Quiet) bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet)) { SDWORD cb; - int i_dbDataType; - int i=0; + int i_dbDataType; wxChar s_temp[1024+1]; - long l_temp; - double f_temp; - int AnzError=0; + long l_temp; + double f_temp; + int AnzError=0; TIMESTAMP_STRUCT t_temp; wxString Temp0; //----------------------------- @@ -225,14 +224,15 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet)) } else { + int i; for (i=0;itableName,_T("-E->")); i_dbDataType = (cl_BrowserDB+i)->pColFor->i_dbDataType; - if (i_dbDataType == 0) // Filter unsupported dbDataTypes + if (i_dbDataType == 0) // Filter unsupported dbDataTypes { if (((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_VARCHAR) || - ((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_LONGVARCHAR)) + ((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_LONGVARCHAR)) i_dbDataType = DB_DATA_TYPE_VARCHAR; if ((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_C_DATE) i_dbDataType = DB_DATA_TYPE_DATE; @@ -244,8 +244,8 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet)) i_dbDataType = DB_DATA_TYPE_FLOAT; } if ((i_dbDataType == DB_DATA_TYPE_INTEGER) && - ((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_C_DOUBLE)) - { // DBASE Numeric + ((cl_BrowserDB+i)->pColFor->i_sqlDataType == SQL_C_DOUBLE)) + { // DBASE Numeric i_dbDataType = DB_DATA_TYPE_FLOAT; } switch(i_dbDataType) @@ -298,8 +298,8 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet)) else { // i_Nation = 0 = timestamp , 1=EU, 2=UK, 3=International, 4=US - if (((cl_BrowserDB+i)->pColFor->i_Nation == 0) || // TS YYYY-MM-DD - ((cl_BrowserDB+i)->pColFor->i_Nation == 3)) // IT YYYY-MM-DD + if (((cl_BrowserDB+i)->pColFor->i_Nation == 0) || // TS YYYY-MM-DD + ((cl_BrowserDB+i)->pColFor->i_Nation == 3)) // IT YYYY-MM-DD { Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,t_temp.year,t_temp.month,t_temp.day, t_temp.hour, t_temp.minute, t_temp.second, t_temp.fraction); @@ -312,7 +312,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet)) t_temp.hour, t_temp.minute, t_temp.second, t_temp.fraction); wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str()); } - if ((cl_BrowserDB+i)->pColFor->i_Nation == 3) // US MM/DD/YYYY + if ((cl_BrowserDB+i)->pColFor->i_Nation == 3) // US MM/DD/YYYY { Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,t_temp.month,t_temp.day,t_temp.year, t_temp.hour, t_temp.minute, t_temp.second, t_temp.fraction); @@ -452,10 +452,10 @@ void BrowserDB::PointerToNULL(int Art) delete db_BrowserDB; } } - cl_BrowserDB = NULL; - ct_BrowserDB = NULL; - db_BrowserDB = NULL; - p_LogWindow = NULL; + cl_BrowserDB = NULL; + ct_BrowserDB = NULL; + db_BrowserDB = NULL; + p_LogWindow = NULL; } //---------------------------------------------------------------------------------------- diff --git a/demos/dbbrowse/tabpgwin.h b/demos/dbbrowse/tabpgwin.h index da008ddefc..f6f63e74e1 100644 --- a/demos/dbbrowse/tabpgwin.h +++ b/demos/dbbrowse/tabpgwin.h @@ -89,7 +89,7 @@ public: // notifications (can be handled by derivatives) - virtual void OnTabAdded( twTabInfo* pInfo ) {} + virtual void OnTabAdded( twTabInfo* WXUNUSED(pInfo) ) {} virtual void SizeTabs(int x,int y, int width, int height, bool repant); diff --git a/demos/life/game.cpp b/demos/life/game.cpp index a8be0b96e8..5b7e6ce79a 100644 --- a/demos/life/game.cpp +++ b/demos/life/game.cpp @@ -75,9 +75,9 @@ public: bool LifeCellBox::IsAlive(int dx, int dy) const { if (dy > 3) - return (m_live2 & 1 << ((dy - 4) * 8 + dx)); + return (bool)(m_live2 & 1 << ((dy - 4) * 8 + dx)); else - return (m_live1 & 1 << ((dy) * 8 + dx)); + return (bool)(m_live1 & 1 << ((dy) * 8 + dx)); } // SetCell: diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index 6790045247..7c707d4928 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -82,7 +82,7 @@ class URLDropTarget : public wxDropTarget public: URLDropTarget() { SetDataObject(new wxURLDataObject); } - void OnDropURL(wxCoord x, wxCoord y, const wxString& text) + void OnDropURL(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxString& text) { // of course, a real program would do something more useful here... wxMessageBox(text, _T("wxDnD sample: got URL"), @@ -91,7 +91,7 @@ public: // URLs can't be moved, only copied virtual wxDragResult OnDragOver(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), - wxDragResult def) + wxDragResult WXUNUSED(def)) { return wxDragLink; // At least IE 5.x needs wxDragLink, the // other browsers on MSW seem okay with it too. @@ -144,7 +144,7 @@ public: Refresh(); } - void OnPaint(wxPaintEvent& event) + void OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); @@ -613,7 +613,7 @@ public: } virtual bool SetData(const wxDataFormat& format, - size_t len, const void *buf) + size_t WXUNUSED(len), const void *buf) { wxCHECK_MSG( format == m_formatShape, false, wxT( "unsupported format") ); diff --git a/samples/font/font.cpp b/samples/font/font.cpp index 047299d82a..10242436c9 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -86,8 +86,8 @@ public: void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); - void OnIncFont(wxCommandEvent& event) { DoResizeFont(+2); } - void OnDecFont(wxCommandEvent& event) { DoResizeFont(-2); } + void OnIncFont(wxCommandEvent& WXUNUSED(event)) { DoResizeFont(+2); } + void OnDecFont(wxCommandEvent& WXUNUSED(event)) { DoResizeFont(-2); } void OnBold(wxCommandEvent& event); void OnItalic(wxCommandEvent& event); diff --git a/samples/keyboard/keyboard.cpp b/samples/keyboard/keyboard.cpp index ae4b8022e5..54ef746ff4 100644 --- a/samples/keyboard/keyboard.cpp +++ b/samples/keyboard/keyboard.cpp @@ -112,7 +112,7 @@ private: } } - virtual void DoLogString(const wxChar *szString, time_t t) + virtual void DoLogString(const wxChar *szString, time_t WXUNUSED(t)) { wxString msg; TimeStamp(&msg); @@ -154,7 +154,7 @@ protected: void OnKeyUp(wxKeyEvent& event) { LogEvent(_T("Key up"), event); } void OnChar(wxKeyEvent& event) { LogEvent(_T("Char"), event); } - void OnPaint(wxPaintEvent& event) + void OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); dc.SetTextForeground(*wxWHITE); diff --git a/samples/listbox/lboxtest.cpp b/samples/listbox/lboxtest.cpp index df14dbd815..0737d53278 100644 --- a/samples/listbox/lboxtest.cpp +++ b/samples/listbox/lboxtest.cpp @@ -228,7 +228,7 @@ private: } } - virtual void DoLogString(const wxChar *szString, time_t t) + virtual void DoLogString(const wxChar *szString, time_t WXUNUSED(t)) { wxString msg; TimeStamp(&msg); @@ -526,7 +526,7 @@ void LboxTestFrame::CreateLbox() items.Add(m_lbox->GetString(n)); } - m_sizerLbox->Remove(m_lbox); + m_sizerLbox->Detach(m_lbox); delete m_lbox; } diff --git a/samples/statbar/statbar.cpp b/samples/statbar/statbar.cpp index 35ce571e4b..35c057296e 100644 --- a/samples/statbar/statbar.cpp +++ b/samples/statbar/statbar.cpp @@ -96,7 +96,7 @@ public: void UpdateClock(); // event handlers - void OnTimer(wxTimerEvent& event) { UpdateClock(); } + void OnTimer(wxTimerEvent& WXUNUSED(event)) { UpdateClock(); } void OnSize(wxSizeEvent& event); void OnToggleClock(wxCommandEvent& event); void OnButton(wxCommandEvent& event); diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index bbe8ce47c5..d9b2c4afff 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -989,7 +989,7 @@ wxSize wxXmlResourceHandler::GetSize(const wxString& param) wxString s = GetParamValue(param); if (s.IsEmpty()) s = wxT("-1,-1"); bool is_dlg; - long sx, sy; + long sx, sy = 0; is_dlg = s[s.Length()-1] == wxT('d'); if (is_dlg) s.RemoveLast(); -- 2.45.2