Show the sum of the members sizeof only if there are holes, and if so print the

sum of all holes too.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2006-10-25 13:18:43 -03:00
parent 031b291d9a
commit 2338691b42
1 changed files with 5 additions and 2 deletions

View File

@ -321,8 +321,11 @@ void class__print(struct class *self)
sum_holes += hole;
}
printf("}; /* sizeof struct: %d, sum sizeof members: %lu */\n",
self->size, sum);
printf("}; /* sizeof struct: %d",
self->size);
if (sum_holes > 0)
printf(", sum sizeof members: %lu, sum holes: %lu", sum, sum_holes);
puts(" */");
if (sum + sum_holes != self->size)
printf("\n/* BRAIN FART ALERT! %d != %d + %d(holes), diff = %d */\n\n",