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

This commit is contained in:
rdb 2016-02-27 16:45:22 +01:00
parent 9f0cd81803
commit f933eb4e96
4 changed files with 5 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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();

View File

@ -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;
}