From 34a0c9f4c1b3444737ff145721e03ecaee6af4b2 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Thu, 21 Aug 2003 22:00:12 +0000 Subject: [PATCH] Warning fixes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23082 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/mdig.cpp | 10 +++++----- src/msw/notebook.cpp | 12 ++++++------ src/univ/notebook.cpp | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/generic/mdig.cpp b/src/generic/mdig.cpp index 3c217b805e..3a2c74d4d2 100644 --- a/src/generic/mdig.cpp +++ b/src/generic/mdig.cpp @@ -258,7 +258,7 @@ void wxGenericMDIParentFrame::ActivateNext() { if (m_pClientWindow && m_pClientWindow->GetSelection() != -1) { - int active = m_pClientWindow->GetSelection() + 1; + size_t active = m_pClientWindow->GetSelection() + 1; if (active >= m_pClientWindow->GetPageCount()) active = 0; @@ -419,7 +419,7 @@ wxGenericMDIChildFrame::~wxGenericMDIChildFrame() wxGenericMDIClientWindow *pClientWindow = pParentFrame->GetClientWindow(); // Remove page if still there - int pos; + size_t pos; for (pos = 0; pos < pClientWindow->GetPageCount(); pos++) { if (pClientWindow->GetPage(pos) == this) @@ -518,7 +518,7 @@ void wxGenericMDIChildFrame::SetTitle(const wxString& title) if (pClientWindow != NULL) { - int pos; + size_t pos; for (pos = 0; pos < pClientWindow->GetPageCount(); pos++) { if (pClientWindow->GetPage(pos) == this) @@ -546,7 +546,7 @@ void wxGenericMDIChildFrame::Activate() if (pClientWindow != NULL) { - int pos; + size_t pos; for (pos = 0; pos < pClientWindow->GetPageCount(); pos++) { if (pClientWindow->GetPage(pos) == this) @@ -783,7 +783,7 @@ void wxGenericMDIClientWindow::OnSize(wxSizeEvent& event) { wxNotebook::OnSize(event); - int pos; + size_t pos; for (pos = 0; pos < GetPageCount(); pos++) { ((wxGenericMDIChildFrame *)GetPage(pos))->ApplyMDIChildFrameRect(); diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index c5c3aff114..e0b47ea855 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -181,10 +181,10 @@ const wxNotebookPageInfoList& wxNotebook::GetPageInfos() const { wxNotebookPageInfoList* list = const_cast< wxNotebookPageInfoList* >( &m_pageInfos ) ; WX_CLEAR_LIST( wxNotebookPageInfoList , *list ) ; - for( int i = 0 ; i < GetPageCount() ; ++i ) + for( size_t i = 0 ; i < GetPageCount() ; ++i ) { wxNotebookPageInfo *info = new wxNotebookPageInfo() ; - info->Create( const_cast(this)->GetPage(i) , GetPageText(i) , GetSelection() == i , GetPageImage(i) ) ; + info->Create( const_cast(this)->GetPage(i) , GetPageText(i) , GetSelection() == int(i) , GetPageImage(i) ) ; list->Append( info ) ; } return m_pageInfos ; @@ -300,7 +300,7 @@ int wxNotebook::SetSelection(size_t nPage) { wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") ); - if ( nPage != m_nSelection ) + if ( int(nPage) != m_nSelection ) { wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId); event.SetSelection(nPage); @@ -473,12 +473,12 @@ wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage) { // change the selected page if it was deleted or became invalid int selNew; - if ( m_nSelection == GetPageCount() ) + if ( m_nSelection == int(GetPageCount()) ) { // last page deleted, make the new last page the new selection selNew = m_nSelection - 1; } - else if ( nPage <= m_nSelection ) + else if ( int(nPage) <= m_nSelection ) { // we must show another page, even if it has the same index selNew = m_nSelection; @@ -619,7 +619,7 @@ bool wxNotebook::InsertPage(size_t nPage, // if the inserted page is before the selected one, we must update the // index of the selected page - if ( nPage <= m_nSelection ) + if ( int(nPage) <= m_nSelection ) { // one extra page added m_nSelection++; diff --git a/src/univ/notebook.cpp b/src/univ/notebook.cpp index cb5bfd045b..408034a35e 100644 --- a/src/univ/notebook.cpp +++ b/src/univ/notebook.cpp @@ -40,7 +40,7 @@ // macros // ---------------------------------------------------------------------------- -#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount())) +#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((size_t(nPage)) < GetPageCount())) // ---------------------------------------------------------------------------- // constants @@ -381,7 +381,7 @@ wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage) UpdateSpinBtn(); } - int count = GetPageCount(); + size_t count = GetPageCount(); if ( count ) { if ( m_sel == (size_t)nPage ) -- 2.45.2