Don't use %i format specifier for size_t values.
In 64 bit build, size_t can be 64 bits while %i expects a 32 bit value. Fix this by just avoiding the unnecessary use of size_t, the number of entries in the index is not going to be greater than 2^32. Closes #16163. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1625,10 +1625,10 @@ void wxHtmlHelpWindow::DoIndexFind()
|
|||||||
|
|
||||||
m_IndexList->Clear();
|
m_IndexList->Clear();
|
||||||
const wxHtmlHelpMergedIndex& index = *m_mergedIndex;
|
const wxHtmlHelpMergedIndex& index = *m_mergedIndex;
|
||||||
size_t cnt = index.size();
|
const unsigned cnt = index.size();
|
||||||
|
|
||||||
int displ = 0;
|
int displ = 0;
|
||||||
for (size_t i = 0; i < cnt; i++)
|
for (unsigned i = 0; i < cnt; i++)
|
||||||
{
|
{
|
||||||
if (index[i].name.Lower().find(sr) != wxString::npos)
|
if (index[i].name.Lower().find(sr) != wxString::npos)
|
||||||
{
|
{
|
||||||
@@ -1678,7 +1678,7 @@ void wxHtmlHelpWindow::DoIndexFind()
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxString cnttext;
|
wxString cnttext;
|
||||||
cnttext.Printf(_("%i of %i"), displ, cnt);
|
cnttext.Printf(_("%i of %u"), displ, cnt);
|
||||||
m_IndexCountInfo->SetLabel(cnttext);
|
m_IndexCountInfo->SetLabel(cnttext);
|
||||||
|
|
||||||
m_IndexText->SetSelection(0, sr.length());
|
m_IndexText->SetSelection(0, sr.length());
|
||||||
@@ -1697,10 +1697,10 @@ void wxHtmlHelpWindow::DoIndexAll()
|
|||||||
|
|
||||||
m_IndexList->Clear();
|
m_IndexList->Clear();
|
||||||
const wxHtmlHelpMergedIndex& index = *m_mergedIndex;
|
const wxHtmlHelpMergedIndex& index = *m_mergedIndex;
|
||||||
size_t cnt = index.size();
|
const unsigned cnt = index.size();
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
|
||||||
for (size_t i = 0; i < cnt; i++)
|
for (unsigned i = 0; i < cnt; i++)
|
||||||
{
|
{
|
||||||
m_IndexList->Append(index[i].name, (char*)(&index[i]));
|
m_IndexList->Append(index[i].name, (char*)(&index[i]));
|
||||||
if (first)
|
if (first)
|
||||||
@@ -1716,7 +1716,7 @@ void wxHtmlHelpWindow::DoIndexAll()
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxString cnttext;
|
wxString cnttext;
|
||||||
cnttext.Printf(_("%i of %i"), cnt, cnt);
|
cnttext.Printf(_("%u of %u"), cnt, cnt);
|
||||||
m_IndexCountInfo->SetLabel(cnttext);
|
m_IndexCountInfo->SetLabel(cnttext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user