- make it compile with a C89 compiler
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Thu, 28 Jun 2007 11:53:59 +0000 (11:53 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Thu, 28 Jun 2007 11:53:59 +0000 (11:53 -0000)
package/config/Makefile
package/config/README.buildroot2
package/config/conf.c
package/config/confdata.c
package/config/expr.c
package/config/expr.h
package/config/foo.h [new file with mode: 0644]
package/config/kconfig-to-buildroot2.patch

index f247082cf5d51b921156f8fd75225f7f988c4eb9..436f574bb050315e450f9e6ebc643c3e5dfc0490 100644 (file)
@@ -5,7 +5,7 @@ top_builddir=../../
 srctree := .
 
 include Makefile.kconfig
-
+HOSTCFLAGS+=-Dinline="" -include foo.h
 -include .depend
 .depend: $(wildcard *.h *.c)
        $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) -MM *.c > .depend 2>/dev/null || :
index 1437cb9973a762fbb91649a8d761227974eb5797..6569cab72e76d3da622bfebcde463d918795a2ea 100644 (file)
@@ -7,6 +7,8 @@ To update:
        mv Makefile Makefile.kconfig
        patch -p1 < ../config/kconfig-to-buildroot.patch
        cp ../config/README.buildroot2 .
+       cp ../config/foo.h .
+       cp ../config/Makefile .
        cd ..
        rm -rf config
        mv config.new config
index f475f139e844e43434834cc25dde1f86ec7c685f..9900e90ea00a3891b4b608f05740bce9cd695adc 100644 (file)
@@ -542,7 +542,7 @@ int main(int ac, char **av)
                exit(1);
        }
        conf_parse(name);
-       //zconfdump(stdout);
+       /*zconfdump(stdout);*/
        switch (input_mode) {
        case set_default:
                if (!defconfig_file)
index 64af1ac828ebe5714e66f4dfa582cb9b9993c5ec..9b23cab776bac63bb49e6b31be8e72056dca892d 100644 (file)
@@ -183,7 +183,7 @@ load:
                                ;
                        }
                        break;
-               case 'A' ... 'Z':
+               case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
                        p = strchr(line, '=');
                        if (!p)
                                continue;
index 6f98dbfe70cf4df2e57432e838465c33e4f4888e..5861468bcc79c3513a5775aae3fd652ae8279442 100644 (file)
@@ -331,7 +331,7 @@ struct expr *expr_trans_bool(struct expr *e)
                e->right.expr = expr_trans_bool(e->right.expr);
                break;
        case E_UNEQUAL:
-               // FOO!=n -> FOO
+               /* FOO!=n -> FOO */
                if (e->left.sym->type == S_TRISTATE) {
                        if (e->right.sym == &symbol_no) {
                                e->type = E_SYMBOL;
@@ -380,19 +380,19 @@ struct expr *expr_join_or(struct expr *e1, struct expr *e2)
                if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
                    ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
                     (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) {
-                       // (a='y') || (a='m') -> (a!='n')
+                       /* (a='y') || (a='m') -> (a!='n') */
                        return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no);
                }
                if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
                    ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
                     (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) {
-                       // (a='y') || (a='n') -> (a!='m')
+                       /* (a='y') || (a='n') -> (a!='m') */
                        return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod);
                }
                if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
                    ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
                     (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) {
-                       // (a='m') || (a='n') -> (a!='y')
+                       /* (a='m') || (a='n') -> (a!='y') */
                        return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes);
                }
        }
@@ -443,29 +443,29 @@ struct expr *expr_join_and(struct expr *e1, struct expr *e2)
 
        if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) ||
            (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes))
-               // (a) && (a='y') -> (a='y')
+               /* (a) && (a='y') -> (a='y') */
                return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
 
        if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) ||
            (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no))
-               // (a) && (a!='n') -> (a)
+               /* (a) && (a!='n') -> (a) */
                return expr_alloc_symbol(sym1);
 
        if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) ||
            (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod))
