App: modernize C++11

* use nullptr
This commit is contained in:
wmayer
2022-03-23 17:29:23 +01:00
parent 4183c45a01
commit 1a20b7f119
67 changed files with 647 additions and 643 deletions

View File

@@ -39,7 +39,7 @@ using namespace App;
PROPERTY_SOURCE(App::FeatureTest, App::DocumentObject)
const char* enums[]= {"Zero","One","Two","Three","Four",NULL};
const char* enums[]= {"Zero","One","Two","Three","Four",nullptr};
const PropertyIntegerConstraint::Constraints intPercent = {0,100,1};
const PropertyFloatConstraint::Constraints floatPercent = {0.0,100.0,1.0};
@@ -74,10 +74,10 @@ FeatureTest::FeatureTest()
ADD_PROPERTY(IntegerList,(4711) );
ADD_PROPERTY(FloatList ,(47.11f) );
ADD_PROPERTY(Link ,(0));
ADD_PROPERTY(LinkSub ,(0));
ADD_PROPERTY(LinkList ,(0));
ADD_PROPERTY(LinkSubList,(0));
ADD_PROPERTY(Link ,(nullptr));
ADD_PROPERTY(LinkSub ,(nullptr));
ADD_PROPERTY(LinkList ,(nullptr));
ADD_PROPERTY(LinkSubList,(nullptr));
ADD_PROPERTY(Vector ,(1.0,2.0,3.0));
ADD_PROPERTY(VectorList,(3.0,2.0,1.0));
@@ -86,9 +86,9 @@ FeatureTest::FeatureTest()
// properties for recompute testing
static const char* group = "Feature Test";
ADD_PROPERTY_TYPE(Source1 ,(0),group,Prop_None,"Source for testing links");
ADD_PROPERTY_TYPE(Source2 ,(0),group,Prop_None,"Source for testing links");
ADD_PROPERTY_TYPE(SourceN ,(0),group,Prop_None,"Source for testing links");
ADD_PROPERTY_TYPE(Source1 ,(nullptr),group,Prop_None,"Source for testing links");
ADD_PROPERTY_TYPE(Source2 ,(nullptr),group,Prop_None,"Source for testing links");
ADD_PROPERTY_TYPE(SourceN ,(nullptr),group,Prop_None,"Source for testing links");
ADD_PROPERTY_TYPE(ExecResult ,("empty"),group,Prop_None,"Result of the execution");
ADD_PROPERTY_TYPE(ExceptionType ,(0),group,Prop_None,"The type of exception the execution method throws");
ADD_PROPERTY_TYPE(ExecCount ,(0),group,Prop_None,"Number of executions");
@@ -150,7 +150,7 @@ doc.recompute()
obj.ExceptionType=6 # float division by zero
doc.recompute()
*/
int *i=0,j;
int *i=nullptr,j;
float f;
void *s;
std::string t;
@@ -194,5 +194,5 @@ DocumentObjectExecReturn *FeatureTestException::execute(void)
//ExceptionType;
throw Base::RuntimeError("FeatureTestException::execute(): Testexception ;-)");
return 0;
return nullptr;
}