various fixes.
authorPierre Habouzit <madcoder@debian.org>
Sun, 10 Dec 2006 22:17:23 +0000 (23:17 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sun, 10 Dec 2006 22:17:23 +0000 (23:17 +0100)
add *_list_rev function.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
lib-lib/lib-lib.h
lib-lib/list.h
tools/lemon.c
tools/lempar.c

index 1b0769a..a4098e2 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef MUTT_LIB_LIB_LIB_LIB_H
 #define MUTT_LIB_LIB_LIB_LIB_H
 
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
 # include "../config.h"
 #endif
 
index bba82b1..957c900 100644 (file)
         list = prefix##_list_last(list);                                     \
         *list = item;                                                        \
         return list;                                                         \
+    }                                                                        \
+    static inline type *prefix##_list_rev(type *list) {                      \
+        type *l = NULL;                                                      \
+        while (list) {                                                       \
+            prefix##_list_push(&l, prefix##_list_pop(&list));                \
+        }                                                                    \
+        return l;                                                            \
     }                                                                        \
                                                                              \
     static inline type **prefix##_list_init(type **list) {                   \
index 759e1c3..00dabf0 100644 (file)
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <ctype.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 #ifndef __WIN32__
 #   if defined(_WIN32) || defined(WIN32)
index 168efc4..9220588 100644 (file)
@@ -548,9 +548,10 @@ static void yy_parse_failed(
 ** The following code executes when a syntax error first occurs.
 */
 static void yy_syntax_error(
-  yyParser *yypParser,           /* The parser */
-  int yymajor,                   /* The major type of the error token */
-  YYMINORTYPE yyminor            /* The minor type of the error token */
+  yyParser *yypParser,                 /* The parser */
+  int yymajor __attribute__((unused)), /* The major type of the error token */
+  YYMINORTYPE yyminor __attribute__((unused))
+                                       /* The minor type of the error token */
 ){
   ParseARG_FETCH;
 #define TOKEN (yyminor.yy0)