summaryrefslogtreecommitdiff
path: root/src/utils/virtfsrwops.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-14 20:34:06 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-14 20:59:26 +0300
commitbdec92381ef60cd027292ed63e254e8de70028d9 (patch)
treeebf2722cdc9fe7383a709ba1584432a491cf10ba /src/utils/virtfsrwops.cpp
parent5283a59db971ec2038149bf26ad9b3cbc4924449 (diff)
downloadplus-bdec92381ef60cd027292ed63e254e8de70028d9.tar.gz
plus-bdec92381ef60cd027292ed63e254e8de70028d9.tar.bz2
plus-bdec92381ef60cd027292ed63e254e8de70028d9.tar.xz
plus-bdec92381ef60cd027292ed63e254e8de70028d9.zip
In virtfs replace parameters type from char* to std::string.
Diffstat (limited to 'src/utils/virtfsrwops.cpp')
-rw-r--r--src/utils/virtfsrwops.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/virtfsrwops.cpp b/src/utils/virtfsrwops.cpp
index ade942385..837704465 100644
--- a/src/utils/virtfsrwops.cpp
+++ b/src/utils/virtfsrwops.cpp
@@ -343,9 +343,9 @@ SDL_RWops *VirtFs::MakeRWops(VirtFile *const handle)
} /* RWopsmakeRWops */
#ifdef __APPLE__
-static bool checkFilePath(const char *const fname)
+static bool checkFilePath(const std::string &restrict fname)
{
- if (!fname || !*fname)
+ if (fname.empty())
return false;
if (!VirtFs::exists(fname) || VirtFs::isDirectory(fname))
return false;
@@ -355,11 +355,11 @@ static bool checkFilePath(const char *const fname)
#ifdef DEBUG_VIRTFS
#undef RWopsOpenRead
-SDL_RWops *VirtFs::RWopsOpenRead(const char *const fname,
+SDL_RWops *VirtFs::RWopsOpenRead(const std::string &restrict fname,
const char *restrict const file,
const unsigned line)
#else // DEBUG_VIRTFS
-SDL_RWops *VirtFs::RWopsOpenRead(const char *const fname)
+SDL_RWops *VirtFs::RWopsOpenRead(const std::string &restrict fname)
#endif // DEBUG_VIRTFS
{
BLOCK_START("RWopsopenRead")
@@ -399,7 +399,7 @@ SDL_RWops *VirtFs::RWopsOpenRead(const char *const fname)
#endif // USE_PROFILER
} /* RWopsopenRead */
-SDL_RWops *VirtFs::RWopsOpenWrite(const char *const fname)
+SDL_RWops *VirtFs::RWopsOpenWrite(const std::string &restrict fname)
{
#ifdef __APPLE__
if (!checkFilePath(fname))
@@ -409,7 +409,7 @@ SDL_RWops *VirtFs::RWopsOpenWrite(const char *const fname)
return create_rwops(VirtFs::openWrite(fname));
} /* RWopsopenWrite */
-SDL_RWops *VirtFs::RWopsOpenAppend(const char *const fname)
+SDL_RWops *VirtFs::RWopsOpenAppend(const std::string &restrict fname)
{
#ifdef __APPLE__
if (!checkFilePath(fname))