Cleanup: Clang-Tidy modernize-use-nullptr
Replace `NULL` with `nullptr` in C++ code. No functional changes.
This commit is contained in:
@@ -72,7 +72,7 @@ static PyObject *Freestyle_getCurrentScene(PyObject * /*self*/)
|
||||
Scene *scene = g_freestyle.scene;
|
||||
if (!scene) {
|
||||
PyErr_SetString(PyExc_TypeError, "current scene not available");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
PointerRNA ptr_scene;
|
||||
RNA_pointer_create(&scene->id, &RNA_Scene, scene, &ptr_scene);
|
||||
@@ -166,12 +166,12 @@ static PyObject *Freestyle_blendRamp(PyObject * /*self*/, PyObject *args)
|
||||
float a[3], fac, b[3];
|
||||
|
||||
if (!PyArg_ParseTuple(args, "sOfO", &s, &obj1, &fac, &obj2)) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
type = ramp_blend_type(s);
|
||||
if (type < 0) {
|
||||
PyErr_SetString(PyExc_TypeError, "argument 1 is an unknown ramp blend type");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (mathutils_array_parse(a,
|
||||
3,
|
||||
@@ -179,7 +179,7 @@ static PyObject *Freestyle_blendRamp(PyObject * /*self*/, PyObject *args)
|
||||
obj1,
|
||||
"argument 2 must be a 3D vector "
|
||||
"(either a tuple/list of 3 elements or Vector)") == -1) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (mathutils_array_parse(b,
|
||||
3,
|
||||
@@ -187,10 +187,10 @@ static PyObject *Freestyle_blendRamp(PyObject * /*self*/, PyObject *args)
|
||||
obj2,
|
||||
"argument 4 must be a 3D vector "
|
||||
"(either a tuple/list of 3 elements or Vector)") == -1) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
ramp_blend(type, a, fac, b);
|
||||
return Vector_CreatePyObject(a, 3, NULL);
|
||||
return Vector_CreatePyObject(a, 3, nullptr);
|
||||
}
|
||||
|
||||
#include "BKE_colorband.h" /* BKE_colorband_evaluate() */
|
||||
@@ -214,18 +214,18 @@ static PyObject *Freestyle_evaluateColorRamp(PyObject * /*self*/, PyObject *args
|
||||
float in, out[4];
|
||||
|
||||
if (!(PyArg_ParseTuple(args, "O!f", &pyrna_struct_Type, &py_srna, &in))) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (!RNA_struct_is_a(py_srna->ptr.type, &RNA_ColorRamp)) {
|
||||
PyErr_SetString(PyExc_TypeError, "1st argument is not a ColorRamp object");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
coba = (ColorBand *)py_srna->ptr.data;
|
||||
if (!BKE_colorband_evaluate(coba, in, out)) {
|
||||
PyErr_SetString(PyExc_ValueError, "failed to evaluate the color ramp");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
return Vector_CreatePyObject(out, 4, NULL);
|
||||
return Vector_CreatePyObject(out, 4, nullptr);
|
||||
}
|
||||
|
||||
#include "BKE_colortools.h" /* BKE_curvemapping_evaluateF() */
|
||||
@@ -253,15 +253,15 @@ static PyObject *Freestyle_evaluateCurveMappingF(PyObject * /*self*/, PyObject *
|
||||
float value;
|
||||
|
||||
if (!(PyArg_ParseTuple(args, "O!if", &pyrna_struct_Type, &py_srna, &cur, &value))) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (!RNA_struct_is_a(py_srna->ptr.type, &RNA_CurveMapping)) {
|
||||
PyErr_SetString(PyExc_TypeError, "1st argument is not a CurveMapping object");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (cur < 0 || cur > 3) {
|
||||
PyErr_SetString(PyExc_ValueError, "2nd argument is out of range");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
cumap = (CurveMapping *)py_srna->ptr.data;
|
||||
BKE_curvemapping_init(cumap);
|
||||
@@ -515,7 +515,7 @@ static PyMethodDef module_functions[] = {
|
||||
(PyCFunction)Freestyle_evaluateCurveMappingF,
|
||||
METH_VARARGS,
|
||||
Freestyle_evaluateCurveMappingF___doc__},
|
||||
{NULL, NULL, 0, NULL},
|
||||
{nullptr, nullptr, 0, nullptr},
|
||||
};
|
||||
|
||||
/*-----------------------Freestyle module definition---------------------------*/
|
||||
@@ -536,7 +536,7 @@ PyObject *Freestyle_Init(void)
|
||||
// initialize modules
|
||||
module = PyModule_Create(&module_definition);
|
||||
if (!module) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
PyDict_SetItemString(PySys_GetObject("modules"), module_definition.m_name, module);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user