Warning fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-11-12 14:08:31 +00:00
parent 9777274a4a
commit 9386cb75e3
2 changed files with 6 additions and 6 deletions

View File

@@ -549,13 +549,14 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
wxFile file(dir + _T("horse.bmp")); wxFile file(dir + _T("horse.bmp"));
if ( file.IsOpened() ) if ( file.IsOpened() )
{ {
size_t len = (size_t)file.Length(); wxFileOffset len = file.Length();
void *data = malloc(len); size_t dataSize = (size_t)len;
if ( file.Read(data, len) != len ) void *data = malloc(dataSize);
if ( file.Read(data, dataSize) != len )
wxLogError(_T("Reading bitmap file failed")); wxLogError(_T("Reading bitmap file failed"));
else else
{ {
wxMemoryInputStream mis(data, len); wxMemoryInputStream mis(data, dataSize);
if ( !image.LoadFile(mis) ) if ( !image.LoadFile(mis) )
wxLogError(wxT("Can't load BMP image from stream")); wxLogError(wxT("Can't load BMP image from stream"));
else else

View File

@@ -1102,7 +1102,6 @@ void ArchiveTestCase<Classes>::VerifyDir(wxString& path, size_t rootlen /*=0*/)
it != m_testEntries.end()); it != m_testEntries.end());
const TestEntry& testEntry = *it->second; const TestEntry& testEntry = *it->second;
size_t size = 0;
#ifndef __WXMSW__ #ifndef __WXMSW__
CPPUNIT_ASSERT_MESSAGE("timestamp check" + error_context, CPPUNIT_ASSERT_MESSAGE("timestamp check" + error_context,
@@ -1114,7 +1113,7 @@ void ArchiveTestCase<Classes>::VerifyDir(wxString& path, size_t rootlen /*=0*/)
CPPUNIT_ASSERT_MESSAGE( CPPUNIT_ASSERT_MESSAGE(
"entry not found in archive" + error_entry, in.Ok()); "entry not found in archive" + error_entry, in.Ok());
size = in.GetLength(); size_t size = in.GetLength();
wxCharBuffer buf(size); wxCharBuffer buf(size);
CPPUNIT_ASSERT_MESSAGE("Read" + error_context, CPPUNIT_ASSERT_MESSAGE("Read" + error_context,
in.Read(buf.data(), size).LastRead() == size); in.Read(buf.data(), size).LastRead() == size);