]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/sound.cpp
replaced gs_menuItems hack with a wxOwnerDrawn::m_isMenuItem field
[wxWidgets.git] / src / unix / sound.cpp
index 8ef528b48991df484bd52c4054d3531c4c231056..ce7557247174a2fe5fb96cd1e4dd442a07273bd1 100644 (file)
@@ -9,11 +9,6 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "sound.h"
-#pragma implementation "soundbase.h"
-#endif
-
 // for compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -465,9 +460,13 @@ bool wxSound::Create(const wxString& fileName, bool isResource)
         return false;
     }
 
-    wxFileOffset len = fileWave.Length();
+    wxFileOffset lenOrig = fileWave.Length();
+    if ( lenOrig == wxInvalidOffset )
+        return false;
+
+    size_t len = wx_truncate_cast(size_t, lenOrig);
     wxUint8 *data = new wxUint8[len];
-    if (fileWave.Read(data, len) != len)
+    if ( fileWave.Read(data, len) != lenOrig )
     {
         wxLogError(_("Couldn't load sound data from '%s'."), fileName.c_str());
         return false;