diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-07-22 11:52:10 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-07-24 00:43:04 +0200 |
commit | a926817c81a80842a52191a7358e9bb64ab3cf80 (patch) | |
tree | 198ff643997d08e59138fdcd5110a201ac1351d6 | |
parent | b0d763d032a122bbf0465fa37a2eaaff3fd3a916 (diff) |
minor cleanups
-rw-r--r-- | cmake/msvc.cmake | 4 | ||||
-rw-r--r-- | compat/macros.hpp | 10 | ||||
-rw-r--r-- | dinput/dinput.hpp | 4 | ||||
-rw-r--r-- | options/tie.hpp | 1 |
4 files changed, 10 insertions, 9 deletions
diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake index 0aad2ac8..7cb139f0 100644 --- a/cmake/msvc.cmake +++ b/cmake/msvc.cmake @@ -35,8 +35,10 @@ if(CMAKE_PROJECT_NAME STREQUAL "opentrack") endif() endforeach() + # C4265: class has virtual functions, but destructor is not virtual set(warns 4265) - set(warns-noerr) + # C4005: macro redefinition + set(warns-noerr 4005) foreach(i ${warns-disable}) set(warns_ "${warns_} -wd${i}") diff --git a/compat/macros.hpp b/compat/macros.hpp index 465a7d24..856d2293 100644 --- a/compat/macros.hpp +++ b/compat/macros.hpp @@ -75,7 +75,7 @@ using to_const_lvalue_reference_t = remove_cvref_t<t> const&; #define eval_once__2(expr, ident) eval_once__3(expr, ident) #define eval_once__3(expr, ident) \ - ([&]() -> decltype(auto) { \ + ([&]() -> decltype(auto) { \ static auto INIT##ident = (expr); \ return static_cast<to_const_lvalue_reference_t<decltype(INIT##ident)>>(INIT##ident); \ }()) @@ -96,13 +96,13 @@ constexpr cc_forceinline void static_warn<true>() {} #define static_warning(cond) \ static_warn<(cond)>(); \ -#define typed_progn(type, ...) (([&]() -> type { __VA_ARGS__ })()) -#define progn(...) (([&]() -> decltype(auto) { __VA_ARGS__ })()) +#define typed_progn(type, ...) ([&]() -> type { __VA_ARGS__ }()) +#define progn(...) ([&]() -> decltype(auto) { __VA_ARGS__ }()) -#define prog1(x, ...) (([&]() -> to_const_lvalue_reference_t<decltype((x))> \ +#define prog1(x, ...) ([&]() -> decltype(auto) \ { \ decltype(auto) ret1324 = (x); __VA_ARGS__; return ret1324; \ - })()) + }()) // end c++-only macros #endif diff --git a/dinput/dinput.hpp b/dinput/dinput.hpp index 4806a992..c9c55349 100644 --- a/dinput/dinput.hpp +++ b/dinput/dinput.hpp @@ -33,14 +33,14 @@ public: di_t(); ~di_t(); di_t(const di_t&) : di_t() {} - di_t& operator=(const di_t&) { return *this; } + di_t& operator=(const di_t&) = default; diptr operator->() const { return handle; } operator bool() { return handle; } // for debugging bad usages template<typename t = void> - operator void*() const + explicit operator void*() const { static_assert(sizeof(t) == -1); static_assert(sizeof(t) == 0); diff --git a/options/tie.hpp b/options/tie.hpp index aa83c7cb..4f224f23 100644 --- a/options/tie.hpp +++ b/options/tie.hpp @@ -11,7 +11,6 @@ #include "export.hpp" #include "value.hpp" #include "compat/run-in-thread.hpp" -#include "compat/meta.hpp" #include <QComboBox> #include <QCheckBox> |