Warning fixes for win64
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -522,7 +522,7 @@ public:
|
|||||||
virtual size_t GetFormatCount(Direction dir) const
|
virtual size_t GetFormatCount(Direction dir) const
|
||||||
{
|
{
|
||||||
// our custom format is supported by both GetData() and SetData()
|
// our custom format is supported by both GetData() and SetData()
|
||||||
size_t nFormats = 1;
|
ULONG nFormats = 1;
|
||||||
if ( dir == Get )
|
if ( dir == Get )
|
||||||
{
|
{
|
||||||
// but the bitmap format(s) are only supported for output
|
// but the bitmap format(s) are only supported for output
|
||||||
|
@@ -2193,20 +2193,20 @@ void wxFileHistory::RemoveFileFromHistory(size_t i)
|
|||||||
wxList::compatibility_iterator node = m_fileMenus.GetFirst();
|
wxList::compatibility_iterator node = m_fileMenus.GetFirst();
|
||||||
while ( node )
|
while ( node )
|
||||||
{
|
{
|
||||||
wxMenu* menu = (wxMenu*) node->GetData();
|
wxMenu* menu = (wxMenu*) node->GetData();
|
||||||
|
|
||||||
// shuffle filenames up
|
// shuffle filenames up
|
||||||
wxString buf;
|
wxString buf;
|
||||||
for ( j = i; j < m_fileHistoryN - 1; j++ )
|
for ( j = i; j < m_fileHistoryN - 1; j++ )
|
||||||
{
|
{
|
||||||
buf.Printf(s_MRUEntryFormat, j + 1, m_fileHistory[j]);
|
buf.Printf(s_MRUEntryFormat, j + 1, m_fileHistory[j]);
|
||||||
menu->SetLabel(m_idBase + j, buf);
|
menu->SetLabel(m_idBase + j, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
node = node->GetNext();
|
node = node->GetNext();
|
||||||
|
|
||||||
// delete the last menu item which is unused now
|
// delete the last menu item which is unused now
|
||||||
wxWindowID lastItemId = m_idBase + m_fileHistoryN - 1;
|
wxWindowID lastItemId = m_idBase + wx_truncate_cast(wxWindowID, m_fileHistoryN) - 1;
|
||||||
if (menu->FindItem(lastItemId))
|
if (menu->FindItem(lastItemId))
|
||||||
{
|
{
|
||||||
menu->Delete(lastItemId);
|
menu->Delete(lastItemId);
|
||||||
|
@@ -94,7 +94,7 @@ _tiffReadProc(thandle_t handle, tdata_t buf, tsize_t size)
|
|||||||
{
|
{
|
||||||
wxInputStream *stream = (wxInputStream*) handle;
|
wxInputStream *stream = (wxInputStream*) handle;
|
||||||
stream->Read( (void*) buf, (size_t) size );
|
stream->Read( (void*) buf, (size_t) size );
|
||||||
return stream->LastRead();
|
return wx_truncate_cast(tsize_t, stream->LastRead());
|
||||||
}
|
}
|
||||||
|
|
||||||
tsize_t TIFFLINKAGEMODE
|
tsize_t TIFFLINKAGEMODE
|
||||||
@@ -102,7 +102,7 @@ _tiffWriteProc(thandle_t handle, tdata_t buf, tsize_t size)
|
|||||||
{
|
{
|
||||||
wxOutputStream *stream = (wxOutputStream*) handle;
|
wxOutputStream *stream = (wxOutputStream*) handle;
|
||||||
stream->Write( (void*) buf, (size_t) size );
|
stream->Write( (void*) buf, (size_t) size );
|
||||||
return stream->LastWrite();
|
return wx_truncate_cast(tsize_t, stream->LastWrite());
|
||||||
}
|
}
|
||||||
|
|
||||||
toff_t TIFFLINKAGEMODE
|
toff_t TIFFLINKAGEMODE
|
||||||
|
@@ -1137,7 +1137,7 @@ bool wxMsgCatalogFile::Load(const wxChar *szDirPrefix, const wxChar *szName,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
size_t nSize = wx_truncate_cast(size_t, lenFile);
|
size_t nSize = wx_truncate_cast(size_t, lenFile);
|
||||||
wxASSERT_MSG( nSize == lenFile, _T("message catalog bigger than 4GB?") );
|
wxASSERT_MSG( nSize == lenFile + size_t(0), _T("message catalog bigger than 4GB?") );
|
||||||
|
|
||||||
// read the whole file in memory
|
// read the whole file in memory
|
||||||
m_pData = new size_t8[nSize];
|
m_pData = new size_t8[nSize];
|
||||||
@@ -1317,7 +1317,7 @@ void wxMsgCatalogFile::FillHash(wxMessagesHash& hash,
|
|||||||
#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
|
#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
|
||||||
(void)convertEncoding; // get rid of warnings about unused parameter
|
(void)convertEncoding; // get rid of warnings about unused parameter
|
||||||
|
|
||||||
for (size_t i = 0; i < m_numStrings; i++)
|
for (size_t32 i = 0; i < m_numStrings; i++)
|
||||||
{
|
{
|
||||||
const char *data = StringAtOfs(m_pOrigTable, i);
|
const char *data = StringAtOfs(m_pOrigTable, i);
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
|
@@ -59,7 +59,7 @@ wxMemoryInputStream::wxMemoryInputStream(const wxMemoryOutputStream& stream)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const size_t len = wx_truncate_cast(size_t, lenFile);
|
const size_t len = wx_truncate_cast(size_t, lenFile);
|
||||||
wxASSERT_MSG( len == lenFile, _T("huge files not supported") );
|
wxASSERT_MSG( len == lenFile + size_t(0), _T("huge files not supported") );
|
||||||
|
|
||||||
m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read);
|
m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read);
|
||||||
m_i_streambuf->SetBufferIO(len); // create buffer
|
m_i_streambuf->SetBufferIO(len); // create buffer
|
||||||
|
@@ -1324,10 +1324,12 @@ void wxFlexGridSizer::AdjustForFlexDirection()
|
|||||||
wxArrayInt& array = m_flexDirection == wxVERTICAL ? m_colWidths
|
wxArrayInt& array = m_flexDirection == wxVERTICAL ? m_colWidths
|
||||||
: m_rowHeights;
|
: m_rowHeights;
|
||||||
|
|
||||||
const int count = array.GetCount();
|
const size_t count = array.GetCount();
|
||||||
|
|
||||||
// find the largest value in this array
|
// find the largest value in this array
|
||||||
int n, largest = 0;
|
size_t n;
|
||||||
|
int largest = 0;
|
||||||
|
|
||||||
for ( n = 0; n < count; ++n )
|
for ( n = 0; n < count; ++n )
|
||||||
{
|
{
|
||||||
if ( array[n] > largest )
|
if ( array[n] > largest )
|
||||||
|
@@ -664,7 +664,7 @@ size_t wxStreamBase::GetSize() const
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
const size_t len = wx_truncate_cast(size_t, length);
|
const size_t len = wx_truncate_cast(size_t, length);
|
||||||
wxASSERT_MSG( len == length, _T("large files not supported") );
|
wxASSERT_MSG( len == length + size_t(0), _T("large files not supported") );
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
@@ -974,7 +974,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
dc.DrawRectangle(0, y, GetClientSize().x, m_heightRow);
|
dc.DrawRectangle(0, y, GetClientSize().x, m_heightRow);
|
||||||
|
|
||||||
bool startOnMonday = (GetWindowStyle() & wxCAL_MONDAY_FIRST) != 0;
|
bool startOnMonday = (GetWindowStyle() & wxCAL_MONDAY_FIRST) != 0;
|
||||||
for ( size_t wd = 0; wd < 7; wd++ )
|
for ( int wd = 0; wd < 7; wd++ )
|
||||||
{
|
{
|
||||||
size_t n;
|
size_t n;
|
||||||
if ( startOnMonday )
|
if ( startOnMonday )
|
||||||
@@ -1014,7 +1014,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
wxLogDebug("painting week %d at y = %d\n", nWeek, y);
|
wxLogDebug("painting week %d at y = %d\n", nWeek, y);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for ( size_t wd = 0; wd < 7; wd++ )
|
for ( int wd = 0; wd < 7; wd++ )
|
||||||
{
|
{
|
||||||
if ( IsDateShown(date) )
|
if ( IsDateShown(date) )
|
||||||
{
|
{
|
||||||
|
@@ -364,7 +364,7 @@ wxChoicebook::InsertPage(size_t n,
|
|||||||
|
|
||||||
wxWindow *wxChoicebook::DoRemovePage(size_t page)
|
wxWindow *wxChoicebook::DoRemovePage(size_t page)
|
||||||
{
|
{
|
||||||
const int page_count = GetPageCount();
|
const size_t page_count = GetPageCount();
|
||||||
wxWindow *win = wxBookCtrlBase::DoRemovePage(page);
|
wxWindow *win = wxBookCtrlBase::DoRemovePage(page);
|
||||||
|
|
||||||
if ( win )
|
if ( win )
|
||||||
|
@@ -390,7 +390,7 @@ wxGridCellAutoWrapStringRenderer::GetBestSize(wxGrid& grid,
|
|||||||
{
|
{
|
||||||
width+=10;
|
width+=10;
|
||||||
rect.SetWidth(width);
|
rect.SetWidth(width);
|
||||||
height = y *( GetTextLines(grid,dc,attr,rect,row,col).GetCount());
|
height = y * (wx_truncate_cast(wxCoord, GetTextLines(grid,dc,attr,rect,row,col).GetCount()));
|
||||||
count--;
|
count--;
|
||||||
// Search for a shape no taller than the golden ratio.
|
// Search for a shape no taller than the golden ratio.
|
||||||
} while (count && (width < (height*1.68)) );
|
} while (count && (width < (height*1.68)) );
|
||||||
|
@@ -437,7 +437,7 @@ wxListbook::InsertPage(size_t n,
|
|||||||
|
|
||||||
wxWindow *wxListbook::DoRemovePage(size_t page)
|
wxWindow *wxListbook::DoRemovePage(size_t page)
|
||||||
{
|
{
|
||||||
const int page_count = GetPageCount();
|
const size_t page_count = GetPageCount();
|
||||||
wxWindow *win = wxBookCtrlBase::DoRemovePage(page);
|
wxWindow *win = wxBookCtrlBase::DoRemovePage(page);
|
||||||
|
|
||||||
if ( win )
|
if ( win )
|
||||||
|
@@ -315,7 +315,7 @@ void wxTipWindowView::Adjust(const wxString& text, wxCoord maxLength)
|
|||||||
|
|
||||||
// take into account the border size and the margins
|
// take into account the border size and the margins
|
||||||
width = 2*(TEXT_MARGIN_X + 1) + widthMax;
|
width = 2*(TEXT_MARGIN_X + 1) + widthMax;
|
||||||
height = 2*(TEXT_MARGIN_Y + 1) + m_parent->m_textLines.GetCount()*m_parent->m_heightLine;
|
height = 2*(TEXT_MARGIN_Y + 1) + wx_truncate_cast(wxCoord, m_parent->m_textLines.GetCount())*m_parent->m_heightLine;
|
||||||
m_parent->SetClientSize(width, height);
|
m_parent->SetClientSize(width, height);
|
||||||
SetSize(0, 0, width, height);
|
SetSize(0, 0, width, height);
|
||||||
}
|
}
|
||||||
|
@@ -354,7 +354,7 @@ int wxListBox::FindString(const wxString& s, bool bCase) const
|
|||||||
if (bCase)
|
if (bCase)
|
||||||
return wxItemContainerImmutable::FindString( s, bCase );
|
return wxItemContainerImmutable::FindString( s, bCase );
|
||||||
|
|
||||||
int pos = ListBox_FindStringExact(GetHwnd(), (WPARAM)-1, s);
|
int pos = ListBox_FindStringExact(GetHwnd(), -1, s);
|
||||||
if (pos == LB_ERR)
|
if (pos == LB_ERR)
|
||||||
return wxNOT_FOUND;
|
return wxNOT_FOUND;
|
||||||
else
|
else
|
||||||
|
@@ -620,7 +620,7 @@ STDMETHODIMP wxIDataObject::EnumFormatEtc(DWORD dwDir,
|
|||||||
wxDataObject::Direction dir = dwDir == DATADIR_GET ? wxDataObject::Get
|
wxDataObject::Direction dir = dwDir == DATADIR_GET ? wxDataObject::Get
|
||||||
: wxDataObject::Set;
|
: wxDataObject::Set;
|
||||||
|
|
||||||
size_t nFormatCount = m_pDataObject->GetFormatCount(dir);
|
ULONG nFormatCount = wx_truncate_cast(ULONG, m_pDataObject->GetFormatCount(dir));
|
||||||
wxDataFormat format;
|
wxDataFormat format;
|
||||||
wxDataFormat *formats;
|
wxDataFormat *formats;
|
||||||
formats = nFormatCount == 1 ? &format : new wxDataFormat[nFormatCount];
|
formats = nFormatCount == 1 ? &format : new wxDataFormat[nFormatCount];
|
||||||
|
@@ -599,7 +599,8 @@ bool wxToolBar::Realize()
|
|||||||
sizeBmp.x = m_defaultWidth;
|
sizeBmp.x = m_defaultWidth;
|
||||||
sizeBmp.y = m_defaultHeight;
|
sizeBmp.y = m_defaultHeight;
|
||||||
|
|
||||||
const wxCoord totalBitmapWidth = m_defaultWidth * nTools,
|
const wxCoord totalBitmapWidth = m_defaultWidth *
|
||||||
|
wx_truncate_cast(wxCoord, nTools),
|
||||||
totalBitmapHeight = m_defaultHeight;
|
totalBitmapHeight = m_defaultHeight;
|
||||||
|
|
||||||
// Create a bitmap and copy all the tool bitmaps to it
|
// Create a bitmap and copy all the tool bitmaps to it
|
||||||
|
Reference in New Issue
Block a user