From 0e23ba9e5a565e34fee0f024e29ce162f420ec22 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 10 Nov 2022 17:01:30 +0100 Subject: add github action --- serialize/json-helper.cpp | 2 +- serialize/world-reader.cpp | 5 +++-- serialize/world-writer.cpp | 7 +++---- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'serialize') 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 = [] (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 #include -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 = [] (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; }; -- cgit v1.2.3