gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r10319 - gnunet/src/include


From: gnunet
Subject: [GNUnet-SVN] r10319 - gnunet/src/include
Date: Tue, 16 Feb 2010 10:25:11 +0100

Author: grothoff
Date: 2010-02-16 10:25:11 +0100 (Tue, 16 Feb 2010)
New Revision: 10319

Modified:
   gnunet/src/include/gnunet_container_lib.h
Log:
block it

Modified: gnunet/src/include/gnunet_container_lib.h
===================================================================
--- gnunet/src/include/gnunet_container_lib.h   2010-02-16 08:51:49 UTC (rev 
10318)
+++ gnunet/src/include/gnunet_container_lib.h   2010-02-16 09:25:11 UTC (rev 
10319)
@@ -654,34 +654,32 @@
 /* ******************** doubly-linked list *************** */
 
 /**
- * Insert an element into a DLL. Assumes
- * that head, tail and element are structs
- * with prev and next fields.
+ * Insert an element at the head of a DLL. Assumes that head, tail and
+ * element are structs with prev and next fields.
  *
  * @param head pointer to the head of the DLL
  * @param tail pointer to the tail of the DLL
  * @param element element to insert
  */
-#define GNUNET_CONTAINER_DLL_insert(head,tail,element) \
+#define GNUNET_CONTAINER_DLL_insert(head,tail,element) do { \
   (element)->next = (head); \
   (element)->prev = NULL; \
   if ((tail) == NULL) \
     (tail) = element; \
   else \
     (head)->prev = element; \
-  (head) = (element);
+  (head) = (element); } while (0)
 
 /**
- * Insert an element into a DLL after the given other
- * element.  Insert at the head if the other
- * element is NULL.
+ * Insert an element into a DLL after the given other element.  Insert
+ * at the head if the other element is NULL.
  *
  * @param head pointer to the head of the DLL
  * @param tail pointer to the tail of the DLL
  * @param other prior element, NULL for insertion at head of DLL
  * @param element element to insert
  */
-#define GNUNET_CONTAINER_DLL_insert_after(head,tail,other,element) \
+#define GNUNET_CONTAINER_DLL_insert_after(head,tail,other,element) do { \
   (element)->prev = (other); \
   if (NULL == other) \
     { \
@@ -696,7 +694,7 @@
   if (NULL == (element)->next) \
     (tail) = (element); \
   else \
-    (element)->next->prev = (element);
+    (element)->next->prev = (element); } while (0)
 
 
 
@@ -710,7 +708,7 @@
  * @param tail pointer to the tail of the DLL
  * @param element element to remove
  */
-#define GNUNET_CONTAINER_DLL_remove(head,tail,element) \
+#define GNUNET_CONTAINER_DLL_remove(head,tail,element) do { \
   if ((element)->prev == NULL) \
     (head) = (element)->next;  \
   else \
@@ -718,7 +716,7 @@
   if ((element)->next == NULL) \
     (tail) = (element)->prev;  \
   else \
-    (element)->next->prev = (element)->prev;
+    (element)->next->prev = (element)->prev; } while (0)
 
 
 





reply via email to

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