Base: Use isBad() instead of comparing types with ==
This commit is contained in:
@@ -56,11 +56,11 @@ BaseClass::~BaseClass() = default;
|
||||
|
||||
void BaseClass::init()
|
||||
{
|
||||
assert(BaseClass::classTypeId == Type::badType() && "don't init() twice!");
|
||||
assert(BaseClass::classTypeId.isBad() && "don't init() twice!");
|
||||
/* Make sure superclass gets initialized before subclass. */
|
||||
/*assert(strcmp(#_parentclass_), "inherited"));*/
|
||||
/*Type parentType(Type::fromName(#_parentclass_));*/
|
||||
/*assert(parentType != Type::badType() && "you forgot init() on parentclass!");*/
|
||||
/*assert(!parentType.isBad() && "you forgot init() on parentclass!");*/
|
||||
|
||||
/* Set up entry in the type system. */
|
||||
BaseClass::classTypeId =
|
||||
@@ -84,11 +84,11 @@ void BaseClass::initSubclass(Base::Type& toInit,
|
||||
Type::instantiationMethod method)
|
||||
{
|
||||
// don't init twice!
|
||||
assert(toInit == Base::Type::badType());
|
||||
assert(toInit.isBad());
|
||||
// get the parent class
|
||||
Base::Type parentType(Base::Type::fromName(ParentName));
|
||||
// forgot init parent!
|
||||
assert(parentType != Base::Type::badType());
|
||||
assert(!parentType.isBad());
|
||||
|
||||
// create the new type
|
||||
toInit = Base::Type::createType(parentType, ClassName, method);
|
||||
|
||||
Reference in New Issue
Block a user