Gui: modernize C++11
* use nullptr
This commit is contained in:
@@ -71,7 +71,7 @@ Py::Object PythonStdout::write(const Py::Tuple& args)
|
||||
if (!PyArg_ParseTuple(args.ptr(), "O!",&PyUnicode_Type, &output))
|
||||
throw Py::TypeError("PythonStdout.write() takes exactly one argument of type str");
|
||||
|
||||
PyObject* unicode = PyUnicode_AsEncodedString(output, "utf-8", 0);
|
||||
PyObject* unicode = PyUnicode_AsEncodedString(output, "utf-8", nullptr);
|
||||
if (unicode) {
|
||||
const char* string = PyBytes_AsString(unicode);
|
||||
int maxlen = qstrlen(string) > 10000 ? 10000 : -1;
|
||||
@@ -137,7 +137,7 @@ Py::Object PythonStderr::write(const Py::Tuple& args)
|
||||
if (!PyArg_ParseTuple(args.ptr(), "O!",&PyUnicode_Type, &output))
|
||||
throw Py::TypeError("PythonStderr.write() takes exactly one argument of type str");
|
||||
|
||||
PyObject* unicode = PyUnicode_AsEncodedString(output, "utf-8", 0);
|
||||
PyObject* unicode = PyUnicode_AsEncodedString(output, "utf-8", nullptr);
|
||||
if (unicode) {
|
||||
const char* string = PyBytes_AsString(unicode);
|
||||
int maxlen = qstrlen(string) > 10000 ? 10000 : -1;
|
||||
@@ -202,7 +202,7 @@ Py::Object OutputStdout::write(const Py::Tuple& args)
|
||||
if (!PyArg_ParseTuple(args.ptr(), "O!",&PyUnicode_Type, &output))
|
||||
throw Py::TypeError("OutputStdout.write() takes exactly one argument of type str");
|
||||
|
||||
PyObject* unicode = PyUnicode_AsEncodedString(output, "utf-8", 0);
|
||||
PyObject* unicode = PyUnicode_AsEncodedString(output, "utf-8", nullptr);
|
||||
if (unicode) {
|
||||
const char* string = PyBytes_AsString(unicode);
|
||||
Base::Console().Message("%s",string);
|
||||
@@ -267,7 +267,7 @@ Py::Object OutputStderr::write(const Py::Tuple& args)
|
||||
if (!PyArg_ParseTuple(args.ptr(), "O!",&PyUnicode_Type, &output))
|
||||
throw Py::TypeError("OutputStderr.write() takes exactly one argument of type str");
|
||||
|
||||
PyObject* unicode = PyUnicode_AsEncodedString(output, "utf-8", 0);
|
||||
PyObject* unicode = PyUnicode_AsEncodedString(output, "utf-8", nullptr);
|
||||
if (unicode) {
|
||||
const char* string = PyBytes_AsString(unicode);
|
||||
Base::Console().Error("%s",string);
|
||||
|
||||
Reference in New Issue
Block a user