-               // (a) && (a!='m') -> (a='y')
+               /* (a) && (a!='m') -> (a='y') */
                return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
 
        if (sym1->type == S_TRISTATE) {
                if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) {
-                       // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
+                       /* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */
                        sym2 = e1->right.sym;
                        if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
                                return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
                                                             : expr_alloc_symbol(&symbol_no);
                }
                if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) {
-                       // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
+                       /* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */
                        sym2 = e2->right.sym;
                        if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
                                return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
@@ -474,19 +474,19 @@ struct expr *expr_join_and(struct expr *e1, struct expr *e2)
                if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
                           ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
                            (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes)))
-                       // (a!='y') && (a!='n') -> (a='m')
+                       /* (a!='y') && (a!='n') -> (a='m') */
                        return expr_alloc_comp(E_EQUAL, sym1, &symbol_mod);
 
                if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
                           ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
                            (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes)))
-                       // (a!='y') && (a!='m') -> (a='n')
+                       /* (a!='y') && (a!='m') -> (a='n') */
                        return expr_alloc_comp(E_EQUAL, sym1, &symbol_no);
 
                if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
                           ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
                            (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod)))
-                       // (a!='m') && (a!='n') -> (a='m')
+                       /* (a!='m') && (a!='n') -> (a='m') */
                        return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
 
                if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) ||
