From: David Kastrup Date: Sun, 17 May 2015 14:14:09 +0000 (+0200) Subject: Issue 4401: Remove unnecessary static casts on function member pointers X-Git-Tag: release/2.19.21-1~9 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=be4b87596f425aae78509a6a5f57d4f1eafe5c97;p=lilypond.git Issue 4401: Remove unnecessary static casts on function member pointers The commits 6d391dc04f0faa3248d64aa36faf38cf9e4e5fa2 Even more typecasting of member function pointers in smobs.tcc 30203dfe5c45fb9c6255512ba0f8366b322d303f Avoid comparing pointers-to-member of covariant types were done as hotfixes (apparently without associated tracker issues) to get the current implementation of smobs to compile with old versions of GCC in GUB as of Oct 2014. The attempts to make these versions of GCC work were ultimately unsuccessful and GUB was upgraded to newer versions of GCC. It does not make sense to retain the workarounds that did not really help. --- diff --git a/lily/include/smobs.tcc b/lily/include/smobs.tcc index 913785315a..940f0032ae 100644 --- a/lily/include/smobs.tcc +++ b/lily/include/smobs.tcc @@ -135,13 +135,7 @@ void Smob_base::init () if (&Super::free_smob != &Smob_base::free_smob) scm_set_smob_free (smob_tag_, Super::free_smob); - // Old GCC versions get their type lattice for pointers-to-members - // tangled up to a degree where we need to typecast _both_ covariant - // types in order to be able to compare them. The other comparisons - // are for static member functions and thus are ordinary function - // pointers which work without those contortions. - if (static_cast(&Super::mark_smob) != - static_cast(&Smob_base::mark_smob)) + if (&Super::mark_smob != &Smob_base::mark_smob) scm_set_smob_mark (smob_tag_, Super::mark_trampoline); scm_set_smob_print (smob_tag_, Super::print_trampoline); if (&Super::equal_p != &Smob_base::equal_p)