]> git.saurik.com Git - bison.git/blobdiff - src/system.h
* src/system.h (LIST_FREE, shortcpy): New.
[bison.git] / src / system.h
index bfd244637a0b8fe1efb9508df6f9ea07eaf4a16e..b8a73edbdc27effa05559fc53000a395976277f6 100644 (file)
@@ -279,6 +279,21 @@ do {                                                               \
 #endif
 
 
+/* As memcpy, but for shorts.  */
+#define shortcpy(Dest, Src, Num) \
+  memcpy (Dest, Src, Num * sizeof (short))
+
+/* Free a linked list. */
+#define LIST_FREE(Type, List)                  \
+do {                                           \
+  Type *_node, *_next;                         \
+  for (_node = List; _node; _node = _next)     \
+    {                                          \
+      _next = _node->next;                     \
+      XFREE (_node);                           \
+    }                                          \
+} while (0)
+
 /*---------------------------------.
 | Debugging the memory allocator.  |
 `---------------------------------*/