The second patch, "fallout.diff", deals with the fallout from the first patch,
addressing all the new compiler warnings.
Since the C compiler can't tell that e.g. Hash inherits from Obj,
modifications such as these are necessary:
I only found one instance of an inappropriate method invocation in the Lucy
code base, where a Hash method was being invoked on a ZombieCharBuf in a test
- ASSERT_TRUE(batch, Hash_Equals(&foo, Hash_Fetch(hash, (Obj*)&forty)),
+ ASSERT_TRUE(batch, ZCB_Equals(&foo, Hash_Fetch(hash, (Obj*)&forty)),
This turns out to be harmless because both Hash and ZombieCharBuf inherit the
Equals() method from Obj, so it resides at the same offset in both VTables.
However, I think it's inevitable that without the improved type checking,
future contributors to Lucy would have have been bitten at some point. Since
function pointers with completely different signatures may reside at the same
offset in different VTables, the result would be severe: most often, a memory