From 08629ef1a09738d32b2da15a7ad65372036cb9f8 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 7 Nov 2017 14:43:04 +0100 Subject: [PATCH] Fix a few compiler warnings --- dtool/src/interrogatedb/py_panda.cxx | 20 ++++++++++++++++---- panda/src/event/asyncTaskSequence.cxx | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/dtool/src/interrogatedb/py_panda.cxx b/dtool/src/interrogatedb/py_panda.cxx index fa0c5475ec..34e6610d18 100644 --- a/dtool/src/interrogatedb/py_panda.cxx +++ b/dtool/src/interrogatedb/py_panda.cxx @@ -1887,9 +1887,13 @@ Dtool_StaticProperty_dealloc(PyDescrObject *descr) { static PyObject * Dtool_StaticProperty_repr(PyDescrObject *descr, const char *format) { #if PY_MAJOR_VERSION >= 3 - return PyUnicode_FromFormat("", descr->d_name, descr->d_type->tp_name); + return PyUnicode_FromFormat("", + PyUnicode_AsUTF8(descr->d_name), + descr->d_type->tp_name); #else - return PyString_FromFormat("", descr->d_name, descr->d_type->tp_name); + return PyString_FromFormat("", + PyString_AS_STRING(descr->d_name), + descr->d_type->tp_name); #endif } @@ -1907,7 +1911,11 @@ Dtool_StaticProperty_get(PyGetSetDescrObject *descr, PyObject *obj, PyObject *ty } else { return PyErr_Format(PyExc_AttributeError, "attribute '%s' of type '%.100s' is not readable", - ((PyDescrObject *)descr)->d_name, +#if PY_MAJOR_VERSION >= 3 + PyUnicode_AsUTF8(((PyDescrObject *)descr)->d_name), +#else + PyString_AS_STRING(((PyDescrObject *)descr)->d_name), +#endif ((PyDescrObject *)descr)->d_type->tp_name); } } @@ -1919,7 +1927,11 @@ Dtool_StaticProperty_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *va } else { PyErr_Format(PyExc_AttributeError, "attribute '%s' of type '%.100s' is not writable", - ((PyDescrObject *)descr)->d_name, +#if PY_MAJOR_VERSION >= 3 + PyUnicode_AsUTF8(((PyDescrObject *)descr)->d_name), +#else + PyString_AS_STRING(((PyDescrObject *)descr)->d_name), +#endif ((PyDescrObject *)descr)->d_type->tp_name); return -1; } diff --git a/panda/src/event/asyncTaskSequence.cxx b/panda/src/event/asyncTaskSequence.cxx index e8713ca05e..fe306c26a3 100644 --- a/panda/src/event/asyncTaskSequence.cxx +++ b/panda/src/event/asyncTaskSequence.cxx @@ -106,6 +106,7 @@ do_task() { case DS_pickup: case DS_exit: case DS_interrupt: + case DS_await: // Just return these results through. return result; }