fprintf: Remove bogus deduction of negative hole from size of previous field
In the previous fix for the usage of padding from ancestor classes the
negative hole was being deducted from the calculation of the previous
member/ancestor that is done purely using the offsets of the current and
previous fields, where it makes no sense to consider the hole, so revert
that specific hunk, with it the "Bitfield combined with next fields"
comment, which is wrong, is removed.
Before:
$ pahole -C Spell_AdjustVital objects/spell_adjustvital.cpp.o
class Spell_AdjustVital : public SpellActionType {
public:
/* class SpellActionType <ancestor>; */ /* 0 16 */
/* XXX last struct has 4 bytes of padding */
void Spell_AdjustVital(class Spell_AdjustVital *);
virtual int Cast(class Spell_AdjustVital *, class CUnit &, const class SpellType &, class CUnit * &, const Vec2i &);
virtual void Parse(class Spell_AdjustVital *, lua_State *, int, int);
/* Bitfield combined with next fields */
int HP; /* 12 4 */
int Mana; /* 16 4 */
int Shield; /* 20 4 */
int MaxMultiCast; /* 24 4 */
virtual void ~Spell_AdjustVital(class Spell_AdjustVital *, int);
/* vtable has 2 entries: {
[2] = Cast((null)),
[3] = Parse((null)),
} */
/* size: 32, cachelines: 1, members: 5 */
/* padding: 4 */
/* paddings: 1, sum paddings: 4 */
/* last cacheline: 32 bytes */
};
After:
$ pahole -C Spell_AdjustVital objects/spell_adjustvital.cpp.o
class Spell_AdjustVital : public SpellActionType {
public:
/* class SpellActionType <ancestor>; */ /* 0 16 */
/* XXX last struct has 4 bytes of padding */
void Spell_AdjustVital(class Spell_AdjustVital *);
virtual int Cast(class Spell_AdjustVital *, class CUnit &, const class SpellType &, class CUnit * &, const Vec2i &);
virtual void Parse(class Spell_AdjustVital *, lua_State *, int, int);
int HP; /* 12 4 */
int Mana; /* 16 4 */
int Shield; /* 20 4 */
int MaxMultiCast; /* 24 4 */
virtual void ~Spell_AdjustVital(class Spell_AdjustVital *, int);
/* vtable has 2 entries: {
[2] = Cast((null)),
[3] = Parse((null)),
} */
/* size: 32, cachelines: 1, members: 5 */
/* padding: 4 */
/* paddings: 1, sum paddings: 4 */
/* last cacheline: 32 bytes */
};
$
Reported-by: Matthias Schwarzott <zzam@gentoo.org>
Fixes:
47e83035c12c153b ("core: The padding in ancestor classes may be used in descendants")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>