> From: Skip Montanaro > > #define Py_DECREF(op) \ > if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \ > --(op)->ob_refcnt != 0) { \ > _Py_CHECK_REFCNT(op) \ > } else { \ > _Py_Dealloc((PyObject *)(op)) \ > } > > Py_INCREF would be left alone, and the X variants would become > > #define Py_XINCREF(op) if ((op) == NULL) {;} else { Py_INCREF(op) } > #define Py_XDECREF(op) if ((op) == NULL) {;} else {Py_DECREF(op) } Then you will probably end up with different warnings - semicolons following closing braces, etc. As Tim Peters said, the way to deal with that is to enclose the entire bit in a do ( ... } while (0) no-op (after the compiler optimises it away) but that - as he rightly pointed out - is pretty blecherous. #define Py_XINCREF(op) do { if ((op) != NULL) { Py_INCREF(op) } } while (0) #define Py_XDECREF(op) do { if ((op) != NULL) { Py_DECREF(op) } } while (0) or #define Py_XINCREF(op) do { if ((op) != NULL) Py_INCREF(op) } while (0) #define Py_XDECREF(op) do { if ((op) != NULL) Py_DECREF(op) } while (0) Tim Delaney
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4