changeset 323:d5cb084fc3f4

typedef struct tag before struct fields def.
author kono
date Sat, 19 Jun 2004 17:50:40 +0900
parents 46ac55e8b14c
children 575481408653
files mc-parse.c
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mc-parse.c	Sat Jun 19 11:02:28 2004 +0900
+++ b/mc-parse.c	Sat Jun 19 17:50:40 2004 +0900
@@ -1399,8 +1399,10 @@
 	    if(nptr0->sc == EMPTY) nptr0=gnptr0;
 	    if(nptr0->sc == EMPTY) nptr0->sc = TAG;
 	    if(nptr0->sc != TAG) error(TYERR);
-	    fields = caddr(nptr0->ty);
-	    disp = cadr(nptr0->ty);
+	    if (nptr0->ty) {
+		fields = caddr(nptr0->ty);
+		disp = cadr(nptr0->ty);
+	    }
 	    conv->comment_(' ');
 	    type0 = list4(s,disp,fields,(int)nptr0);
 	}
@@ -3358,9 +3360,15 @@
     /* type = list4(s,disp,fields,tag_nptr); */
 
 static int
-search_struct_type(int t,char *name,int *dsp)
+search_struct_type(int type,char *name,int *dsp)
 {
-    t = caddr(t);
+    int t;
+    NMTBL *nptr0;
+    t = caddr(type);
+    if (t==0) {
+	nptr0=(NMTBL*)cadddr(type);
+	t = caddr(type) = caddr(nptr0->ty);
+    }
     for(;t;t = cadr(t)) {
 	if (neqname((char *)caddr(t),name)==0) {
 	    *dsp = cadddr(t);