From 154025a2c89c05b490b41fcada6dc0a6b6829a08 Mon Sep 17 00:00:00 2001 From: Foster Brereton Date: Fri, 28 Jun 2024 10:01:56 -0700 Subject: [PATCH 1/2] Fixing some symbol names and compilation breaks in other code --- adobe/enum_ops.hpp | 17 +++++++++-------- adobe/widget_attributes.hpp | 8 ++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/adobe/enum_ops.hpp b/adobe/enum_ops.hpp index 611001b4..773c337f 100644 --- a/adobe/enum_ops.hpp +++ b/adobe/enum_ops.hpp @@ -9,6 +9,7 @@ #define ADOBE_ENUM_OPS_HPP /**************************************************************************************************/ + #include /**************************************************************************************************/ @@ -25,11 +26,11 @@ defined for an enumeration type, \c E, the result will be of type \c E exactly when the operand(s) are of type \c E. - \c ADOBE_DEFINE_BITSET_OPS(E) or auto stlab_enable_bitmask_enum(E) -> std::true_type; + \c ADOBE_DEFINE_BITSET_OPS(E) or auto adobe_enable_bitmask_enum(E) -> std::true_type; enables the bitset operations ~, |, &, ^, |=, &=, ^= for enumeration type \c E. - \c ADOBE_DEFINE_ARITHMETIC_OPS(E) or auto stlab_enable_arithmetic_enum(E) -> std::true_type; + \c ADOBE_DEFINE_ARITHMETIC_OPS(E) or auto adobe_enable_arithmetic_enum(E) -> std::true_type; enables the typesafe arithmetic operations +, -, *, /, %, +=, *=, -=, /=, \%= for enumeration type \c E. @@ -58,8 +59,8 @@ namespace adobe { /**************************************************************************************************/ -auto stlab_enable_bitmask_enum(...) -> std::false_type; -auto stlab_enable_arithmetic_enum(...) -> std::false_type; +auto adobe_enable_bitmask_enum(...) -> std::false_type; +auto adobe_enable_arithmetic_enum(...) -> std::false_type; /**************************************************************************************************/ @@ -69,10 +70,10 @@ namespace implementation { #if !defined(ADOBE_NO_DOCUMENTATION) template -constexpr bool has_enabled_bitmask = decltype(stlab_enable_bitmask_enum(std::declval()))::value; +constexpr bool has_enabled_bitmask = decltype(adobe_enable_bitmask_enum(std::declval()))::value; template constexpr bool has_enabled_arithmetic = - decltype(stlab_enable_arithmetic_enum(std::declval()))::value; + decltype(adobe_enable_arithmetic_enum(std::declval()))::value; #endif /**************************************************************************************************/ @@ -87,7 +88,7 @@ constexpr bool has_enabled_arithmetic = // this exist to mantain backwards compatability with the old ops #define ADOBE_DEFINE_BITSET_OPS(EnumType) \ - constexpr auto stlab_enable_bitmask_enum(EnumType)->std::true_type; + constexpr auto adobe_enable_bitmask_enum(EnumType)->std::true_type; template @@ -138,7 +139,7 @@ constexpr auto operator|=(T& lhs, const T rhs) // this exist to mantain backwards compatability with the old ops #define ADOBE_DEFINE_ARITHMETIC_OPS(EnumType) \ - constexpr auto stlab_enable_arithmetic_enum(EnumType)->std::true_type; + constexpr auto adobe_enable_arithmetic_enum(EnumType)->std::true_type; template constexpr auto operator+(const T a) -> std::enable_if_t, T> { diff --git a/adobe/widget_attributes.hpp b/adobe/widget_attributes.hpp index a25c8d37..0d27330d 100644 --- a/adobe/widget_attributes.hpp +++ b/adobe/widget_attributes.hpp @@ -84,7 +84,7 @@ ADOBE_DEFINE_BITSET_OPS(theme_t) behaviors */ -enum modifiers_t { +enum modifiers_t : std::uint32_t { /// No modifiers modifiers_none_s = 0, @@ -114,13 +114,13 @@ enum modifiers_t { modifiers_any_command_s = 1 << 7, /// Any shift key - modifiers_any_shift_s = modifiers_left_shift_s | modifiers_right_shift_s, + modifiers_any_shift_s = static_cast>(modifiers_left_shift_s) | static_cast>(modifiers_right_shift_s), /// Any option (or alt) key (if applicable) - modifiers_any_option_s = modifiers_left_option_s | modifiers_right_option_s, + modifiers_any_option_s = static_cast>(modifiers_left_option_s) | static_cast>(modifiers_right_option_s), /// Any control key (if applicable) - modifiers_any_control_s = modifiers_left_control_s | modifiers_right_control_s, + modifiers_any_control_s = static_cast>(modifiers_left_control_s) | static_cast>(modifiers_right_control_s), modifiers_all_s = UINT_MAX }; From 200a3ceb45c107cfe3e3aac08cbc3b56a17a07f2 Mon Sep 17 00:00:00 2001 From: Foster Brereton Date: Fri, 28 Jun 2024 10:19:57 -0700 Subject: [PATCH 2/2] fixing test --- test/unit_tests/enum_ops/enum_ops_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit_tests/enum_ops/enum_ops_test.cpp b/test/unit_tests/enum_ops/enum_ops_test.cpp index 6016495a..e107cf15 100644 --- a/test/unit_tests/enum_ops/enum_ops_test.cpp +++ b/test/unit_tests/enum_ops/enum_ops_test.cpp @@ -39,7 +39,7 @@ enum class Num : int { num_7 = 7 }; -auto stlab_enable_bitmask_enum(Views) -> std::true_type; +auto adobe_enable_bitmask_enum(Views) -> std::true_type; ADOBE_DEFINE_BITSET_OPS(Number) @@ -89,7 +89,7 @@ BOOST_AUTO_TEST_CASE(enumclass_bitset_ops) { ADOBE_DEFINE_ARITHMETIC_OPS(Number) -auto stlab_enable_arithmetic_enum(Num) -> std::true_type; +auto adobe_enable_arithmetic_enum(Num) -> std::true_type; BOOST_AUTO_TEST_CASE(enum_arith_ops) { Number x;