Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] (PR#8683) specvec iterator patch
Home

[Freeciv-Dev] (PR#8683) specvec iterator patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#8683) specvec iterator patch
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Fri, 14 May 2004 19:11:51 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8683 >

An iterator macro patch for specvec.

Index: utility/specvec.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/utility/specvec.h,v
retrieving revision 1.5
diff -u -r1.5 specvec.h
--- utility/specvec.h   15 May 2004 00:48:17 -0000      1.5
+++ utility/specvec.h   15 May 2004 02:09:47 -0000
@@ -130,6 +130,17 @@
   SPECVEC_FOO(_vector_init)(tthis);
 }
 
+
+#define TYPED_VECTOR_ITERATE(atype, vector, var) {      \
+  int myiter;                                          \
+  atype var;                                            \
+  for (myiter = 0; myiter < (vector)->size; myiter++) { \
+    var = (vector)->p[myiter];                         \
+ 
+/* Balance for above: */
+#define VECTOR_ITERATE_END  }}
+
+
 #undef SPECVEC_TAG
 #undef SPECVEC_TYPE
 #undef SPECVEC_PASTE_

[Prev in Thread] Current Thread [Next in Thread]