X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/61fef19b852d426f5b00b60de083539b9ba0f76c..d5e64615977c6839abe565919e8da50ffda40604:/src/univ/notebook.cpp diff --git a/src/univ/notebook.cpp b/src/univ/notebook.cpp index 9e5116fe85..68e2ec2e23 100644 --- a/src/univ/notebook.cpp +++ b/src/univ/notebook.cpp @@ -17,10 +17,14 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "univnotebook.h" #endif +#ifdef __VMS +#pragma message disable unscomzer +#endif + #include "wx/wxprec.h" #ifdef __BORLANDC__ @@ -40,7 +44,12 @@ // macros // ---------------------------------------------------------------------------- -#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount())) +#if 0 +// due to unsigned type nPage is always >= 0 +#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((size_t(nPage)) < GetPageCount())) +#else +#define IS_VALID_PAGE(nPage) ((size_t(nPage)) < GetPageCount()) +#endif // ---------------------------------------------------------------------------- // constants @@ -133,14 +142,14 @@ bool wxNotebook::Create(wxWindow *parent, // wxNotebook page titles and images // ---------------------------------------------------------------------------- -wxString wxNotebook::GetPageText(int nPage) const +wxString wxNotebook::GetPageText(size_t nPage) const { wxCHECK_MSG( IS_VALID_PAGE(nPage), _T(""), _T("invalid notebook page") ); return m_titles[nPage]; } -bool wxNotebook::SetPageText(int nPage, const wxString& strText) +bool wxNotebook::SetPageText(size_t nPage, const wxString& strText) { wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page") ); @@ -163,14 +172,14 @@ bool wxNotebook::SetPageText(int nPage, const wxString& strText) return TRUE; } -int wxNotebook::GetPageImage(int nPage) const +int wxNotebook::GetPageImage(size_t nPage) const { wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("invalid notebook page") ); return m_images[nPage]; } -bool wxNotebook::SetPageImage(int nPage, int nImage) +bool wxNotebook::SetPageImage(size_t nPage, int nImage) { wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page") ); @@ -202,7 +211,7 @@ wxNotebook::~wxNotebook() // wxNotebook page switching // ---------------------------------------------------------------------------- -int wxNotebook::SetSelection(int nPage) +int wxNotebook::SetSelection(size_t nPage) { wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("invalid notebook page") ); @@ -277,13 +286,13 @@ int wxNotebook::SetSelection(int nPage) // wxNotebook pages adding/deleting // ---------------------------------------------------------------------------- -bool wxNotebook::InsertPage(int nPage, +bool wxNotebook::InsertPage(size_t nPage, wxNotebookPage *pPage, const wxString& strText, bool bSelect, int imageId) { - int nPages = GetPageCount(); + size_t nPages = GetPageCount(); wxCHECK_MSG( nPage == nPages || IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page in InsertPage()") ); @@ -360,7 +369,7 @@ bool wxNotebook::DeleteAllPages() return TRUE; } -wxNotebookPage *wxNotebook::DoRemovePage(int nPage) +wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage) { wxCHECK_MSG( IS_VALID_PAGE(nPage), NULL, _T("invalid notebook page") ); @@ -381,7 +390,7 @@ wxNotebookPage *wxNotebook::DoRemovePage(int nPage) UpdateSpinBtn(); } - int count = GetPageCount(); + size_t count = GetPageCount(); if ( count ) { if ( m_sel == (size_t)nPage )