diff options
author | Colin Snover | 2017-10-27 22:37:13 -0500 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-18 13:49:15 +0200 |
commit | 452e979101da7586042bbe07691b99773e398f1e (patch) | |
tree | a7af40120c8ad71affab11fbaf6cd63f77de50ac /backends/fs | |
parent | c494123996d026223362ec5d28e23693ce981981 (diff) | |
download | scummvm-rg350-452e979101da7586042bbe07691b99773e398f1e.tar.gz scummvm-rg350-452e979101da7586042bbe07691b99773e398f1e.tar.bz2 scummvm-rg350-452e979101da7586042bbe07691b99773e398f1e.zip |
PSP: Fix invalid return type of PspIoStream
The underlying API returns a SceUID, which is not valid to be
casted to a pointer.
Diffstat (limited to 'backends/fs')
-rw-r--r-- | backends/fs/psp/psp-stream.cpp | 8 | ||||
-rw-r--r-- | backends/fs/psp/psp-stream.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/backends/fs/psp/psp-stream.cpp b/backends/fs/psp/psp-stream.cpp index c9b2fc7d8c..51720b54bf 100644 --- a/backends/fs/psp/psp-stream.cpp +++ b/backends/fs/psp/psp-stream.cpp @@ -82,7 +82,7 @@ PspIoStream::~PspIoStream() { /* Function to open the file pointed to by the path. * */ -void *PspIoStream::open() { +SceUID PspIoStream::open() { DEBUG_ENTER_FUNC(); if (PowerMan.beginCriticalSection()) { @@ -91,9 +91,9 @@ void *PspIoStream::open() { } _handle = sceIoOpen(_path.c_str(), _writeMode ? PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC : PSP_O_RDONLY, 0777); - if (!_handle) { + if (_handle <= 0) { _error = true; - _handle = NULL; + _handle = 0; } // Get the file size. This way is much faster than going to the end of the file and back @@ -107,7 +107,7 @@ void *PspIoStream::open() { PowerMan.endCriticalSection(); - return (void *)_handle; + return _handle; } bool PspIoStream::err() const { diff --git a/backends/fs/psp/psp-stream.h b/backends/fs/psp/psp-stream.h index 734cb66184..fe1d797649 100644 --- a/backends/fs/psp/psp-stream.h +++ b/backends/fs/psp/psp-stream.h @@ -69,7 +69,7 @@ public: PspIoStream(const Common::String &path, bool writeMode); virtual ~PspIoStream(); - void * open(); // open the file pointed to by the file path + SceUID open(); // open the file pointed to by the file path bool err() const; void clearErr(); |