64-bit warning fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41547 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2006-10-02 05:36:31 +00:00
parent 0219fd2faa
commit b143cf708b
11 changed files with 26 additions and 28 deletions

View File

@@ -1009,7 +1009,7 @@ void MyFrame::OnCreatePerspective(wxCommandEvent& WXUNUSED(event))
wxTextEntryDialog dlg(this, wxT("Enter a name for the new perspective:"), wxTextEntryDialog dlg(this, wxT("Enter a name for the new perspective:"),
wxT("wxAUI Test")); 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) if (dlg.ShowModal() != wxID_OK)
return; return;

View File

@@ -97,7 +97,7 @@ public:
protected: protected:
// number of pushed event handlers // number of pushed event handlers
size_t m_nPush; unsigned m_nPush;
private: private:
// any class wishing to process wxWidgets events must use this macro // any class wishing to process wxWidgets events must use this macro
@@ -120,7 +120,7 @@ public:
} }
private: private:
size_t m_level; unsigned m_level;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@@ -125,7 +125,7 @@ public:
void OnLboxSelect(wxCommandEvent& event); void OnLboxSelect(wxCommandEvent& event);
void OnLboxDClick(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: private:
@@ -386,7 +386,7 @@ void MyFrame::OnSetSelFgCol(wxCommandEvent& event)
void MyFrame::OnLboxSelect(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() ) if ( m_hlbox->HasMultipleSelection() )
{ {

View File

@@ -647,7 +647,7 @@ void LboxTestFrame::OnButtonClearLog(wxCommandEvent& WXUNUSED(event))
void LboxTestFrame::OnButtonAdd(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(); wxString s = m_textAdd->GetValue();
if ( !m_textAdd->IsModified() ) if ( !m_textAdd->IsModified() )
@@ -662,7 +662,7 @@ void LboxTestFrame::OnButtonAdd(wxCommandEvent& WXUNUSED(event))
void LboxTestFrame::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) void LboxTestFrame::OnButtonAddMany(wxCommandEvent& WXUNUSED(event))
{ {
// "many" means 1000 here // "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)); m_lbox->Append(wxString::Format(_T("item #%u"), n));
} }

View File

@@ -706,7 +706,7 @@ void MyFrame::OnDeleteAll(wxCommandEvent& WXUNUSED(event))
{ {
wxStopWatch sw; wxStopWatch sw;
size_t itemCount = m_listCtrl->GetItemCount(); int itemCount = m_listCtrl->GetItemCount();
m_listCtrl->DeleteAllItems(); m_listCtrl->DeleteAllItems();

View File

@@ -36,17 +36,15 @@ bool TestApp::OnInit()
#if wxUSE_DISPLAY #if wxUSE_DISPLAY
else else
{ {
size_t count = wxDisplay::GetCount(); unsigned count = wxDisplay::GetCount();
wxLogDebug ( _T("I detected %i display(s) on your system"), count ); wxLogDebug ( _T("I detected %u display(s) on your system"), count );
size_t i = 0; for (unsigned i = 0; i < count; i++)
while ( i < count )
{ {
wxDisplay display ( i ); wxDisplay display ( i );
wxRect r = display.GetGeometry(); 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(), i, display.GetName().c_str(), r.GetLeft(), r.GetTop(), r.GetWidth(), r.GetHeight(),
display.GetCurrentMode().GetDepth() ); display.GetCurrentMode().GetDepth() );
i++;
} }
} }
#endif #endif

View File

@@ -229,7 +229,7 @@ void SimpleTransientPopup::OnButton(wxCommandEvent& event)
void SimpleTransientPopup::OnSpinCtrl(wxSpinEvent& 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(); event.Skip();
} }

View File

@@ -698,7 +698,7 @@ void MyScrolledWindowDumb::OnDraw(wxDC& dc)
CalcScrolledPosition(0, y, NULL, &yPhys); CalcScrolledPosition(0, y, NULL, &yPhys);
dc.DrawText(wxString::Format(_T("Line %u (logical %d, physical %d)"), 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; y += m_hLine;
} }
} }
@@ -727,7 +727,7 @@ void MyScrolledWindowSmart::OnDraw(wxDC& dc)
CalcScrolledPosition(0, y, NULL, &yPhys); CalcScrolledPosition(0, y, NULL, &yPhys);
dc.DrawText(wxString::Format(_T("Line %u (logical %d, physical %d)"), 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; y += m_hLine;
} }
} }

View File

@@ -173,7 +173,7 @@ public:
void WriteText(const wxString& text); void WriteText(const wxString& text);
public: public:
size_t m_count; unsigned m_count;
MyFrame *m_frame; MyFrame *m_frame;
}; };
@@ -266,7 +266,7 @@ public:
public: public:
MyFrame *m_frame; MyFrame *m_frame;
size_t m_count; unsigned m_count;
}; };
MyWorkerThread::MyWorkerThread(MyFrame *frame) MyWorkerThread::MyWorkerThread(MyFrame *frame)
@@ -494,7 +494,7 @@ MyThread *MyFrame::CreateThread()
void MyFrame::OnStartThreads(wxCommandEvent& WXUNUSED(event) ) 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(""), s_num = wxGetNumberFromUser(_T("How many threads to start: "), _T(""),
_T("wxThread sample"), s_num, 1, 10000, this); _T("wxThread sample"), s_num, 1, 10000, this);
@@ -505,7 +505,7 @@ void MyFrame::OnStartThreads(wxCommandEvent& WXUNUSED(event) )
return; return;
} }
size_t count = (size_t)s_num, n; unsigned count = unsigned(s_num), n;
wxArrayThread threads; wxArrayThread threads;
@@ -647,7 +647,7 @@ void MyFrame::OnIdle(wxIdleEvent& event)
m_nRunning = nRunning; m_nRunning = nRunning;
m_nCount = nCount; 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 //else: avoid flicker - don't print anything

View File

@@ -477,7 +477,7 @@ void MyFrame::OnDumpSelected(wxCommandEvent& WXUNUSED(event))
wxArrayTreeItemIds array; wxArrayTreeItemIds array;
size_t count = m_treeCtrl->GetSelections(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++ ) 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 // at depth 1 elements won't have any more children
if ( hasChildren ) if ( hasChildren )
str.Printf(wxT("%s child %d"), wxT("Folder"), n + 1); str.Printf(wxT("%s child %u"), wxT("Folder"), unsigned(n + 1));
else 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 // here we pass to AppendItem() normal and selected item images (we
// suppose that selected image follows the normal one in the enum) // 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->IsSelected(GetId())),
Bool2String(tree->IsExpanded(GetId())), Bool2String(tree->IsExpanded(GetId())),
Bool2String(tree->IsBold(GetId())), Bool2String(tree->IsBold(GetId())),
tree->GetChildrenCount(GetId()), unsigned(tree->GetChildrenCount(GetId())),
tree->GetChildrenCount(GetId(), false)); unsigned(tree->GetChildrenCount(GetId(), false)));
} }

View File

@@ -527,7 +527,7 @@ void BookWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event)
void BookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event) void BookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event)
{ {
if(m_book) 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) void BookWidgetsPage::OnUpdateUICurSelectText(wxUpdateUIEvent& event)