[Python-checkins] python/dist/src/Include asdl.h,1.1.2.2,1.1.2.3

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
Mon, 30 Sep 2002 11:23:00 -0700


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

Modified Files:
      Tag: ast-branch
	asdl.h 
Log Message:
Add debugging variants of SET() and APPEND().


Index: asdl.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/Attic/asdl.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** asdl.h	30 Aug 2002 19:20:40 -0000	1.1.2.2
--- asdl.h	30 Sep 2002 18:22:58 -0000	1.1.2.3
***************
*** 28,33 ****
--- 28,44 ----
  
  #define asdl_seq_GET(S, I) (S)->elements[(I)]
+ #ifdef Py_DEBUG
  #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V)
  #define asdl_seq_APPEND(S, V) (S)->elements[(S)->offset++] = (V)
+ #else
+ #define asdl_seq_SET(S, I, V) { \
+         assert((S) && (I) < (S)->size); \
+         (S)->elements[I] = (V); \
+ }
+ #define asdl_seq_APPEND(S, V) { \
+         assert((S) && (S)->offset < (S)->size); \
+         (S)->elements[(S)->offset++] = (V); \
+ }
+ #endif
  #define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size)