From b143cf708ba5e419de4c3d0b03640eedb6b926d1 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Mon, 2 Oct 2006 05:36:31 +0000 Subject: [PATCH] 64-bit warning fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41547 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/aui/auidemo.cpp | 2 +- samples/event/event.cpp | 4 ++-- samples/htlbox/htlbox.cpp | 4 ++-- samples/listbox/lboxtest.cpp | 4 ++-- samples/listctrl/listtest.cpp | 2 +- samples/multimon/multimon_test.cpp | 10 ++++------ samples/popup/popup.cpp | 2 +- samples/scroll/scroll.cpp | 4 ++-- samples/thread/thread.cpp | 10 +++++----- samples/treectrl/treetest.cpp | 10 +++++----- samples/widgets/notebook.cpp | 2 +- 11 files changed, 26 insertions(+), 28 deletions(-) diff --git a/samples/aui/auidemo.cpp b/samples/aui/auidemo.cpp index 418605c641..189b6aa2f2 100644 --- a/samples/aui/auidemo.cpp +++ b/samples/aui/auidemo.cpp @@ -1009,7 +1009,7 @@ void MyFrame::OnCreatePerspective(wxCommandEvent& WXUNUSED(event)) wxTextEntryDialog dlg(this, wxT("Enter a name for the new perspective:"), wxT("wxAUI Test")); - dlg.SetValue(wxString::Format(wxT("Perspective %d"), m_perspectives.GetCount()+1)); + dlg.SetValue(wxString::Format(wxT("Perspective %u"), unsigned(m_perspectives.GetCount() + 1))); if (dlg.ShowModal() != wxID_OK) return; diff --git a/samples/event/event.cpp b/samples/event/event.cpp index 4e9dc8798c..a0647391ae 100644 --- a/samples/event/event.cpp +++ b/samples/event/event.cpp @@ -97,7 +97,7 @@ public: protected: // number of pushed event handlers - size_t m_nPush; + unsigned m_nPush; private: // any class wishing to process wxWidgets events must use this macro @@ -120,7 +120,7 @@ public: } private: - size_t m_level; + unsigned m_level; DECLARE_EVENT_TABLE() }; diff --git a/samples/htlbox/htlbox.cpp b/samples/htlbox/htlbox.cpp index a1f9757624..f0b76886b1 100644 --- a/samples/htlbox/htlbox.cpp +++ b/samples/htlbox/htlbox.cpp @@ -125,7 +125,7 @@ public: void OnLboxSelect(wxCommandEvent& event); void OnLboxDClick(wxCommandEvent& event) { - wxLogMessage(_T("Listbox item %ld double clicked."), event.GetInt()); + wxLogMessage(_T("Listbox item %d double clicked."), event.GetInt()); } private: @@ -386,7 +386,7 @@ void MyFrame::OnSetSelFgCol(wxCommandEvent& event) void MyFrame::OnLboxSelect(wxCommandEvent& event) { - wxLogMessage(_T("Listbox selection is now %ld."), event.GetInt()); + wxLogMessage(_T("Listbox selection is now %d."), event.GetInt()); if ( m_hlbox->HasMultipleSelection() ) { diff --git a/samples/listbox/lboxtest.cpp b/samples/listbox/lboxtest.cpp index 8e67ca7083..d5dd01608f 100644 --- a/samples/listbox/lboxtest.cpp +++ b/samples/listbox/lboxtest.cpp @@ -647,7 +647,7 @@ void LboxTestFrame::OnButtonClearLog(wxCommandEvent& WXUNUSED(event)) void LboxTestFrame::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) { - static size_t s_item = 0; + static unsigned s_item = 0; wxString s = m_textAdd->GetValue(); if ( !m_textAdd->IsModified() ) @@ -662,7 +662,7 @@ void LboxTestFrame::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) void LboxTestFrame::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) { // "many" means 1000 here - for ( size_t n = 0; n < 1000; n++ ) + for ( unsigned n = 0; n < 1000; n++ ) { m_lbox->Append(wxString::Format(_T("item #%u"), n)); } diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index dd09aa34cc..9f9a2df9d8 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -706,7 +706,7 @@ void MyFrame::OnDeleteAll(wxCommandEvent& WXUNUSED(event)) { wxStopWatch sw; - size_t itemCount = m_listCtrl->GetItemCount(); + int itemCount = m_listCtrl->GetItemCount(); m_listCtrl->DeleteAllItems(); diff --git a/samples/multimon/multimon_test.cpp b/samples/multimon/multimon_test.cpp index 8557897355..f279ac7559 100644 --- a/samples/multimon/multimon_test.cpp +++ b/samples/multimon/multimon_test.cpp @@ -36,17 +36,15 @@ bool TestApp::OnInit() #if wxUSE_DISPLAY else { - size_t count = wxDisplay::GetCount(); - wxLogDebug ( _T("I detected %i display(s) on your system"), count ); - size_t i = 0; - while ( i < count ) + unsigned count = wxDisplay::GetCount(); + wxLogDebug ( _T("I detected %u display(s) on your system"), count ); + for (unsigned i = 0; i < count; i++) { wxDisplay display ( i ); wxRect r = display.GetGeometry(); - wxLogDebug ( _T("Display #%i \"%s\" = ( %i, %i, %i, %i ) @ %i bits"), + wxLogDebug ( _T("Display #%u \"%s\" = ( %i, %i, %i, %i ) @ %i bits"), i, display.GetName().c_str(), r.GetLeft(), r.GetTop(), r.GetWidth(), r.GetHeight(), display.GetCurrentMode().GetDepth() ); - i++; } } #endif diff --git a/samples/popup/popup.cpp b/samples/popup/popup.cpp index 8f5c2188b1..a1ae9ed6ca 100644 --- a/samples/popup/popup.cpp +++ b/samples/popup/popup.cpp @@ -229,7 +229,7 @@ void SimpleTransientPopup::OnButton(wxCommandEvent& event) void SimpleTransientPopup::OnSpinCtrl(wxSpinEvent& event) { - wxLogMessage( wxT("0x%lx SimpleTransientPopup::OnSpinCtrl ID %d Value %ld"), long(this), event.GetId(), event.GetInt()); + wxLogMessage( wxT("0x%lx SimpleTransientPopup::OnSpinCtrl ID %d Value %d"), long(this), event.GetId(), event.GetInt()); event.Skip(); } diff --git a/samples/scroll/scroll.cpp b/samples/scroll/scroll.cpp index 7e42ebf2c6..098c34f1ea 100644 --- a/samples/scroll/scroll.cpp +++ b/samples/scroll/scroll.cpp @@ -698,7 +698,7 @@ void MyScrolledWindowDumb::OnDraw(wxDC& dc) CalcScrolledPosition(0, y, NULL, &yPhys); dc.DrawText(wxString::Format(_T("Line %u (logical %d, physical %d)"), - line, y, yPhys), 0, y); + unsigned(line), y, yPhys), 0, y); y += m_hLine; } } @@ -727,7 +727,7 @@ void MyScrolledWindowSmart::OnDraw(wxDC& dc) CalcScrolledPosition(0, y, NULL, &yPhys); dc.DrawText(wxString::Format(_T("Line %u (logical %d, physical %d)"), - line, y, yPhys), 0, y); + unsigned(line), y, yPhys), 0, y); y += m_hLine; } } diff --git a/samples/thread/thread.cpp b/samples/thread/thread.cpp index 248b3dee44..c93424a99f 100644 --- a/samples/thread/thread.cpp +++ b/samples/thread/thread.cpp @@ -173,7 +173,7 @@ public: void WriteText(const wxString& text); public: - size_t m_count; + unsigned m_count; MyFrame *m_frame; }; @@ -266,7 +266,7 @@ public: public: MyFrame *m_frame; - size_t m_count; + unsigned m_count; }; MyWorkerThread::MyWorkerThread(MyFrame *frame) @@ -494,7 +494,7 @@ MyThread *MyFrame::CreateThread() void MyFrame::OnStartThreads(wxCommandEvent& WXUNUSED(event) ) { - static long s_num = 10; + static long s_num; s_num = wxGetNumberFromUser(_T("How many threads to start: "), _T(""), _T("wxThread sample"), s_num, 1, 10000, this); @@ -505,7 +505,7 @@ void MyFrame::OnStartThreads(wxCommandEvent& WXUNUSED(event) ) return; } - size_t count = (size_t)s_num, n; + unsigned count = unsigned(s_num), n; wxArrayThread threads; @@ -647,7 +647,7 @@ void MyFrame::OnIdle(wxIdleEvent& event) m_nRunning = nRunning; m_nCount = nCount; - wxLogStatus(this, wxT("%u threads total, %u running."), nCount, nRunning); + wxLogStatus(this, wxT("%u threads total, %u running."), unsigned(nCount), unsigned(nRunning)); } //else: avoid flicker - don't print anything diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index fbd1ace563..1028d79f66 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -477,7 +477,7 @@ void MyFrame::OnDumpSelected(wxCommandEvent& WXUNUSED(event)) wxArrayTreeItemIds array; size_t count = m_treeCtrl->GetSelections(array); - wxLogMessage(wxT("%u items selected"), count); + wxLogMessage(wxT("%u items selected"), unsigned(count)); for ( size_t n = 0; n < count; n++ ) { @@ -790,9 +790,9 @@ void MyTreeCtrl::AddItemsRecursively(const wxTreeItemId& idParent, { // at depth 1 elements won't have any more children if ( hasChildren ) - str.Printf(wxT("%s child %d"), wxT("Folder"), n + 1); + str.Printf(wxT("%s child %u"), wxT("Folder"), unsigned(n + 1)); else - str.Printf(wxT("%s child %d.%d"), wxT("File"), folder, n + 1); + str.Printf(wxT("%s child %u.%u"), wxT("File"), unsigned(folder), unsigned(n + 1)); // here we pass to AppendItem() normal and selected item images (we // suppose that selected image follows the normal one in the enum) @@ -1288,6 +1288,6 @@ void MyTreeItemData::ShowInfo(wxTreeCtrl *tree) Bool2String(tree->IsSelected(GetId())), Bool2String(tree->IsExpanded(GetId())), Bool2String(tree->IsBold(GetId())), - tree->GetChildrenCount(GetId()), - tree->GetChildrenCount(GetId(), false)); + unsigned(tree->GetChildrenCount(GetId())), + unsigned(tree->GetChildrenCount(GetId(), false))); } diff --git a/samples/widgets/notebook.cpp b/samples/widgets/notebook.cpp index 0bfc12be5c..74ef9c3e69 100644 --- a/samples/widgets/notebook.cpp +++ b/samples/widgets/notebook.cpp @@ -527,7 +527,7 @@ void BookWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) void BookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event) { if(m_book) - event.SetText( wxString::Format(_T("%d"), m_book->GetPageCount()) ); + event.SetText( wxString::Format(_T("%u"), unsigned(m_book->GetPageCount())) ); } void BookWidgetsPage::OnUpdateUICurSelectText(wxUpdateUIEvent& event) -- 2.47.2