From 04a0d13ec2047be5987d08f1b281fdae4610d87a Mon Sep 17 00:00:00 2001 From: Benjamin Nauck Date: Thu, 13 Feb 2025 22:10:53 +0100 Subject: [PATCH] App: Use constant for Type::BadType instead Type::badType() --- src/App/Extension.cpp | 2 +- src/App/Extension.h | 6 +++--- src/App/ProjectFile.cpp | 4 ++-- src/App/PropertyContainer.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/App/Extension.cpp b/src/App/Extension.cpp index 25a6032a2e..44170f5988 100644 --- a/src/App/Extension.cpp +++ b/src/App/Extension.cpp @@ -58,7 +58,7 @@ void App::Extension::init() /* Set up entry in the type system. */ Extension::classTypeId = - Base::Type::createType(Base::Type::badType(), "App::Extension", Extension::create); + Base::Type::createType(Base::Type::BadType, "App::Extension", Extension::create); } using namespace App; diff --git a/src/App/Extension.h b/src/App/Extension.h index 7c1545435e..09672b4816 100644 --- a/src/App/Extension.h +++ b/src/App/Extension.h @@ -56,7 +56,7 @@ private: \ #define EXTENSION_TYPESYSTEM_SOURCE_P(_class_) \ Base::Type _class_::getExtensionClassTypeId(void) { return _class_::classTypeId; } \ Base::Type _class_::getExtensionTypeId(void) const { return _class_::classTypeId; } \ -Base::Type _class_::classTypeId = Base::Type::badType(); \ +Base::Type _class_::classTypeId = Base::Type::BadType; \ void * _class_::create(void){\ return new _class_ ();\ } @@ -65,7 +65,7 @@ void * _class_::create(void){\ #define EXTENSION_TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \ Base::Type _class_::getExtensionClassTypeId(void) { return _class_::classTypeId; } \ Base::Type _class_::getExtensionTypeId(void) const { return _class_::classTypeId; } \ -Base::Type _class_::classTypeId = Base::Type::badType(); \ +Base::Type _class_::classTypeId = Base::Type::BadType; \ void * _class_::create(void){return 0;} /// define to implement a subclass of Base::BaseClass @@ -76,7 +76,7 @@ void _class_::init(void){\ } #define EXTENSION_TYPESYSTEM_SOURCE_TEMPLATE(_class_) \ -template<> Base::Type _class_::classTypeId = Base::Type::badType(); \ +template<> Base::Type _class_::classTypeId = Base::Type::BadType; \ template<> Base::Type _class_::getExtensionClassTypeId(void) { return _class_::classTypeId; } \ template<> Base::Type _class_::getExtensionTypeId(void) const { return _class_::classTypeId; } \ template<> void * _class_::create(void){\ diff --git a/src/App/ProjectFile.cpp b/src/App/ProjectFile.cpp index 7cc7490100..2363111746 100644 --- a/src/App/ProjectFile.cpp +++ b/src/App/ProjectFile.cpp @@ -363,7 +363,7 @@ Base::Type ProjectFile::getTypeId(const std::string& name) const // // if (!xmlDocument) { - return Base::Type::badType(); + return Base::Type::BadType; } DOMNodeList* nodes = xmlDocument->getElementsByTagName(XStrLiteral("Objects").unicodeForm()); @@ -388,7 +388,7 @@ Base::Type ProjectFile::getTypeId(const std::string& name) const } } - return Base::Type::badType(); + return Base::Type::BadType; } std::list ProjectFile::getPropertyFiles(const std::string& name) const diff --git a/src/App/PropertyContainer.h b/src/App/PropertyContainer.h index 5a6b7647ae..078b745771 100644 --- a/src/App/PropertyContainer.h +++ b/src/App/PropertyContainer.h @@ -375,7 +375,7 @@ void _class_::init(void){\ } #define TYPESYSTEM_SOURCE_TEMPLATE(_class_) \ -template<> Base::Type _class_::classTypeId = Base::Type::badType(); \ +template<> Base::Type _class_::classTypeId = Base::Type::BadType; \ template<> Base::Type _class_::getClassTypeId(void) { return _class_::classTypeId; } \ template<> Base::Type _class_::getTypeId(void) const { return _class_::classTypeId; } \ template<> void * _class_::create(void){\