[Python-checkins] python/dist/src/Include boolobject.h, 1.5, 1.6 object.h, 2.122, 2.123

bcannon at users.sourceforge.net bcannon at users.sourceforge.net
Sun Oct 19 17:31:45 EDT 2003


Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv23831/Include

Modified Files:
	boolobject.h object.h 
Log Message:
Modified the Py_RETURN_* macros by having the statements surrounded by {} in
order to prevent any unexpected surprises from someone using them in a
conditional without using curly braces (e.g., ``if (foo) Py_RETURN_TRUE``.


Index: boolobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/boolobject.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** boolobject.h	19 Oct 2003 21:19:40 -0000	1.5
--- boolobject.h	19 Oct 2003 21:31:43 -0000	1.6
***************
*** 25,30 ****
  
  /* Macros for returning Py_True or Py_False, respectively */
! #define Py_RETURN_TRUE Py_INCREF(Py_True); return Py_True;
! #define Py_RETURN_FALSE Py_INCREF(Py_False); return Py_False;
  
  /* Function to return a bool from a C long */
--- 25,30 ----
  
  /* Macros for returning Py_True or Py_False, respectively */
! #define Py_RETURN_TRUE {Py_INCREF(Py_True); return Py_True;}
! #define Py_RETURN_FALSE {Py_INCREF(Py_False); return Py_False;}
  
  /* Function to return a bool from a C long */

Index: object.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/object.h,v
retrieving revision 2.122
retrieving revision 2.123
diff -C2 -d -r2.122 -r2.123
*** object.h	19 Oct 2003 21:19:40 -0000	2.122
--- object.h	19 Oct 2003 21:31:43 -0000	2.123
***************
*** 635,639 ****
  
  /* Macro for returning Py_None from a function */
! #define Py_RETURN_NONE Py_INCREF(Py_None); return Py_None;
  
  /*
--- 635,639 ----
  
  /* Macro for returning Py_None from a function */
! #define Py_RETURN_NONE {Py_INCREF(Py_None); return Py_None;}
  
  /*





More information about the Python-checkins mailing list