handle opaque structs better
This commit is contained in:
parent
3d99190131
commit
df7993f9c9
1 changed files with 5 additions and 1 deletions
|
|
@ -315,6 +315,8 @@ nilstrcmp(char *a, char *b)
|
||||||
return strcmp(a, b);
|
return strcmp(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int careaboutaggrcount;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
typecmp(Type *t, Type *u)
|
typecmp(Type *t, Type *u)
|
||||||
{
|
{
|
||||||
|
|
@ -343,7 +345,7 @@ typecmp(Type *t, Type *u)
|
||||||
if(i)
|
if(i)
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
if(t->ty == Aggr){
|
if(careaboutaggrcount && t->ty == Aggr){
|
||||||
if(t->n > u->n)
|
if(t->n > u->n)
|
||||||
return -1;
|
return -1;
|
||||||
if(t->n < u->n)
|
if(t->n < u->n)
|
||||||
|
|
@ -547,7 +549,9 @@ printtypes(Biobuf *b)
|
||||||
for(tl=alltypes; tl; tl=tl->tl)
|
for(tl=alltypes; tl; tl=tl->tl)
|
||||||
all[n++] = tl->hd;
|
all[n++] = tl->hd;
|
||||||
|
|
||||||
|
careaboutaggrcount = 1;
|
||||||
qsort(all, n, sizeof(all[0]), qtypecmp);
|
qsort(all, n, sizeof(all[0]), qtypecmp);
|
||||||
|
careaboutaggrcount = 0;
|
||||||
|
|
||||||
nn = 0;
|
nn = 0;
|
||||||
for(i=0; i<n; i++){
|
for(i=0; i<n; i++){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue