tFix bug in typedef guys. - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 733e9d3977ae9896f94b1f7312b0398ccce19c35
 (DIR) parent 79f2723f25b698aabc25d7f7bc6b551b58d3716b
 (HTM) Author: rsc <devnull@localhost>
       Date:   Wed, 21 Apr 2004 02:40:59 +0000
       
       Fix bug in typedef guys.
       
       Diffstat:
         M src/cmd/acidtypes/dat.h             |       1 +
         M src/cmd/acidtypes/dwarf.c           |       9 ++++++++-
         M src/cmd/acidtypes/type.c            |       2 +-
       
       3 files changed, 10 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/acidtypes/dat.h b/src/cmd/acidtypes/dat.h
       t@@ -74,6 +74,7 @@ int dwarf2acid(struct Dwarf*, Biobuf*);
        int stabs2acid(struct Stab*, Biobuf*);
        
        Type *newtype(void);
       +Type *defer(Type*);
        char *nameof(Type*, int);
        void freetypes(void);
        
 (DIR) diff --git a/src/cmd/acidtypes/dwarf.c b/src/cmd/acidtypes/dwarf.c
       t@@ -113,7 +113,6 @@ ds2acid(Dwarf *d, DwarfSym *s, Biobuf *b, char *fn)
                        t->sub = typebynum(s->attrs.type, 0);
                        break;
        
       -
                case TagConstType:
                case TagVolatileType:
                        t = xnewtype(Defer, s);
       t@@ -175,6 +174,14 @@ ds2acid(Dwarf *d, DwarfSym *s, Biobuf *b, char *fn)
                                t->n++;
                        }
                        break;
       +
       +        case TagFormalParameter:
       +        case TagVariable:
       +fprint(2, "var %s %lud\n", s->attrs.name, (ulong)s->attrs.type);
       +                if(s->attrs.name==nil || s->attrs.type==0)
       +                        break;
       +                addsymx(fn, s->attrs.name, typebynum(s->attrs.type, 0));
       +                break;
                }
        }
        
 (DIR) diff --git a/src/cmd/acidtypes/type.c b/src/cmd/acidtypes/type.c
       t@@ -165,7 +165,7 @@ renumber(TypeList *tl, uint n1)
                }
        }
        
       -static Type*
       +Type*
        defer(Type *t)
        {
                Type *u, *oldt;