RE: [Python-Dev] Proposal: C API Macro to decref and set to NULL

Tim Peters wrote:
BTW, re-invented at least as often is a VISIT macro for use in tp_traverse slots, like typeobject.c's (and several other files')
#define VISIT(SLOT) \ if (SLOT) { \ err = visit((PyObject *)(SLOT), arg); \ if (err) \ return err; \ }
Shouldn't this also be wrapped in a do {} while (0)? Tim Delaney

On Jul 12, 2004, at 7:54 PM, Delaney, Timothy C (Timothy) wrote:
Tim Peters wrote:
BTW, re-invented at least as often is a VISIT macro for use in tp_traverse slots, like typeobject.c's (and several other files')
#define VISIT(SLOT) \ if (SLOT) { \ err = visit((PyObject *)(SLOT), arg); \ if (err) \ return err; \ }
Shouldn't this also be wrapped in a do {} while (0)?
I think it's obvious that this macro has not been made generic yet, given that err, visit, and arg aren't defined anywhere. -bob
participants (2)
-
Bob Ippolito
-
Delaney, Timothy C (Timothy)