@@ -579,7 +579,7 @@ static void expr_eliminate_dups2(enum expr_type type, struct expr **ep1, struct
        switch (e1->type) {
        case E_OR:
                expr_eliminate_dups2(e1->type, &e1, &e1);
-               // (FOO || BAR) && (!FOO && !BAR) -> n
+               /* (FOO || BAR) && (!FOO && !BAR) -> n */
                tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
                tmp2 = expr_copy(e2);
                tmp = expr_extract_eq_and(&tmp1, &tmp2);
@@ -594,7 +594,7 @@ static void expr_eliminate_dups2(enum expr_type type, struct expr **ep1, struct
                break;
        case E_AND:
                expr_eliminate_dups2(e1->type, &e1, &e1);
-               // (FOO && BAR) || (!FOO || !BAR) -> y
+               /* (FOO && BAR) || (!FOO || !BAR) -> y */
                tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
                tmp2 = expr_copy(e2);
                tmp = expr_extract_eq_or(&tmp1, &tmp2);
@@ -703,7 +703,7 @@ struct expr *expr_transform(struct expr *e)
        case E_NOT:
                switch (e->left.expr->type) {
                case E_NOT:
-                       // !!a -> a
+                       /* !!a -> a */
                        tmp = e->left.expr->left.expr;
                        free(e->left.expr);
                        free(e);
@@ -712,14 +712,14 @@ struct expr *expr_transform(struct expr *e)
                        break;
                case E_EQUAL:
                case E_UNEQUAL:
-                       // !a='x' -> a!='x'
+                       /* !a='x' -> a!='x' */
                        tmp = e->left.expr;
                        free(e);
                        e = tmp;
                        e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL;
                        break;
                case E_OR:
-                       // !(a || b) -> !a && !b
+                       /* !(a || b) -> !a && !b */
                        tmp = e->left.expr;
                        e->type = E_AND;
                        e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
@@ -728,7 +728,7 @@ struct expr *expr_transform(struct expr *e)
                        e = expr_transform(e);
                        break;
                case E_AND:
-                       // !(a && b) -> !a || !b
+                       /* !(a && b) -> !a || !b */
                        tmp = e->left.expr;
                        e->type = E_OR;
                        e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
@@ -738,7 +738,7 @@ struct expr *expr_transform(struct expr *e)
                        break;
                case E_SYMBOL:
                        if (e->left.expr->left.sym == &symbol_yes) {
-                               // !'y' -> 'n'
+                               /* !'y' -> 'n' */
                                tmp = e->left.expr;
                                free(e);
                                e = tmp;
@@ -747,7 +747,7 @@ struct expr *expr_transform(struct expr *e)
                                break;
                        }
                        if (e->left.expr->left.sym == &symbol_mod) {
-                               // !'m' -> 'm'
+                               /* !'m' -> 'm' */
                                tmp = e->left.expr;
                                free(e);
                                e = tmp;
@@ -756,7 +756,7 @@ struct expr *expr_transform(struct expr *e)
                                break;
                        }
                        if (e->left.expr->left.sym == &symbol_no) {
-                               // !'n' -> 'y'
+                               /* !'n' -> 'y' */
                                tmp = e->left.expr;
                                free(e);
                                e = tmp;
index 6084525f604b10e9871ada2aa6ca096d5be481ff..7c047f73028f9cff815b66dff0a0731d66b62031 100644 (file)
@@ -65,7 +65,7 @@ enum symbol_type {
 
 enum {
        S_DEF_USER,             /* main user value */
-       S_DEF_AUTO,
+       S_DEF_AUTO
 };
 
 struct symbol {
@@ -139,7 +139,7 @@ struct menu {
        struct property *prompt;
        struct expr *dep;
        unsigned int flags;
-       //char *help;
+       /*char *help; */
        struct file *file;
        int lineno;
        void *data;
diff --git a/package/config/foo.h b/package/config/foo.h
new file mode 100644 (file)
index 0000000..32853be
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __KCONFIG_FOO_H
+#define __KCONFIG_FOO_H
+#include <features.h>
+#include <limits.h>
+
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+#endif /* __KCONFIG_FOO_H */
index 38a570ddd31d3af508cf638c4049211e176a6abd..2bb1cf9d44014a2ad3cd7cafb02c2b169ed75ab6 100644 (file)
@@ -87,7 +87,7 @@
 -                              continue;
 -                      }
 -                      p = strchr(line + 7, '=');
-+              case 'A' ... 'Z':
++              case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
 +                      p = strchr(line, '=');
                        if (!p)
                                continue;
    <property name="type">GTK_WINDOW_TOPLEVEL</property>
    <property name="window_position">GTK_WIN_POS_NONE</property>
    <property name="modal">False</property>
+--- kconfig/conf.c     (revision 18956)
++++ Buildroot/conf.c   (working copy)
+@@ -542,7 +542,7 @@
+               exit(1);
+       }
+       conf_parse(name);
+-      //zconfdump(stdout);
++      /*zconfdump(stdout);*/
+       switch (input_mode) {
+       case set_default:
+               if (!defconfig_file)
+--- kconfig/expr.h     (revision 18956)
++++ Buildroot/expr.h   (working copy)
+@@ -65,7 +65,7 @@
+ enum {
+       S_DEF_USER,             /* main user value */
+-      S_DEF_AUTO,
++      S_DEF_AUTO
+ };
+ struct symbol {
+@@ -139,7 +139,7 @@
+       struct property *prompt;
+       struct expr *dep;
+       unsigned int flags;
+-      //char *help;
++      /*char *help; */
+       struct file *file;
+       int lineno;
+       void *data;
+Index: expr.c
+===================================================================
+--- kconfig/expr.c     (revision 18956)
++++ Buildroot/expr.c   (working copy)
+@@ -331,7 +331,7 @@
+               e->right.expr = expr_trans_bool(e->right.expr);
+               break;
+       case E_UNEQUAL:
+-              // FOO!=n -> FOO
++              /* FOO!=n -> FOO */
+               if (e->left.sym->type == S_TRISTATE) {
+                       if (e->right.sym == &symbol_no) {
+                               e->type = E_SYMBOL;
+@@ -380,19 +380,19 @@
+               if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
+                   ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
+                    (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) {
+-                      // (a='y') || (a='m') -> (a!='n')
++                      /* (a='y') || (a='m') -> (a!='n') */
+                       return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no);
+               }
+               if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
+                   ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
+                    (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) {
+-                      // (a='y') || (a='n') -> (a!='m')
++                      /* (a='y') || (a='n') -> (a!='m') */
+                       return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod);
+               }
+               if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
+                   ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
+                    (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) {
+-                      // (a='m') || (a='n') -> (a!='y')
++                      /* (a='m') || (a='n') -> (a!='y') */
+                       return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes);
+               }
+       }
+@@ -443,29 +443,29 @@
+       if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) ||
+           (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes))
+-              // (a) && (a='y') -> (a='y')
++              /* (a) && (a='y') -> (a='y') */
+               return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
+       if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) ||
+           (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no))
+-              // (a) && (a!='n') -> (a)
++              /* (a) && (a!='n') -> (a) */
+               return expr_alloc_symbol(sym1);
+       if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) ||
+           (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod))
+-              // (a) && (a!='m') -> (a='y')
++              /* (a) && (a!='m') -> (a='y') */
+               return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
+       if (sym1->type == S_TRISTATE) {
+               if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) {
+-                      // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
++                      /* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */
+                       sym2 = e1->right.sym;
+                       if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
+                               return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
+                                                            : expr_alloc_symbol(&symbol_no);
+               }
+               if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) {
+-                      // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
++                      /* (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' */
+                       sym2 = e2->right.sym;
+                       if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
+                               return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
+@@ -474,19 +474,19 @@
+               if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
+                          ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
+                           (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes)))
+-                      // (a!='y') && (a!='n') -> (a='m')
++                      /* (a!='y') && (a!='n') -> (a='m') */
+                       return expr_alloc_comp(E_EQUAL, sym1, &symbol_mod);
+               if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
+                          ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
+                           (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes)))
+-                      // (a!='y') && (a!='m') -> (a='n')
++                      /* (a!='y') && (a!='m') -> (a='n') */
+                       return expr_alloc_comp(E_EQUAL, sym1, &symbol_no);
+               if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
+                          ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
+                           (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod)))
+-                      // (a!='m') && (a!='n') -> (a='m')
++                      /* (a!='m') && (a!='n') -> (a='m') */
+                       return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
+               if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) ||
+@@ -579,7 +579,7 @@
+       switch (e1->type) {
+       case E_OR:
+               expr_eliminate_dups2(e1->type, &e1, &e1);
+-              // (FOO || BAR) && (!FOO && !BAR) -> n
++              /* (FOO || BAR) && (!FOO && !BAR) -> n */
+               tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
+               tmp2 = expr_copy(e2);
+               tmp = expr_extract_eq_and(&tmp1, &tmp2);
+@@ -594,7 +594,7 @@
+               break;
+       case E_AND:
+               expr_eliminate_dups2(e1->type, &e1, &e1);
+-              // (FOO && BAR) || (!FOO || !BAR) -> y
++              /* (FOO && BAR) || (!FOO || !BAR) -> y */
+               tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
+               tmp2 = expr_copy(e2);
+               tmp = expr_extract_eq_or(&tmp1, &tmp2);
+@@ -703,7 +703,7 @@
+       case E_NOT:
+               switch (e->left.expr->type) {
+               case E_NOT:
+-                      // !!a -> a
++                      /* !!a -> a */
+                       tmp = e->left.expr->left.expr;
+                       free(e->left.expr);
+                       free(e);
+@@ -712,14 +712,14 @@
+                       break;
+               case E_EQUAL:
+               case E_UNEQUAL:
+-                      // !a='x' -> a!='x'
++                      /* !a='x' -> a!='x' */
+                       tmp = e->left.expr;
+                       free(e);
+                       e = tmp;
+                       e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL;
+                       break;
+               case E_OR:
+-                      // !(a || b) -> !a && !b
++                      /* !(a || b) -> !a && !b */
+                       tmp = e->left.expr;
+                       e->type = E_AND;
+                       e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
+@@ -728,7 +728,7 @@
+                       e = expr_transform(e);
+                       break;
+               case E_AND:
+-                      // !(a && b) -> !a || !b
++                      /* !(a && b) -> !a || !b */
+                       tmp = e->left.expr;
+                       e->type = E_OR;
+                       e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
+@@ -738,7 +738,7 @@
+                       break;
+               case E_SYMBOL:
+                       if (e->left.expr->left.sym == &symbol_yes) {
+-                              // !'y' -> 'n'
++                              /* !'y' -> 'n' */
+                               tmp = e->left.expr;
+                               free(e);
+                               e = tmp;
+@@ -747,7 +747,7 @@
+                               break;
+                       }
+                       if (e->left.expr->left.sym == &symbol_mod) {
+-                              // !'m' -> 'm'
++                              /* !'m' -> 'm' */
+                               tmp = e->left.expr;
+                               free(e);
+                               e = tmp;
+@@ -756,7 +756,7 @@
+                               break;
+                       }
+                       if (e->left.expr->left.sym == &symbol_no) {
+-                              // !'n' -> 'y'
++                              /* !'n' -> 'y' */
+                               tmp = e->left.expr;
+                               free(e);
+                               e = tmp;