Path: modernize C++11
* use nullptr
This commit is contained in:
@@ -71,9 +71,9 @@ PyObject *CommandPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Py
|
||||
// constructor method
|
||||
int CommandPy::PyInit(PyObject* args, PyObject* kwd)
|
||||
{
|
||||
PyObject *parameters = NULL;
|
||||
PyObject *parameters = nullptr;
|
||||
char *name = "";
|
||||
static char *kwlist[] = {"name", "parameters", NULL};
|
||||
static char *kwlist[] = {"name", "parameters", nullptr};
|
||||
if ( PyArg_ParseTupleAndKeywords(args, kwd, "|sO!", kwlist, &name, &PyDict_Type, ¶meters) ) {
|
||||
std::string sname(name);
|
||||
boost::to_upper(sname);
|
||||
@@ -204,7 +204,7 @@ PyObject* CommandPy::toGCode(PyObject *args)
|
||||
|
||||
PyObject* CommandPy::setFromGCode(PyObject *args)
|
||||
{
|
||||
char *pstr=0;
|
||||
char *pstr=nullptr;
|
||||
if (PyArg_ParseTuple(args, "s", &pstr)) {
|
||||
std::string gcode(pstr);
|
||||
try {
|
||||
@@ -267,7 +267,7 @@ PyObject *CommandPy::getCustomAttributes(const char* attr) const
|
||||
return Py_None;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int CommandPy::setCustomAttributes(const char* attr, PyObject* obj)
|
||||
|
||||
Reference in New Issue
Block a user