]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4401: Remove unnecessary static casts on function member pointers
authorDavid Kastrup <dak@gnu.org>
Sun, 17 May 2015 14:14:09 +0000 (16:14 +0200)
committerDavid Kastrup <dak@gnu.org>
Fri, 22 May 2015 08:35:57 +0000 (10:35 +0200)
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.

lily/include/smobs.tcc

index 913785315ae9bb46f9d72f1ea6f44233ac5e277e..940f0032ae975ee47d6f202951f55d30527df825 100644 (file)
@@ -135,13 +135,7 @@ void Smob_base<Super>::init ()
 
   if (&Super::free_smob != &Smob_base<Super>::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<SCM (Super::*)()>(&Super::mark_smob) !=
-      static_cast<SCM (Super::*)()>(&Smob_base<Super>::mark_smob))
+  if (&Super::mark_smob != &Smob_base<Super>::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<Super>::equal_p)