Warning fixes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -549,13 +549,14 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
|
||||
wxFile file(dir + _T("horse.bmp"));
|
||||
if ( file.IsOpened() )
|
||||
{
|
||||
size_t len = (size_t)file.Length();
|
||||
void *data = malloc(len);
|
||||
if ( file.Read(data, len) != len )
|
||||
wxFileOffset len = file.Length();
|
||||
size_t dataSize = (size_t)len;
|
||||
void *data = malloc(dataSize);
|
||||
if ( file.Read(data, dataSize) != len )
|
||||
wxLogError(_T("Reading bitmap file failed"));
|
||||
else
|
||||
{
|
||||
wxMemoryInputStream mis(data, len);
|
||||
wxMemoryInputStream mis(data, dataSize);
|
||||
if ( !image.LoadFile(mis) )
|
||||
wxLogError(wxT("Can't load BMP image from stream"));
|
||||
else
|
||||
|
Reference in New Issue
Block a user