From: David Webster Date: Sun, 20 Mar 2005 18:51:53 +0000 (+0000) Subject: Fixes compile warnings X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0d598bae33dff0e48eebd569aa3d75e95e8d6947 Fixes compile warnings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32938 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/os2/accel.cpp b/src/os2/accel.cpp index e21a611fe0..044c1b28d4 100644 --- a/src/os2/accel.cpp +++ b/src/os2/accel.cpp @@ -203,10 +203,6 @@ bool wxAcceleratorTable::Translate( ,GetHaccel() ,pMsg ); - if (rc) - { - int x = 1; - } return (Ok() && rc); } // end of wxAcceleratorTable::Translate diff --git a/src/os2/bmpbuttn.cpp b/src/os2/bmpbuttn.cpp index 6697e119b7..f30e54aa7e 100644 --- a/src/os2/bmpbuttn.cpp +++ b/src/os2/bmpbuttn.cpp @@ -111,7 +111,6 @@ bool wxBitmapButton::OS2OnDraw( return FALSE; wxBitmap* pBitmap; - RECTL vRect; bool bIsSelected = pUser->fsState & BDS_HILITED; wxClientDC vDc(this); @@ -132,7 +131,6 @@ bool wxBitmapButton::OS2OnDraw( // Centre the bitmap in the control area // int nX = 0; - int nY = 0; int nX1 = 0; int nY1 = 0; int nWidth = vDc.m_vRclPaint.xRight - vDc.m_vRclPaint.xLeft; diff --git a/src/os2/button.cpp b/src/os2/button.cpp index 05a44eb6cc..d75aa8258a 100644 --- a/src/os2/button.cpp +++ b/src/os2/button.cpp @@ -141,6 +141,7 @@ wxSize wxButton::DoGetBestSize() const int nWidthButton; int nWidthChar; int nHeightChar; + wxFont vFont = (wxFont)GetFont(); GetTextExtent( rsLabel ,&nWidthButton @@ -150,7 +151,7 @@ wxSize wxButton::DoGetBestSize() const wxGetCharSize( GetHWND() ,&nWidthChar ,&nHeightChar - ,(wxFont*)&GetFont() + ,&vFont ); // diff --git a/src/os2/choice.cpp b/src/os2/choice.cpp index 5e4d3e4ad2..9e4e5e1378 100644 --- a/src/os2/choice.cpp +++ b/src/os2/choice.cpp @@ -360,6 +360,7 @@ wxSize wxChoice::DoGetBestSize() const int nItems = GetCount(); int nCx; int nCy; + wxFont vFont = (wxFont)GetFont(); for (int i = 0; i < nItems; i++) { @@ -386,7 +387,7 @@ wxSize wxChoice::DoGetBestSize() const wxGetCharSize( GetHWND() ,&nCx ,&nCy - ,(wxFont*)&GetFont() + ,&vFont ); nChoiceWidth += 5 * nCx; diff --git a/src/os2/fontutil.cpp b/src/os2/fontutil.cpp index a1347e8a8e..264d0b7b2d 100644 --- a/src/os2/fontutil.cpp +++ b/src/os2/fontutil.cpp @@ -413,7 +413,7 @@ void wxFillLogFont( } if (*pflId == 0L) *pflId = 1L; - for(unsigned long LCNum = 0; LCNum < lNumLids; LCNum++) + for(unsigned long LCNum = 0; LCNum < (unsigned long)lNumLids; LCNum++) if(alIds[LCNum] == *pflId) ++*pflId; if(*pflId > 254) // wow, no id available! diff --git a/src/os2/listbox.cpp b/src/os2/listbox.cpp index 350cea8f68..1d49e7c601 100644 --- a/src/os2/listbox.cpp +++ b/src/os2/listbox.cpp @@ -725,6 +725,7 @@ wxSize wxListBox::DoGetBestSize() const int nListbox = 0; int nCx; int nCy; + wxFont vFont = (wxFont)GetFont(); for (int i = 0; i < m_nNumItems; i++) { @@ -751,7 +752,7 @@ wxSize wxListBox::DoGetBestSize() const wxGetCharSize( GetHWND() ,&nCx ,&nCy - ,(wxFont*)&GetFont() + ,&vFont ); nListbox += 3 * nCx; diff --git a/src/os2/notebook.cpp b/src/os2/notebook.cpp index ff60f14a89..f792c76a60 100644 --- a/src/os2/notebook.cpp +++ b/src/os2/notebook.cpp @@ -319,12 +319,12 @@ bool wxNotebook::SetPageImage ( , int nImage ) { - wxBitmap* pBitmap = (wxBitmap*)m_imageList->GetBitmap(nImage); + wxBitmap vBitmap = (wxBitmap)m_imageList->GetBitmap(nImage); return (bool)::WinSendMsg( GetHWND() ,BKM_SETTABBITMAP ,MPFROMLONG((ULONG)m_alPageId[nPage]) - ,(MPARAM)pBitmap->GetHBITMAP() + ,(MPARAM)vBitmap.GetHBITMAP() ); } // end of wxNotebook::SetPageImage diff --git a/src/os2/popupwin.cpp b/src/os2/popupwin.cpp index b96c22d2a5..3592101960 100644 --- a/src/os2/popupwin.cpp +++ b/src/os2/popupwin.cpp @@ -30,8 +30,6 @@ #include "wx/popupwin.h" -IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow) - // ============================================================================ // implementation // ============================================================================ diff --git a/src/os2/spinbutt.cpp b/src/os2/spinbutt.cpp index 0bd30bf97c..3b292128b0 100644 --- a/src/os2/spinbutt.cpp +++ b/src/os2/spinbutt.cpp @@ -32,7 +32,6 @@ extern void wxAssociateWinWithHandle( HWND hWnd ,wxWindowOS2* pWin ); -static WXFARPROC fnWndProcSpinCtrl = (WXFARPROC)NULL; IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent) diff --git a/src/os2/spinctrl.cpp b/src/os2/spinctrl.cpp index 5328a895ea..7a05daa635 100644 --- a/src/os2/spinctrl.cpp +++ b/src/os2/spinctrl.cpp @@ -214,13 +214,14 @@ wxSize wxSpinCtrl::DoGetBestSize() const { wxSize vSizeBtn = wxSpinButton::DoGetBestSize(); int nHeight; + wxFont vFont = (wxFont)GetFont(); vSizeBtn.x += DEFAULT_ITEM_WIDTH + MARGIN_BETWEEN; wxGetCharSize( GetHWND() ,NULL ,&nHeight - ,(wxFont*)&GetFont() + ,&vFont ); nHeight = EDIT_HEIGHT_FROM_CHAR_HEIGHT(nHeight); diff --git a/src/os2/textctrl.cpp b/src/os2/textctrl.cpp index be45467059..d315a58b5c 100644 --- a/src/os2/textctrl.cpp +++ b/src/os2/textctrl.cpp @@ -1188,8 +1188,9 @@ wxSize wxTextCtrl::DoGetBestSize() const { int nCx; int nCy; + wxFont vFont = (wxFont)GetFont(); - wxGetCharSize(GetHWND(), &nCx, &nCy, (wxFont*)&GetFont()); + wxGetCharSize(GetHWND(), &nCx, &nCy, &vFont); int wText = DEFAULT_ITEM_WIDTH; int hText = (int)(EDIT_HEIGHT_FROM_CHAR_HEIGHT(nCy) * .8); diff --git a/src/os2/treectrl.cpp b/src/os2/treectrl.cpp index b043d61c7c..f80fcfc47a 100644 --- a/src/os2/treectrl.cpp +++ b/src/os2/treectrl.cpp @@ -210,7 +210,7 @@ public: { return true; } - PMYRECORD pRecord = FindOS2TreeRecordByID( GetTree()->GetHWND() + PMYRECORD pRecord = FindOS2TreeRecordByID( (HWND)GetTree()->GetHWND() ,rItem.m_pItem ); if (pRecord->m_vRecord.flRecordAttr & CRA_SELECTED) diff --git a/src/os2/utils.cpp b/src/os2/utils.cpp index dad072f6ab..1ee5362ef4 100644 --- a/src/os2/utils.cpp +++ b/src/os2/utils.cpp @@ -220,12 +220,12 @@ wxBatteryState wxGetBatteryState() wxMemorySize wxGetFreeMemory() { void* pMemptr = NULL; - ULONG lSize; + LONG lSize; ULONG lMemFlags; APIRET rc; lMemFlags = PAG_FREE; - rc = ::DosQueryMem(pMemptr, &lSize, &lMemFlags); + rc = ::DosQueryMem(pMemptr, (PULONG)&lSize, &lMemFlags); if (rc != 0) lSize = -1L; return (wxMemorySize)lSize;