summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kastrup <dak@gnu.org>2013-02-21 10:38:14 +0100
committerDavid Kastrup <dak@gnu.org>2013-02-25 22:53:34 +0100
commit4256f121bdbb6310cbb7162f1d38632dfec11519 (patch)
treeb2cb3984944ebc22a1028d5fec567fc92b9e33fe
parent4961143c8c79984852c575e2b2b3922e5f7540ce (diff)
Issue 2088: Replace automatic pointer-to-member function conversions
Those are a GCC extension and thus a portability problem.
-rw-r--r--lily/GNUmakefile3
-rw-r--r--lily/include/lily-proto.hh5
-rw-r--r--lily/include/translator-group.hh2
-rw-r--r--lily/translator-dispatch-list.cc2
4 files changed, 4 insertions, 8 deletions
diff --git a/lily/GNUmakefile b/lily/GNUmakefile
index e67a883675..ba19ac9559 100644
--- a/lily/GNUmakefile
+++ b/lily/GNUmakefile
@@ -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
diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh
index e726c4abe5..53e863c2a9 100644
--- a/lily/include/lily-proto.hh
+++ b/lily/include/lily-proto.hh
@@ -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 */
diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh
index e5004c2925..ad044de860 100644
--- a/lily/include/translator-group.hh
+++ b/lily/include/translator-group.hh
@@ -43,7 +43,7 @@ struct Translator_method_binding
void invoke ()
{
if (method_)
- (*method_) (translator_);
+ (translator_->*method_) ();
}
};
diff --git a/lily/translator-dispatch-list.cc b/lily/translator-dispatch-list.cc
index 6c74b259be..dffaa095f6 100644
--- a/lily/translator-dispatch-list.cc
+++ b/lily/translator-dispatch-list.cc
@@ -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);
}
}