summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/concepts.h4
-rw-r--r--src/common/dynamic_library.cpp2
-rw-r--r--src/common/file_util.cpp4
-rw-r--r--src/common/time_zone.cpp14
-rw-r--r--src/video_core/renderer_vulkan/wrapper.cpp2
5 files changed, 15 insertions, 11 deletions
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
7namespace Common {
8
9#include <type_traits> 7#include <type_traits>
10 8
9namespace Common {
10
11// Check if type is like an STL container 11// Check if type is like an STL container
12template <typename T> 12template <typename T>
13concept IsSTLContainer = requires(T t) { 13concept 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 {
21DynamicLibrary::DynamicLibrary() = default; 21DynamicLibrary::DynamicLibrary() = default;
22 22
23DynamicLibrary::DynamicLibrary(const char* filename) { 23DynamicLibrary::DynamicLibrary(const char* filename) {
24 Open(filename); 24 void(Open(filename));
25} 25}
26 26
27DynamicLibrary::DynamicLibrary(DynamicLibrary&& rhs) noexcept 27DynamicLibrary::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
912IOFile::IOFile() {} 912IOFile::IOFile() = default;
913 913
914IOFile::IOFile(const std::string& filename, const char openmode[], int flags) { 914IOFile::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
918IOFile::~IOFile() { 918IOFile::~IOFile() {
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
19static std::string GetOsTimeZoneOffset() { 18static 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
24static int ConvertOsTimeZoneOffsetToInt(const std::string& timezone) { 28static int ConvertOsTimeZoneOffsetToInt(const std::string& timezone) {
diff --git a/src/video_core/renderer_vulkan/wrapper.cpp b/src/video_core/renderer_vulkan/wrapper.cpp
index c43d60adf..013865aa4 100644
--- a/src/video_core/renderer_vulkan/wrapper.cpp
+++ b/src/video_core/renderer_vulkan/wrapper.cpp
@@ -786,7 +786,7 @@ std::optional<std::vector<VkExtensionProperties>> EnumerateInstanceExtensionProp
786 VK_SUCCESS) { 786 VK_SUCCESS) {
787 return std::nullopt; 787 return std::nullopt;
788 } 788 }
789 return properties; 789 return std::move(properties);
790} 790}
791 791
792std::optional<std::vector<VkLayerProperties>> EnumerateInstanceLayerProperties( 792std::optional<std::vector<VkLayerProperties>> EnumerateInstanceLayerProperties(