summaryrefslogtreecommitdiffhomepage
path: root/serialize
diff options
context:
space:
mode:
Diffstat (limited to 'serialize')
-rw-r--r--serialize/json-helper.cpp2
-rw-r--r--serialize/world-reader.cpp5
-rw-r--r--serialize/world-writer.cpp7
3 files changed, 7 insertions, 7 deletions
diff --git a/serialize/json-helper.cpp b/serialize/json-helper.cpp
index 538bcdcb..5504ff52 100644
--- a/serialize/json-helper.cpp
+++ b/serialize/json-helper.cpp
@@ -8,7 +8,7 @@ static T open_stream(StringView filename)
{
T s;
s.exceptions(s.exceptions() | std::ios::failbit | std::ios::badbit);
- s.open(filename, mode);
+ s.open(filename.data(), mode);
return s;
}
diff --git a/serialize/world-reader.cpp b/serialize/world-reader.cpp
index e55ea059..615aba0d 100644
--- a/serialize/world-reader.cpp
+++ b/serialize/world-reader.cpp
@@ -118,10 +118,11 @@ world world::deserialize(StringView filename)
{
char errbuf[128];
constexpr auto strerror = []<std::size_t N> (char (&buf)[N]) -> const char* {
+ buf[0] = '\0';
#ifndef _WIN32
- ::strerror_r(errno, buf, std::size(buf));
+ (void)::strerror_r(errno, buf, std::size(buf));
#else
- ::strerror_s(buf, std::size(buf), errno);
+ (void)::strerror_s(buf, std::size(buf), errno);
#endif
return buf;
};
diff --git a/serialize/world-writer.cpp b/serialize/world-writer.cpp
index c33947dc..7e89c508 100644
--- a/serialize/world-writer.cpp
+++ b/serialize/world-writer.cpp
@@ -12,8 +12,6 @@
#include <Corrade/Containers/StringView.h>
#include <Corrade/Utility/Path.h>
-namespace Path = Corrade::Utility::Path;
-
namespace floormat::Serialize {
struct interned_atlas final {
@@ -256,10 +254,11 @@ void world::serialize(StringView filename)
collect(true);
char errbuf[128];
constexpr auto strerror = []<std::size_t N> (char (&buf)[N]) -> const char* {
+ buf[0] = '\0';
#ifndef _WIN32
- ::strerror_r(errno, buf, std::size(buf));
+ (void)::strerror_r(errno, buf, std::size(buf));
#else
- ::strerror_s(buf, std::size(buf), errno);
+ (void)::strerror_s(buf, std::size(buf), errno);
#endif
return buf;
};