From 923574eed5eea883374e5ef90e083205b1cb272a Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Wed, 18 Jul 2018 15:26:19 +0200 Subject: [PATCH] Rename IsNXTBitMask and NxtReference/Release to dawn --- generator/templates/apicpp.cpp | 4 ++-- generator/templates/apicpp.h | 12 ++++++------ src/include/dawn/EnumClassBitmasks.h | 10 +++++----- src/tests/unittests/EnumClassBitmasksTests.cpp | 2 +- src/tests/unittests/ObjectBaseTests.cpp | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/generator/templates/apicpp.cpp b/generator/templates/apicpp.cpp index 6c6dec831e..c296399aa0 100644 --- a/generator/templates/apicpp.cpp +++ b/generator/templates/apicpp.cpp @@ -112,12 +112,12 @@ namespace dawn { {% endif %} } {% endfor %} - void {{CppType}}::NxtReference({{CType}} handle) { + void {{CppType}}::DawnReference({{CType}} handle) { if (handle != nullptr) { {{as_cMethod(type.name, Name("reference"))}}(handle); } } - void {{CppType}}::NxtRelease({{CType}} handle) { + void {{CppType}}::DawnRelease({{CType}} handle) { if (handle != nullptr) { {{as_cMethod(type.name, Name("release"))}}(handle); } diff --git a/generator/templates/apicpp.h b/generator/templates/apicpp.h index 3c46343c2d..8aa88ab111 100644 --- a/generator/templates/apicpp.h +++ b/generator/templates/apicpp.h @@ -41,7 +41,7 @@ namespace dawn { {% for type in by_category["bitmask"] %} template<> - struct IsNXTBitmask<{{as_cppType(type.name)}}> { + struct IsDawnBitmask<{{as_cppType(type.name)}}> { static constexpr bool enable = true; }; @@ -72,10 +72,10 @@ namespace dawn { public: ObjectBase() = default; ObjectBase(CType handle): mHandle(handle) { - if (mHandle) Derived::NxtReference(mHandle); + if (mHandle) Derived::DawnReference(mHandle); } ~ObjectBase() { - if (mHandle) Derived::NxtRelease(mHandle); + if (mHandle) Derived::DawnRelease(mHandle); } ObjectBase(ObjectBase const& other) = delete; @@ -88,7 +88,7 @@ namespace dawn { Derived& operator=(ObjectBase&& other) { if (&other == this) return static_cast(*this); - if (mHandle) Derived::NxtRelease(mHandle); + if (mHandle) Derived::DawnRelease(mHandle); mHandle = other.mHandle; other.mHandle = 0; @@ -152,8 +152,8 @@ namespace dawn { private: friend ObjectBase<{{CppType}}, {{CType}}>; - static void NxtReference({{CType}} handle); - static void NxtRelease({{CType}} handle); + static void DawnReference({{CType}} handle); + static void DawnRelease({{CType}} handle); }; {% endfor %} diff --git a/src/include/dawn/EnumClassBitmasks.h b/src/include/dawn/EnumClassBitmasks.h index 8efd6edb15..7e1d769a9b 100644 --- a/src/include/dawn/EnumClassBitmasks.h +++ b/src/include/dawn/EnumClassBitmasks.h @@ -39,7 +39,7 @@ namespace dawn { #endif template - struct IsNXTBitmask { + struct IsDawnBitmask { static constexpr bool enable = false; }; @@ -49,7 +49,7 @@ namespace dawn { }; template - struct LowerBitmask::enable>::type> { + struct LowerBitmask::enable>::type> { static constexpr bool enable = true; using type = T; constexpr static T Lower(T t) { @@ -130,7 +130,7 @@ namespace dawn { template ::enable && + typename = typename std::enable_if::enable && LowerBitmask::enable>::type> constexpr T& operator&=(T& l, T2 right) { T r = LowerBitmask::Lower(right); @@ -140,7 +140,7 @@ namespace dawn { template ::enable && + typename = typename std::enable_if::enable && LowerBitmask::enable>::type> constexpr T& operator|=(T& l, T2 right) { T r = LowerBitmask::Lower(right); @@ -150,7 +150,7 @@ namespace dawn { template ::enable && + typename = typename std::enable_if::enable && LowerBitmask::enable>::type> constexpr T& operator^=(T& l, T2 right) { T r = LowerBitmask::Lower(right); diff --git a/src/tests/unittests/EnumClassBitmasksTests.cpp b/src/tests/unittests/EnumClassBitmasksTests.cpp index 1258f093bd..ce3317a0a2 100644 --- a/src/tests/unittests/EnumClassBitmasksTests.cpp +++ b/src/tests/unittests/EnumClassBitmasksTests.cpp @@ -26,7 +26,7 @@ namespace dawn { }; template<> - struct IsNXTBitmask { + struct IsDawnBitmask { static constexpr bool enable = true; }; diff --git a/src/tests/unittests/ObjectBaseTests.cpp b/src/tests/unittests/ObjectBaseTests.cpp index 2225dbd533..1e6058a24f 100644 --- a/src/tests/unittests/ObjectBaseTests.cpp +++ b/src/tests/unittests/ObjectBaseTests.cpp @@ -21,11 +21,11 @@ class Object : public dawn::ObjectBase { using ObjectBase::ObjectBase; using ObjectBase::operator=; - static void NxtReference(int* handle) { + static void DawnReference(int* handle) { ASSERT_LT(0, *handle); *handle += 1; } - static void NxtRelease(int* handle) { + static void DawnRelease(int* handle) { ASSERT_LT(0, *handle); *handle -= 1; }