summaryrefslogtreecommitdiffstats
path: root/src/common/common_funcs.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-08-16 07:47:54 +0200
committerGitHub <noreply@github.com>2020-08-16 07:47:54 +0200
commitdb96034ea429cf0b0b5e2bac790392d9e2f50990 (patch)
tree9a1ed0bfc2d01d67d0f62383dbb2a1f4c9fb4eca /src/common/common_funcs.h
parentMerge pull request #4519 from lioncash/semi (diff)
parentcommon/compression: Roll back std::span changes (diff)
downloadyuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.tar
yuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.tar.gz
yuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.tar.bz2
yuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.tar.lz
yuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.tar.xz
yuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.tar.zst
yuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.zip
Diffstat (limited to 'src/common/common_funcs.h')
-rw-r--r--src/common/common_funcs.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index 88cf5250a..98421bced 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -53,14 +53,14 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
// Call directly after the command or use the error num.
// This function might change the error code.
// Defined in Misc.cpp.
-std::string GetLastErrorMsg();
+[[nodiscard]] std::string GetLastErrorMsg();
#define DECLARE_ENUM_FLAG_OPERATORS(type) \
- constexpr type operator|(type a, type b) noexcept { \
+ [[nodiscard]] constexpr type operator|(type a, type b) noexcept { \
using T = std::underlying_type_t<type>; \
return static_cast<type>(static_cast<T>(a) | static_cast<T>(b)); \
} \
- constexpr type operator&(type a, type b) noexcept { \
+ [[nodiscard]] constexpr type operator&(type a, type b) noexcept { \
using T = std::underlying_type_t<type>; \
return static_cast<type>(static_cast<T>(a) & static_cast<T>(b)); \
} \
@@ -74,22 +74,22 @@ std::string GetLastErrorMsg();
a = static_cast<type>(static_cast<T>(a) & static_cast<T>(b)); \
return a; \
} \
- constexpr type operator~(type key) noexcept { \
+ [[nodiscard]] constexpr type operator~(type key) noexcept { \
using T = std::underlying_type_t<type>; \
return static_cast<type>(~static_cast<T>(key)); \
} \
- constexpr bool True(type key) noexcept { \
+ [[nodiscard]] constexpr bool True(type key) noexcept { \
using T = std::underlying_type_t<type>; \
return static_cast<T>(key) != 0; \
} \
- constexpr bool False(type key) noexcept { \
+ [[nodiscard]] constexpr bool False(type key) noexcept { \
using T = std::underlying_type_t<type>; \
return static_cast<T>(key) == 0; \
}
namespace Common {
-constexpr u32 MakeMagic(char a, char b, char c, char d) {
+[[nodiscard]] constexpr u32 MakeMagic(char a, char b, char c, char d) {
return u32(a) | u32(b) << 8 | u32(c) << 16 | u32(d) << 24;
}