summaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-03-17 04:39:30 +0300
committerAndrei Karas <akaras@inbox.ru>2018-03-17 04:39:30 +0300
commit350c0ab96146402e05a527ad08f5e0fea2c9ff6c (patch)
tree7f9d7c827c9d424a0032f1de9b02a8bd58cc21af /src/fs
parente9fa8a0b173c72c5051e2c76de2639034e8c7bab (diff)
downloadmanaverse-350c0ab96146402e05a527ad08f5e0fea2c9ff6c.tar.gz
manaverse-350c0ab96146402e05a527ad08f5e0fea2c9ff6c.tar.bz2
manaverse-350c0ab96146402e05a527ad08f5e0fea2c9ff6c.tar.xz
manaverse-350c0ab96146402e05a527ad08f5e0fea2c9ff6c.zip
Improve rwops creation error messages.
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/virtfs/rwops.cpp19
-rw-r--r--src/fs/virtfs/rwops.h3
2 files changed, 15 insertions, 7 deletions
diff --git a/src/fs/virtfs/rwops.cpp b/src/fs/virtfs/rwops.cpp
index a5d81ed1f..7c35c336d 100644
--- a/src/fs/virtfs/rwops.cpp
+++ b/src/fs/virtfs/rwops.cpp
@@ -50,6 +50,7 @@
#include "fs/virtfs/fs.h"
#include "fs/virtfs/fsfuncs.h"
+#include "utils/checkutils.h"
#include "utils/fuzzer.h"
PRAGMA48(GCC diagnostic push)
@@ -62,13 +63,15 @@ PRAGMA48(GCC diagnostic pop)
namespace VirtFs
{
-SDL_RWops *create_rwops(File *const file)
+SDL_RWops *create_rwops(File *const file,
+ const std::string &restrict fname)
{
SDL_RWops *retval = nullptr;
if (file == nullptr)
{
- logger->assertLog("VirtFs::rwops_seek: create rwops error.");
+ reportAlways("VirtFs::rwops_seek: create rwops error: %s",
+ fname.c_str());
}
else
{
@@ -114,13 +117,15 @@ SDL_RWops *rwopsOpenRead(const std::string &restrict fname)
#endif // USE_FUZZER
#ifdef USE_PROFILER
- SDL_RWops *const ret = create_rwops(openRead(fname));
+ SDL_RWops *const ret = create_rwops(openRead(fname),
+ fname);
BLOCK_END("RWopsopenRead")
return ret;
#else // USE_PROFILER
- return create_rwops(openRead(fname));
+ return create_rwops(openRead(fname),
+ fname);
#endif // USE_PROFILER
} /* RWopsopenRead */
@@ -131,7 +136,8 @@ SDL_RWops *rwopsOpenWrite(const std::string &restrict fname)
return nullptr;
#endif // __APPLE__
- return create_rwops(openWrite(fname));
+ return create_rwops(openWrite(fname),
+ fname);
} /* RWopsopenWrite */
SDL_RWops *rwopsOpenAppend(const std::string &restrict fname)
@@ -141,7 +147,8 @@ SDL_RWops *rwopsOpenAppend(const std::string &restrict fname)
return nullptr;
#endif // __APPLE__
- return create_rwops(openAppend(fname));
+ return create_rwops(openAppend(fname),
+ fname);
} /* RWopsopenAppend */
} // namespace VirtFs
diff --git a/src/fs/virtfs/rwops.h b/src/fs/virtfs/rwops.h
index aa75b6ec3..1efd2ac1a 100644
--- a/src/fs/virtfs/rwops.h
+++ b/src/fs/virtfs/rwops.h
@@ -55,7 +55,8 @@ namespace VirtFs
{
struct File;
- SDL_RWops *create_rwops(File *const file);
+ SDL_RWops *create_rwops(File *const file,
+ const std::string &restrict fname);
SDL_RWops *rwopsOpenRead(const std::string &restrict fname);
SDL_RWops *rwopsOpenWrite(const std::string &restrict fname) A_WARN_UNUSED;