diff --git a/src/kiwano-physics/Global.cpp b/src/kiwano-physics/Global.cpp index ce6eeeba..4c6ee2da 100644 --- a/src/kiwano-physics/Global.cpp +++ b/src/kiwano-physics/Global.cpp @@ -18,7 +18,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#pragma once #include namespace kiwano diff --git a/src/kiwano/2d/action/Action.cpp b/src/kiwano/2d/action/Action.cpp index 6dc75105..796fc25b 100644 --- a/src/kiwano/2d/action/Action.cpp +++ b/src/kiwano/2d/action/Action.cpp @@ -65,6 +65,9 @@ void Action::UpdateStep(Actor* target, Duration dt) case Status::Started: Update(target, dt); break; + + default: + break; } if (status_ == Status::Done) diff --git a/src/kiwano/core/Any.h b/src/kiwano/core/Any.h index f530ddb1..461895bf 100644 --- a/src/kiwano/core/Any.h +++ b/src/kiwano/core/Any.h @@ -73,9 +73,9 @@ public: /// \~chinese /// @brief 获取含有对象类型 - inline const type_info& GetType() const noexcept + inline const std::type_info& GetType() const noexcept { - const type_info* const info = GetTypeinfo(); + const std::type_info* const info = GetTypeinfo(); if (info) { return *info; @@ -132,7 +132,7 @@ public: { static_assert(!std::is_void<_Ty>::value, "oc::Any cannot contain void"); - const type_info* const info = GetTypeinfo(); + const std::type_info* const info = GetTypeinfo(); if (info && (*info == typeid(std::decay<_Ty>::type))) { if (HasSmallType()) @@ -193,12 +193,12 @@ public: } private: - const type_info*& GetTypeinfo() + const std::type_info*& GetTypeinfo() { return storage_.small_.info_; } - const type_info* GetTypeinfo() const + const std::type_info* GetTypeinfo() const { return storage_.small_.info_; } @@ -430,14 +430,14 @@ private: private: struct SmallStorage { - const type_info* info_; + const std::type_info* info_; SmallStorageRTTI rtti_; char buffer_[ANY_SMALL_SPACE_SIZE]; }; struct BigStorage { - const type_info* info_; + const std::type_info* info_; BigStorageRTTI rtti_; void* ptr_; }; diff --git a/src/kiwano/core/Function.h b/src/kiwano/core/Function.h index 0f85e1af..8cfcce51 100644 --- a/src/kiwano/core/Function.h +++ b/src/kiwano/core/Function.h @@ -75,9 +75,9 @@ public: virtual void Release() = 0; virtual _Ret Invoke(_Args&&... args) const = 0; - virtual const type_info& TargetType() const noexcept = 0; + virtual const std::type_info& TargetType() const noexcept = 0; - virtual const void* Target(const type_info& type) const noexcept = 0; + virtual const void* Target(const std::type_info& type) const noexcept = 0; }; template @@ -121,12 +121,12 @@ public: return std::invoke(callee_, std::forward<_Args>(args)...); } - virtual const type_info& TargetType() const noexcept + virtual const std::type_info& TargetType() const noexcept { return typeid(_Ty); } - virtual const void* Target(const type_info& type) const noexcept + virtual const void* Target(const std::type_info& type) const noexcept { if (type == this->TargetType()) return &callee_; @@ -153,12 +153,12 @@ public: return std::invoke(func_, ptr_, std::forward<_Args>(args)...); } - virtual const type_info& TargetType() const noexcept + virtual const std::type_info& TargetType() const noexcept { return typeid(ProxyMemCallable); } - virtual const void* Target(const type_info& type) const noexcept + virtual const void* Target(const std::type_info& type) const noexcept { if (type == this->TargetType()) return this; @@ -193,12 +193,12 @@ public: return std::invoke(func_, ptr_, std::forward<_Args>(args)...); } - virtual const type_info& TargetType() const noexcept + virtual const std::type_info& TargetType() const noexcept { return typeid(ProxyConstMemCallable); } - virtual const void* Target(const type_info& type) const noexcept + virtual const void* Target(const std::type_info& type) const noexcept { if (type == this->TargetType()) return this; @@ -321,7 +321,7 @@ public: std::swap(callable_, rhs.callable_); } - const type_info& target_type() const noexcept + const std::type_info& target_type() const noexcept { return callable_->TargetType(); } diff --git a/src/kiwano/core/IntrusiveList.h b/src/kiwano/core/IntrusiveList.h index 3fe724ed..651e2830 100644 --- a/src/kiwano/core/IntrusiveList.h +++ b/src/kiwano/core/IntrusiveList.h @@ -246,13 +246,13 @@ public: } public: - template + template struct Iterator { using iterator_category = std::bidirectional_iterator_tag; - using value_type = _PtrTy; - using pointer = _PtrTy*; - using reference = _PtrTy&; + using value_type = _IterPtrTy; + using pointer = _IterPtrTy*; + using reference = _IterPtrTy&; using difference_type = ptrdiff_t; inline Iterator(value_type ptr = nullptr, bool is_end = false) diff --git a/src/kiwano/core/SmartPtr.hpp b/src/kiwano/core/SmartPtr.hpp index 9b1989fd..ad01496c 100644 --- a/src/kiwano/core/SmartPtr.hpp +++ b/src/kiwano/core/SmartPtr.hpp @@ -73,13 +73,13 @@ public: SmartPtr(pointer_type p) : ptr_(p) { - typename _ProxyTy::Retain(ptr_); + _ProxyTy::Retain(ptr_); } SmartPtr(const SmartPtr& other) : ptr_(other.ptr_) { - typename _ProxyTy::Retain(ptr_); + _ProxyTy::Retain(ptr_); } SmartPtr(SmartPtr&& other) noexcept @@ -97,7 +97,7 @@ public: SmartPtr(const SmartPtr<_UTy, _ProxyTy>& other) { ptr_ = const_cast(dynamic_cast(other.Get())); - typename _ProxyTy::Retain(ptr_); + _ProxyTy::Retain(ptr_); } inline pointer_type Get() noexcept @@ -193,7 +193,7 @@ public: private: void Tidy() { - typename _ProxyTy::Release(ptr_); + _ProxyTy::Release(ptr_); ptr_ = nullptr; } diff --git a/src/kiwano/render/Brush.h b/src/kiwano/render/Brush.h index 32992be7..f2e1648d 100644 --- a/src/kiwano/render/Brush.h +++ b/src/kiwano/render/Brush.h @@ -19,6 +19,7 @@ // THE SOFTWARE. #pragma once +#include #include #include