Explorar o código

Fix compile warnings (incl. "Attempt to define invalid type" spam), define _Dtool_CheckErrorOccurred in release builds for binary compat

rdb %!s(int64=9) %!d(string=hai) anos
pai
achega
f933eb4e96

+ 1 - 3
dtool/src/interrogate/interrogateBuilder.cxx

@@ -1870,9 +1870,7 @@ get_make_property(CPPMakeProperty *make_property, CPPStructType *struct_type, CP
   iproperty._scoped_name = descope(make_property->get_local_name(&parser));
 
   if (return_type != NULL) {
-    iproperty._type = get_type(return_type, false);
-    // if (iproperty._type == 0) { parser.warning("cannot determine property
-    // type", make_property->_ident->_loc); }
+    iproperty._type = get_type(TypeManager::unwrap_reference(return_type), false);
   } else {
     iproperty._type = 0;
   }

+ 1 - 1
dtool/src/interrogatedb/py_panda.cxx

@@ -183,7 +183,7 @@ void *DTOOL_Call_GetPointerThis(PyObject *self) {
  * In the NDEBUG case, this is simply a #define to _PyErr_OCCURRED() (which is
  * an undocumented inline version of PyErr_Occurred()).
  */
-bool Dtool_CheckErrorOccurred() {
+bool _Dtool_CheckErrorOccurred() {
   if (_PyErr_OCCURRED()) {
     return true;
   }

+ 2 - 1
dtool/src/interrogatedb/py_panda.h

@@ -313,12 +313,13 @@ template<class T> INLINE bool DTOOL_Call_ExtractThisPointer(PyObject *self, T *&
 }
 
 // Functions related to error reporting.
+EXPCL_INTERROGATEDB bool _Dtool_CheckErrorOccurred();
 
 #ifdef NDEBUG
 // _PyErr_OCCURRED is an undocumented inline version of PyErr_Occurred.
 #define Dtool_CheckErrorOccurred() (_PyErr_OCCURRED() != NULL)
 #else
-EXPCL_INTERROGATEDB bool Dtool_CheckErrorOccurred();
+#define Dtool_CheckErrorOccurred() _Dtool_CheckErrorOccurred()
 #endif
 
 EXPCL_INTERROGATEDB PyObject *Dtool_Raise_AssertionError();

+ 1 - 1
panda/src/gobj/texturePeeker.I

@@ -54,5 +54,5 @@ get_z_size() const {
  */
 INLINE bool TexturePeeker::
 has_pixel(size_t x, size_t y) const {
-  return x >= 0 && y >= 0 && x < _x_size && y < _y_size;
+  return x < _x_size && y < _y_size;
 }