Browse Source

Fix a few compiler warnings

rdb 8 years ago
parent
commit
08629ef1a0
2 changed files with 17 additions and 4 deletions
  1. 16 4
      dtool/src/interrogatedb/py_panda.cxx
  2. 1 0
      panda/src/event/asyncTaskSequence.cxx

+ 16 - 4
dtool/src/interrogatedb/py_panda.cxx

@@ -1887,9 +1887,13 @@ Dtool_StaticProperty_dealloc(PyDescrObject *descr) {
 static PyObject *
 static PyObject *
 Dtool_StaticProperty_repr(PyDescrObject *descr, const char *format) {
 Dtool_StaticProperty_repr(PyDescrObject *descr, const char *format) {
 #if PY_MAJOR_VERSION >= 3
 #if PY_MAJOR_VERSION >= 3
-  return PyUnicode_FromFormat("<attribute '%s' of '%s'>", descr->d_name, descr->d_type->tp_name);
+  return PyUnicode_FromFormat("<attribute '%s' of '%s'>",
+                              PyUnicode_AsUTF8(descr->d_name),
+                              descr->d_type->tp_name);
 #else
 #else
-  return PyString_FromFormat("<attribute '%s' of '%s'>", descr->d_name, descr->d_type->tp_name);
+  return PyString_FromFormat("<attribute '%s' of '%s'>",
+                             PyString_AS_STRING(descr->d_name),
+                             descr->d_type->tp_name);
 #endif
 #endif
 }
 }
 
 
@@ -1907,7 +1911,11 @@ Dtool_StaticProperty_get(PyGetSetDescrObject *descr, PyObject *obj, PyObject *ty
   } else {
   } else {
     return PyErr_Format(PyExc_AttributeError,
     return PyErr_Format(PyExc_AttributeError,
                         "attribute '%s' of type '%.100s' is not readable",
                         "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);
                         ((PyDescrObject *)descr)->d_type->tp_name);
   }
   }
 }
 }
@@ -1919,7 +1927,11 @@ Dtool_StaticProperty_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *va
   } else {
   } else {
     PyErr_Format(PyExc_AttributeError,
     PyErr_Format(PyExc_AttributeError,
                  "attribute '%s' of type '%.100s' is not writable",
                  "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);
                  ((PyDescrObject *)descr)->d_type->tp_name);
     return -1;
     return -1;
   }
   }

+ 1 - 0
panda/src/event/asyncTaskSequence.cxx

@@ -106,6 +106,7 @@ do_task() {
   case DS_pickup:
   case DS_pickup:
   case DS_exit:
   case DS_exit:
   case DS_interrupt:
   case DS_interrupt:
+  case DS_await:
     // Just return these results through.
     // Just return these results through.
     return result;
     return result;
   }
   }