diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 25eae4113..dee9443bd 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -2044,34 +2044,34 @@ const Function* Type::getFunction(const std::string& funcName) const return 0; } -bool Type::hasCircularDependencies(std::set* anchestors) const +bool Type::hasCircularDependencies(std::set* ancestors) const { - std::set knownAnchestors; - if (!anchestors) { - anchestors=&knownAnchestors; + std::set knownAncestors; + if (!ancestors) { + ancestors=&knownAncestors; } for (std::vector::const_iterator parent=derivedFrom.begin(); parent!=derivedFrom.end(); ++parent) { if (!parent->type) continue; else if (this==parent->type) return true; - else if (anchestors->find(*parent)!=anchestors->end()) + else if (ancestors->find(*parent)!=ancestors->end()) return true; else { - anchestors->insert(*parent); - if (parent->type->hasCircularDependencies(anchestors)) + ancestors->insert(*parent); + if (parent->type->hasCircularDependencies(ancestors)) return true; } } return false; } -bool Type::findDependency(const Type* anchestor) const +bool Type::findDependency(const Type* ancestor) const { - if (this==anchestor) + if (this==ancestor) return true; for (std::vector::const_iterator parent=derivedFrom.begin(); parent!=derivedFrom.end(); ++parent) { - if (parent->type && parent->type->findDependency(anchestor)) + if (parent->type && parent->type->findDependency(ancestor)) return true; } return false; diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index 33ae58862..f38858839 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -119,17 +119,17 @@ public: /** * Check for circulare dependencies, i.e. loops within the class hierarchie - * @param anchestors list of anchestors. For internal usage only, clients should not supply this argument. + * @param ancestors list of ancestors. For internal usage only, clients should not supply this argument. * @return true if there is a circular dependency */ - bool hasCircularDependencies(std::set* anchestors = nullptr) const; + bool hasCircularDependencies(std::set* ancestors = nullptr) const; /** * Check for dependency - * @param anchestor potential anchestor + * @param ancestor potential ancestor * @return true if there is a dependency */ - bool findDependency(const Type* anchestor) const; + bool findDependency(const Type* ancestor) const; }; /** @brief Information about a member variable. */