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:
Michael Wetherell 2005-10-17 22:08:05 +00:00
parent c0f420c1ac
commit 4a10ea8b13
15 changed files with 31 additions and 28 deletions

View File

@ -522,7 +522,7 @@ public:
virtual size_t GetFormatCount(Direction dir) const
{
// our custom format is supported by both GetData() and SetData()
size_t nFormats = 1;
ULONG nFormats = 1;
if ( dir == Get )
{
// but the bitmap format(s) are only supported for output

View File

@ -2193,20 +2193,20 @@ void wxFileHistory::RemoveFileFromHistory(size_t i)
wxList::compatibility_iterator node = m_fileMenus.GetFirst();
while ( node )
{
wxMenu* menu = (wxMenu*) node->GetData();
wxMenu* menu = (wxMenu*) node->GetData();
// shuffle filenames up
wxString buf;
for ( j = i; j < m_fileHistoryN - 1; j++ )
{
buf.Printf(s_MRUEntryFormat, j + 1, m_fileHistory[j]);
menu->SetLabel(m_idBase + j, buf);
}
// shuffle filenames up
wxString buf;
for ( j = i; j < m_fileHistoryN - 1; j++ )
{
buf.Printf(s_MRUEntryFormat, j + 1, m_fileHistory[j]);
menu->SetLabel(m_idBase + j, buf);
}
node = node->GetNext();
node = node->GetNext();
// 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))
{
menu->Delete(lastItemId);

View File

@ -94,7 +94,7 @@ _tiffReadProc(thandle_t handle, tdata_t buf, tsize_t size)
{
wxInputStream *stream = (wxInputStream*) handle;
stream->Read( (void*) buf, (size_t) size );
return stream->LastRead();
return wx_truncate_cast(tsize_t, stream->LastRead());
}
tsize_t TIFFLINKAGEMODE
@ -102,7 +102,7 @@ _tiffWriteProc(thandle_t handle, tdata_t buf, tsize_t size)
{
wxOutputStream *stream = (wxOutputStream*) handle;
stream->Write( (void*) buf, (size_t) size );
return stream->LastWrite();
return wx_truncate_cast(tsize_t, stream->LastWrite());
}
toff_t TIFFLINKAGEMODE

View File

@ -1137,7 +1137,7 @@ bool wxMsgCatalogFile::Load(const wxChar *szDirPrefix, const wxChar *szName,
return false;
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
m_pData = new size_t8[nSize];
@ -1317,7 +1317,7 @@ void wxMsgCatalogFile::FillHash(wxMessagesHash& hash,
#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
(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);
#if wxUSE_UNICODE

View File

@ -59,7 +59,7 @@ wxMemoryInputStream::wxMemoryInputStream(const wxMemoryOutputStream& stream)
}
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->SetBufferIO(len); // create buffer

View File

@ -1324,10 +1324,12 @@ void wxFlexGridSizer::AdjustForFlexDirection()
wxArrayInt& array = m_flexDirection == wxVERTICAL ? m_colWidths
: m_rowHeights;
const int count = array.GetCount();
const size_t count = array.GetCount();
// find the largest value in this array
int n, largest = 0;
size_t n;
int largest = 0;
for ( n = 0; n < count; ++n )
{
if ( array[n] > largest )

View File

@ -664,7 +664,7 @@ size_t wxStreamBase::GetSize() const
return 0;
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;
}

View File

@ -974,7 +974,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
dc.DrawRectangle(0, y, GetClientSize().x, m_heightRow);
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;
if ( startOnMonday )
@ -1014,7 +1014,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
wxLogDebug("painting week %d at y = %d\n", nWeek, y);
#endif
for ( size_t wd = 0; wd < 7; wd++ )
for ( int wd = 0; wd < 7; wd++ )
{
if ( IsDateShown(date) )
{

View File

@ -364,7 +364,7 @@ wxChoicebook::InsertPage(size_t n,
wxWindow *wxChoicebook::DoRemovePage(size_t page)
{
const int page_count = GetPageCount();
const size_t page_count = GetPageCount();
wxWindow *win = wxBookCtrlBase::DoRemovePage(page);
if ( win )

View File

@ -390,7 +390,7 @@ wxGridCellAutoWrapStringRenderer::GetBestSize(wxGrid& grid,
{
width+=10;
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--;
// Search for a shape no taller than the golden ratio.
} while (count && (width < (height*1.68)) );

View File

@ -437,7 +437,7 @@ wxListbook::InsertPage(size_t n,
wxWindow *wxListbook::DoRemovePage(size_t page)
{
const int page_count = GetPageCount();
const size_t page_count = GetPageCount();
wxWindow *win = wxBookCtrlBase::DoRemovePage(page);
if ( win )

View File

@ -315,7 +315,7 @@ void wxTipWindowView::Adjust(const wxString& text, wxCoord maxLength)
// take into account the border size and the margins
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);
SetSize(0, 0, width, height);
}

View File

@ -354,7 +354,7 @@ int wxListBox::FindString(const wxString& s, bool bCase) const
if (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)
return wxNOT_FOUND;
else

View File

@ -620,7 +620,7 @@ STDMETHODIMP wxIDataObject::EnumFormatEtc(DWORD dwDir,
wxDataObject::Direction dir = dwDir == DATADIR_GET ? wxDataObject::Get
: wxDataObject::Set;
size_t nFormatCount = m_pDataObject->GetFormatCount(dir);
ULONG nFormatCount = wx_truncate_cast(ULONG, m_pDataObject->GetFormatCount(dir));
wxDataFormat format;
wxDataFormat *formats;
formats = nFormatCount == 1 ? &format : new wxDataFormat[nFormatCount];

View File

@ -599,7 +599,8 @@ bool wxToolBar::Realize()
sizeBmp.x = m_defaultWidth;
sizeBmp.y = m_defaultHeight;
const wxCoord totalBitmapWidth = m_defaultWidth * nTools,
const wxCoord totalBitmapWidth = m_defaultWidth *
wx_truncate_cast(wxCoord, nTools),
totalBitmapHeight = m_defaultHeight;
// Create a bitmap and copy all the tool bitmaps to it