modernize C++: use nullptr

This commit is contained in:
wmayer
2023-08-05 16:52:01 +02:00
committed by Chris Hennes
parent aa53596289
commit d244dcf2da
12 changed files with 242 additions and 137 deletions

View File

@@ -480,7 +480,7 @@ bool ParameterGrp::HasGroup(const char* Name) const
if (_GroupMap.find(Name) != _GroupMap.end())
return true;
if (_pGroupNode && FindElement(_pGroupNode,"FCParamGroup",Name) != 0)
if (_pGroupNode && FindElement(_pGroupNode,"FCParamGroup",Name) != nullptr)
return true;
return false;
@@ -1246,7 +1246,7 @@ void ParameterGrp::Clear(bool notify)
// Remove the rest of non-group nodes;
std::vector<std::pair<ParamType, std::string>> params;
for (DOMNode *child = _pGroupNode->getFirstChild(), *next = child; child != 0; child = next) {
for (DOMNode *child = _pGroupNode->getFirstChild(), *next = child; child != nullptr; child = next) {
next = next->getNextSibling();
ParamType type = TypeValue(StrX(child->getNodeName()).c_str());
if (type != ParamType::FCInvalid && type != ParamType::FCGroup)
@@ -1354,7 +1354,7 @@ ParameterGrp::GetParameterNames(const char * sFilter) const
std::string Name;
for (DOMNode *clChild = _pGroupNode->getFirstChild();
clChild != 0; clChild = clChild->getNextSibling()) {
clChild != nullptr; clChild = clChild->getNextSibling()) {
if (clChild->getNodeType() == DOMNode::ELEMENT_NODE) {
StrX type(clChild->getNodeName());
ParamType Type = TypeValue(type.c_str());

View File

@@ -153,13 +153,13 @@ public:
std::string &Value,
const char *Default) const;
std::vector<std::pair<std::string, std::string>>
GetAttributeMap(ParamType Type, const char * sFilter = NULL) const;
GetAttributeMap(ParamType Type, const char * sFilter = nullptr) const;
/** Return the type and name of all parameters with optional filter
* @param sFilter only strings which name includes sFilter are put in the vector
* @return std::vector of pair(type, name)
*/
std::vector<std::pair<ParamType,std::string>>
GetParameterNames(const char * sFilter = NULL) const;
GetParameterNames(const char * sFilter = nullptr) const;
//@}
/** @name methods for bool handling */