summaryrefslogtreecommitdiffhomepage
path: root/serialize
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-10 17:01:30 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-10 22:17:43 +0100
commit0e23ba9e5a565e34fee0f024e29ce162f420ec22 (patch)
treeeeaf0ec198ba8849117c9c21675a651e8c93acad /serialize
parent67f0ff04d0fb71255d35bf7f31a684d7a2120c2a (diff)
add github action
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;
};