1
0
Fork 0

fix some casts

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3017
This commit is contained in:
Sebastian Strohhäcker 2007-10-14 17:31:52 +00:00
parent 280c9c0832
commit 63c2e24aee
2 changed files with 14 additions and 8 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: cdrom_image.cpp,v 1.17 2007-08-22 11:54:35 qbix79 Exp $ */
/* $Id: cdrom_image.cpp,v 1.18 2007-10-14 17:31:52 c2woody Exp $ */
#include <cctype>
#include <cmath>
@ -604,11 +604,13 @@ bool CDROM_Interface_Image::GetRealFileName(string &filename, string &pathname)
Bit8u drive;
if (!DOS_MakeName(tmp, fullname, &drive)) return false;
localDrive *ldp = (localDrive*)Drives[drive];
ldp->GetSystemFilename(tmp, fullname);
if (stat(tmp, &test) == 0) {
filename = tmp;
return true;
localDrive *ldp = dynamic_cast<localDrive*>(Drives[drive]);
if (ldp) {
ldp->GetSystemFilename(tmp, fullname);
if (stat(tmp, &test) == 0) {
filename = tmp;
return true;
}
}
return false;

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_programs.cpp,v 1.77 2007-08-22 11:54:54 qbix79 Exp $ */
/* $Id: dos_programs.cpp,v 1.78 2007-10-14 17:31:52 c2woody Exp $ */
#include "dosbox.h"
#include <stdlib.h>
@ -1016,7 +1016,11 @@ public:
return;
}
localDrive *ldp = (localDrive*)Drives[dummy];
localDrive *ldp = dynamic_cast<localDrive*>(Drives[dummy]);
if (ldp==NULL) {
WriteOut(MSG_Get("PROGRAM_IMGMOUNT_FILE_NOT_FOUND"));
return;
}
ldp->GetSystemFilename(tmp, fullname);
temp_line = tmp;