]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 2088: Replace automatic pointer-to-member function conversions
authorDavid Kastrup <dak@gnu.org>
Thu, 21 Feb 2013 09:38:14 +0000 (10:38 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 25 Feb 2013 21:53:34 +0000 (22:53 +0100)
Those are a GCC extension and thus a portability problem.

lily/GNUmakefile
lily/include/lily-proto.hh
lily/include/translator-group.hh
lily/translator-dispatch-list.cc

index e67a8836758a4a2f9e578bf0b7427218995ba6de..ba19ac9559e90cd2a4f16e668df11a482c7dcb59 100644 (file)
@@ -6,9 +6,6 @@ NAME = lilypond
 MODULE_LIBS=$(depth)/flower
 MODULE_INCLUDES= $(depth)/flower/include
 
-# need this to convert between function pointers and member function pointers.
-MODULE_CXXFLAGS= -Wno-pmf-conversions 
-
 
 HELP2MAN_EXECS = lilypond
 STEPMAKE_TEMPLATES=c c++ executable po help2man
index e726c4abe57d6796eb0c133ca5cecc56cc8140e2..53e863c2a9e9f9d32a3a8137dad8631c28448450 100644 (file)
@@ -198,8 +198,7 @@ class Translator_group;
 class Transposed_music;
 class yyFlexLexer;
 
-typedef void (*Engraver_void_function_engraver_grob_info) (Engraver *,
-                                                           Grob_info);
-typedef void (*Translator_void_method_ptr) (Translator *);
+typedef void (Engraver::*Engraver_void_function_engraver_grob_info) (Grob_info);
+typedef void (Translator::*Translator_void_method_ptr) ();
 
 #endif /* LILY_PROTO_HH */
index e5004c2925cd7cda2530b0b343977d2e9d1660d5..ad044de86075d6d9e9178d05a4ed11fd8d81335d 100644 (file)
@@ -43,7 +43,7 @@ struct Translator_method_binding
   void invoke ()
   {
     if (method_)
-      (*method_) (translator_);
+      (translator_->*method_) ();
   }
 };
 
index 6c74b259be4ab377aec8cd4117d9a757a9c36a2c..dffaa095f6013731855137d50469314901ec2792 100644 (file)
@@ -32,7 +32,7 @@ Engraver_dispatch_list::apply (Grob_info gi)
       if (e.engraver_ == origin)
         continue;
 
-      (*e.function_) (e.engraver_, gi);
+      (e.engraver_->*e.function_) (gi);
     }
 }