[Opensrf-commits] r1616 - trunk/include/opensrf

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Jan 11 17:11:39 EST 2009


Author: scottmk
Date: 2009-01-11 17:11:34 -0500 (Sun, 11 Jan 2009)
New Revision: 1616

Modified:
   trunk/include/opensrf/osrf_list.h
Log:
In the macro OSRF_LIST_GET_INDEX: placed all occurrences of the macro arguments
in parentheses, to prevent unexpected effects when one or more of the 
arguments is an expression.


Modified: trunk/include/opensrf/osrf_list.h
===================================================================
--- trunk/include/opensrf/osrf_list.h	2009-01-09 23:04:55 UTC (rev 1615)
+++ trunk/include/opensrf/osrf_list.h	2009-01-11 22:11:34 UTC (rev 1616)
@@ -7,7 +7,7 @@
 extern "C" {
 #endif
 
-#define OSRF_LIST_GET_INDEX(l, i) (!l || i >= l->size) ? NULL: l->arrlist[i]
+#define OSRF_LIST_GET_INDEX(l, i) (!(l) || (i) >= (l)->size) ? NULL: (l)->arrlist[(i)]
 
 /**
   Items are stored as void*'s so it's up to the user to



More information about the opensrf-commits mailing list