changeset 874:3454953b3df0

fix inline strinit not yet worked.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 01 Apr 2014 23:25:05 +0900
parents 509a394c5ff9
children 34ecf0e6304a
files mc-parse.c test/strinit.c
diffstat 2 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/mc-parse.c	Tue Apr 01 18:02:03 2014 +0900
+++ b/mc-parse.c	Tue Apr 01 23:25:05 2014 +0900
@@ -1596,13 +1596,13 @@
          // missing brace case
          error(SIERR);
          if (inmode) {
-             offset = list3(DECL_DATA,e,car(t1));
-             return offset;
+             offset = list4(DECL_DATA_LIST,offset,list3(DECL_DATA,e,car(t1)),car(t1));
+         } else {
+             offset = assign_data(e,car(t1),v,offset);
          }
-         offset = assign_data(e,car(t1),v,offset);
          t1 = cadr(t1);
          if (! ( t1 && sym==COMMA)) return offset;
-         conv->comma_(); getsym(0);  // fall thru
+         conv->comma_(); getsym(0);  // fall through
     }
     mode=SFDINIT;
     while(1) {
--- a/test/strinit.c	Tue Apr 01 18:02:03 2014 +0900
+++ b/test/strinit.c	Tue Apr 01 23:25:05 2014 +0900
@@ -129,7 +129,7 @@
                                        { .sport = sport,
                                          .dport = dport } } };
 
-	printf("#0131:%x %x\n",fl.oif,fl.uli_u.ports.dport);
+        printf("#0131:%x %x\n",fl.oif,fl.uli_u.ports.dport);
 }
 
 INLINE static 
@@ -138,7 +138,7 @@
                                    u16 sport, u16 dport /*, struct sock *sk */)
 {
         struct flowi fl = { .oif = oif,
-			    .iif = 55,
+                            .iif = 55,
                             .nl_u = { .ip4_u = { .daddr = dst,
                                                  .saddr = 66,
                                                  .tos = tos } },
@@ -147,8 +147,8 @@
                                        { .sport = sport,
                                          .dport = dport } } };
 
-	printf("#0149:%x %x\n",fl.oif,fl.uli_u.ports.dport);
-	printf("#0150:%x %x\n",fl.iif,fl.nl_u.ip4_u.saddr);
+        printf("#0149:%x %x\n",fl.oif,fl.uli_u.ports.dport);
+        printf("#0150:%x %x\n",fl.iif,fl.nl_u.ip4_u.saddr);
 }
 
 INLINE static 
@@ -158,7 +158,7 @@
 {
         struct flowi fl, *flp; 
       fl = (struct flowi){ .oif = oif,
-			    .iif = 55,
+                            .iif = 55,
                             .nl_u = { .ip4_u = { .daddr = dst,
                                                  .saddr = 66,
                                                  .tos = tos } },
@@ -168,8 +168,8 @@
                                          .dport = dport } } };
        flp = &fl;
 
-	printf("#0170:%x %x\n",flp->oif,flp->uli_u.ports.dport);
-	printf("#0171:%x %x\n",flp->iif,flp->nl_u.ip4_u.saddr);
+        printf("#0170:%x %x\n",flp->oif,flp->uli_u.ports.dport);
+        printf("#0171:%x %x\n",flp->iif,flp->nl_u.ip4_u.saddr);
 }
 
 INLINE void