diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/common/concepts.h | 4 | ||||
| -rw-r--r-- | src/common/dynamic_library.cpp | 2 | ||||
| -rw-r--r-- | src/common/file_util.cpp | 4 | ||||
| -rw-r--r-- | src/common/telemetry.cpp | 4 | ||||
| -rw-r--r-- | src/common/telemetry.h | 4 | ||||
| -rw-r--r-- | src/common/time_zone.cpp | 14 | ||||
| -rw-r--r-- | src/common/web_result.h | 25 |
8 files changed, 18 insertions, 40 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 78c3bfb3b..5d54516eb 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -172,7 +172,6 @@ add_library(common STATIC | |||
| 172 | virtual_buffer.h | 172 | virtual_buffer.h |
| 173 | wall_clock.cpp | 173 | wall_clock.cpp |
| 174 | wall_clock.h | 174 | wall_clock.h |
| 175 | web_result.h | ||
| 176 | zstd_compression.cpp | 175 | zstd_compression.cpp |
| 177 | zstd_compression.h | 176 | zstd_compression.h |
| 178 | ) | 177 | ) |
diff --git a/src/common/concepts.h b/src/common/concepts.h index 54252e778..5bef3ad67 100644 --- a/src/common/concepts.h +++ b/src/common/concepts.h | |||
| @@ -4,10 +4,10 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | namespace Common { | ||
| 8 | |||
| 9 | #include <type_traits> | 7 | #include <type_traits> |
| 10 | 8 | ||
| 9 | namespace Common { | ||
| 10 | |||
| 11 | // Check if type is like an STL container | 11 | // Check if type is like an STL container |
| 12 | template <typename T> | 12 | template <typename T> |
| 13 | concept IsSTLContainer = requires(T t) { | 13 | concept IsSTLContainer = requires(T t) { |
diff --git a/src/common/dynamic_library.cpp b/src/common/dynamic_library.cpp index 7ab54e9e4..7f0a10521 100644 --- a/src/common/dynamic_library.cpp +++ b/src/common/dynamic_library.cpp | |||
| @@ -21,7 +21,7 @@ namespace Common { | |||
| 21 | DynamicLibrary::DynamicLibrary() = default; | 21 | DynamicLibrary::DynamicLibrary() = default; |
| 22 | 22 | ||
| 23 | DynamicLibrary::DynamicLibrary(const char* filename) { | 23 | DynamicLibrary::DynamicLibrary(const char* filename) { |
| 24 | Open(filename); | 24 | void(Open(filename)); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | DynamicLibrary::DynamicLibrary(DynamicLibrary&& rhs) noexcept | 27 | DynamicLibrary::DynamicLibrary(DynamicLibrary&& rhs) noexcept |
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index c869e7b82..16c3713e0 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp | |||
| @@ -909,10 +909,10 @@ std::string SanitizePath(std::string_view path_, DirectorySeparator directory_se | |||
| 909 | return std::string(RemoveTrailingSlash(path)); | 909 | return std::string(RemoveTrailingSlash(path)); |
| 910 | } | 910 | } |
| 911 | 911 | ||
| 912 | IOFile::IOFile() {} | 912 | IOFile::IOFile() = default; |
| 913 | 913 | ||
| 914 | IOFile::IOFile(const std::string& filename, const char openmode[], int flags) { | 914 | IOFile::IOFile(const std::string& filename, const char openmode[], int flags) { |
| 915 | Open(filename, openmode, flags); | 915 | void(Open(filename, openmode, flags)); |
| 916 | } | 916 | } |
| 917 | 917 | ||
| 918 | IOFile::~IOFile() { | 918 | IOFile::~IOFile() { |
diff --git a/src/common/telemetry.cpp b/src/common/telemetry.cpp index 16d42facd..6241d08b3 100644 --- a/src/common/telemetry.cpp +++ b/src/common/telemetry.cpp | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include "common/x64/cpu_detect.h" | 12 | #include "common/x64/cpu_detect.h" |
| 13 | #endif | 13 | #endif |
| 14 | 14 | ||
| 15 | namespace Telemetry { | 15 | namespace Common::Telemetry { |
| 16 | 16 | ||
| 17 | void FieldCollection::Accept(VisitorInterface& visitor) const { | 17 | void FieldCollection::Accept(VisitorInterface& visitor) const { |
| 18 | for (const auto& field : fields) { | 18 | for (const auto& field : fields) { |
| @@ -88,4 +88,4 @@ void AppendOSInfo(FieldCollection& fc) { | |||
| 88 | #endif | 88 | #endif |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | } // namespace Telemetry | 91 | } // namespace Common::Telemetry |
diff --git a/src/common/telemetry.h b/src/common/telemetry.h index 4aa299f9a..a50c5d1de 100644 --- a/src/common/telemetry.h +++ b/src/common/telemetry.h | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include <string> | 10 | #include <string> |
| 11 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 12 | 12 | ||
| 13 | namespace Telemetry { | 13 | namespace Common::Telemetry { |
| 14 | 14 | ||
| 15 | /// Field type, used for grouping fields together in the final submitted telemetry log | 15 | /// Field type, used for grouping fields together in the final submitted telemetry log |
| 16 | enum class FieldType : u8 { | 16 | enum class FieldType : u8 { |
| @@ -196,4 +196,4 @@ void AppendCPUInfo(FieldCollection& fc); | |||
| 196 | /// such as platform name, etc. | 196 | /// such as platform name, etc. |
| 197 | void AppendOSInfo(FieldCollection& fc); | 197 | void AppendOSInfo(FieldCollection& fc); |
| 198 | 198 | ||
| 199 | } // namespace Telemetry | 199 | } // namespace Common::Telemetry |
diff --git a/src/common/time_zone.cpp b/src/common/time_zone.cpp index 7aa1b59ea..ce239eb63 100644 --- a/src/common/time_zone.cpp +++ b/src/common/time_zone.cpp | |||
| @@ -3,9 +3,8 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <chrono> | 5 | #include <chrono> |
| 6 | #include <ctime> | 6 | #include <iomanip> |
| 7 | 7 | #include <sstream> | |
| 8 | #include <fmt/chrono.h> | ||
| 9 | 8 | ||
| 10 | #include "common/logging/log.h" | 9 | #include "common/logging/log.h" |
| 11 | #include "common/time_zone.h" | 10 | #include "common/time_zone.h" |
| @@ -17,8 +16,13 @@ std::string GetDefaultTimeZone() { | |||
| 17 | } | 16 | } |
| 18 | 17 | ||
| 19 | static std::string GetOsTimeZoneOffset() { | 18 | static std::string GetOsTimeZoneOffset() { |
| 20 | // Get the current timezone offset, e.g. "-400", as a string | 19 | const std::time_t t{std::time(nullptr)}; |
| 21 | return fmt::format("%z", fmt::localtime(std::time(nullptr))); | 20 | const std::tm tm{*std::localtime(&t)}; |
| 21 | |||
| 22 | std::stringstream ss; | ||
| 23 | ss << std::put_time(&tm, "%z"); // Get the current timezone offset, e.g. "-400", as a string | ||
| 24 | |||
| 25 | return ss.str(); | ||
| 22 | } | 26 | } |
| 23 | 27 | ||
| 24 | static int ConvertOsTimeZoneOffsetToInt(const std::string& timezone) { | 28 | static int ConvertOsTimeZoneOffsetToInt(const std::string& timezone) { |
diff --git a/src/common/web_result.h b/src/common/web_result.h deleted file mode 100644 index 8bfa2141d..000000000 --- a/src/common/web_result.h +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | // Copyright 2018 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <string> | ||
| 8 | #include "common/common_types.h" | ||
| 9 | |||
| 10 | namespace Common { | ||
| 11 | struct WebResult { | ||
| 12 | enum class Code : u32 { | ||
| 13 | Success, | ||
| 14 | InvalidURL, | ||
| 15 | CredentialsMissing, | ||
| 16 | LibError, | ||
| 17 | HttpError, | ||
| 18 | WrongContent, | ||
| 19 | NoWebservice, | ||
| 20 | }; | ||
| 21 | Code result_code; | ||
| 22 | std::string result_string; | ||
| 23 | std::string returned_data; | ||
| 24 | }; | ||
| 25 | } // namespace Common | ||