From: Dan Eble Date: Sat, 8 Aug 2015 17:11:02 +0000 (-0400) Subject: Issue 4560: group #include directives at top of file X-Git-Tag: release/2.19.26-1~23 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=7d71f371e483a4a305fc16a2b3fbce879a464253;p=lilypond.git Issue 4560: group #include directives at top of file This is so that using-declarations can later be added without appearing before #includes. --- diff --git a/flower/file-path.cc b/flower/file-path.cc index 09e9c4a2fa..65cd517e5a 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -39,13 +39,14 @@ #define PATHSEP ':' #endif +#include + vector File_path::directories () const { return dirs_; } -#include void File_path::parse_path (const string &p) { diff --git a/flower/include/direction.hh b/flower/include/direction.hh index de13ef4ca8..0d36c0f7c7 100644 --- a/flower/include/direction.hh +++ b/flower/include/direction.hh @@ -20,6 +20,7 @@ #ifndef DIRECTION_HH #define DIRECTION_HH +#include #include "axis.hh" enum Direction diff --git a/flower/std-string.cc b/flower/std-string.cc index 9666b9e9c3..593a286d84 100644 --- a/flower/std-string.cc +++ b/flower/std-string.cc @@ -19,6 +19,7 @@ #include "std-string.hh" #include "string-convert.hh" +#include "std-vector.hh" string to_string (const string &s) @@ -116,8 +117,6 @@ string_copy (const string &s) return dest; } -#include "std-vector.hh" - vector string_split (string str, char c) { diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index 35f8015a68..d1eb2dd3c0 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -23,6 +23,8 @@ #include "axis-group-interface.hh" #include "item.hh" +#include "translator.icc" + class Collision_engraver : public Engraver { Item *col_; @@ -76,8 +78,6 @@ Collision_engraver::Collision_engraver () col_ = 0; } -#include "translator.icc" - ADD_ACKNOWLEDGER (Collision_engraver, note_column); ADD_TRANSLATOR (Collision_engraver, diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc index 8535f7f2a6..756f174512 100644 --- a/lily/function-documentation.cc +++ b/lily/function-documentation.cc @@ -18,12 +18,25 @@ */ #include +#include using namespace std; #include "std-string.hh" #include "lily-guile.hh" #include "warn.hh" +/* type predicates. */ +#include "global-context.hh" +#include "input.hh" +#include "item.hh" +#include "music.hh" +#include "music-function.hh" +#include "paper-score.hh" +#include "performance.hh" +#include "spanner.hh" +#include "stream-event.hh" +#include "unpure-pure-container.hh" + static SCM doc_hash_table; void @@ -64,8 +77,6 @@ LY_DEFINE (ly_get_all_function_documentation, "ly:get-all-function-documentation return doc_hash_table; } -#include - map type_names; void @@ -87,18 +98,6 @@ predicate_to_typename (void *ptr) return type_names[ptr]; } -/* type predicates. */ -#include "global-context.hh" -#include "input.hh" -#include "item.hh" -#include "music.hh" -#include "music-function.hh" -#include "paper-score.hh" -#include "performance.hh" -#include "spanner.hh" -#include "stream-event.hh" -#include "unpure-pure-container.hh" - void init_func_doc () { diff --git a/lily/grid-line-span-engraver.cc b/lily/grid-line-span-engraver.cc index d51236b681..a61f61df78 100644 --- a/lily/grid-line-span-engraver.cc +++ b/lily/grid-line-span-engraver.cc @@ -21,6 +21,8 @@ #include "item.hh" #include "grid-line-interface.hh" +#include "translator.icc" + class Grid_line_span_engraver : public Engraver { Item *spanline_; @@ -68,7 +70,6 @@ Grid_line_span_engraver::stop_translation_timestep () lines_.resize (0); } -#include "translator.icc" ADD_ACKNOWLEDGER (Grid_line_span_engraver, grid_point); ADD_TRANSLATOR (Grid_line_span_engraver, /* doc */ diff --git a/lily/grob-pq-engraver.cc b/lily/grob-pq-engraver.cc index 8644f6f083..45b4ff2b35 100644 --- a/lily/grob-pq-engraver.cc +++ b/lily/grob-pq-engraver.cc @@ -22,6 +22,8 @@ #include "grob.hh" #include "warn.hh" +#include "translator.icc" + struct Grob_pq_entry { Grob *grob_; @@ -146,7 +148,6 @@ Grob_pq_engraver::start_translation_timestep () context ()->set_property ("busyGrobs", busy); } -#include "translator.icc" ADD_ACKNOWLEDGER (Grob_pq_engraver, grob); ADD_TRANSLATOR (Grob_pq_engraver, /* doc */ diff --git a/lily/ledger-line-engraver.cc b/lily/ledger-line-engraver.cc index 40ef019d23..8e871c1abf 100644 --- a/lily/ledger-line-engraver.cc +++ b/lily/ledger-line-engraver.cc @@ -22,6 +22,8 @@ #include "engraver.hh" #include "staff-symbol.hh" +#include "translator.icc" + class Ledger_line_engraver : public Engraver { Spanner *span_; @@ -118,8 +120,6 @@ Ledger_line_engraver::acknowledge_ledgered (Grob_info s) ledgered_grobs_.push_back (s.grob ()); } -#include "translator.icc" - ADD_ACKNOWLEDGER (Ledger_line_engraver, ledgered); ADD_ACKNOWLEDGER (Ledger_line_engraver, staff_symbol); ADD_TRANSLATOR (Ledger_line_engraver, diff --git a/lily/piano-pedal-align-engraver.cc b/lily/piano-pedal-align-engraver.cc index 0be5ff4b17..7134a6cfc7 100644 --- a/lily/piano-pedal-align-engraver.cc +++ b/lily/piano-pedal-align-engraver.cc @@ -27,6 +27,8 @@ #include "warn.hh" #include "axis-group-interface.hh" +#include "translator.icc" + /* TODO: @@ -246,8 +248,6 @@ Piano_pedal_align_engraver::finalize () } } -#include "translator.icc" - ADD_ACKNOWLEDGER (Piano_pedal_align_engraver, note_column); ADD_ACKNOWLEDGER (Piano_pedal_align_engraver, piano_pedal_bracket); ADD_ACKNOWLEDGER (Piano_pedal_align_engraver, piano_pedal_script); diff --git a/lily/pitched-trill-engraver.cc b/lily/pitched-trill-engraver.cc index ac9e4dfd4d..30d734346e 100644 --- a/lily/pitched-trill-engraver.cc +++ b/lily/pitched-trill-engraver.cc @@ -30,6 +30,8 @@ #include "stream-event.hh" #include "warn.hh" +#include "translator.icc" + class Pitched_trill_engraver : public Engraver { public: @@ -167,8 +169,6 @@ Pitched_trill_engraver::stop_translation_timestep () trill_accidental_ = 0; } -#include "translator.icc" - ADD_ACKNOWLEDGER (Pitched_trill_engraver, note_head); ADD_ACKNOWLEDGER (Pitched_trill_engraver, dots); ADD_ACKNOWLEDGER (Pitched_trill_engraver, stem); diff --git a/lily/pure-from-neighbor-engraver.cc b/lily/pure-from-neighbor-engraver.cc index e073785006..e147f53cca 100644 --- a/lily/pure-from-neighbor-engraver.cc +++ b/lily/pure-from-neighbor-engraver.cc @@ -26,6 +26,8 @@ #include "pure-from-neighbor-interface.hh" #include "engraver.hh" +#include "translator.icc" + class Pure_from_neighbor_engraver : public Engraver { vector pure_relevants_; @@ -134,8 +136,6 @@ Pure_from_neighbor_engraver::finalize () pure_relevants_.clear (); } -#include "translator.icc" - ADD_ACKNOWLEDGER (Pure_from_neighbor_engraver, item); ADD_ACKNOWLEDGER (Pure_from_neighbor_engraver, pure_from_neighbor); ADD_TRANSLATOR (Pure_from_neighbor_engraver, diff --git a/lily/relocate.cc b/lily/relocate.cc index 73fde03f15..879377a1cc 100644 --- a/lily/relocate.cc +++ b/lily/relocate.cc @@ -39,6 +39,10 @@ #include "version.hh" #include "warn.hh" +#ifdef __MINGW32__ +#include +#endif + #define FRAMEWORKDIR ".." int @@ -103,10 +107,6 @@ prepend_env_path (char const *key, string value) return -1; } -#ifdef __MINGW32__ -#include -#endif - static void prefix_relocation (const string &prefix) { diff --git a/lily/rest-collision-engraver.cc b/lily/rest-collision-engraver.cc index e261502201..a70641cfd0 100644 --- a/lily/rest-collision-engraver.cc +++ b/lily/rest-collision-engraver.cc @@ -32,6 +32,8 @@ #include "stream-event.hh" #include "warn.hh" +#include "translator.icc" + class Rest_collision_engraver : public Engraver { protected: @@ -92,8 +94,6 @@ Rest_collision_engraver::stop_translation_timestep () rest_collision_ = 0; } -#include "translator.icc" - ADD_TRANSLATOR (Rest_collision_engraver, /* doc */ "Handle collisions of rests.", diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc index e81dcfe258..f66c8770b5 100644 --- a/lily/span-arpeggio-engraver.cc +++ b/lily/span-arpeggio-engraver.cc @@ -27,6 +27,8 @@ #include "side-position-interface.hh" #include "staff-symbol-referencer.hh" +#include "translator.icc" + /** Make arpeggios that span multiple staves. Catch arpeggios, and span a Span_arpeggio over them if we find more than two arpeggios. @@ -123,8 +125,6 @@ Span_arpeggio_engraver::stop_translation_timestep () note_columns_.clear (); } -#include "translator.icc" - ADD_ACKNOWLEDGER (Span_arpeggio_engraver, arpeggio); ADD_ACKNOWLEDGER (Span_arpeggio_engraver, note_column); ADD_TRANSLATOR (Span_arpeggio_engraver, diff --git a/lily/span-bar-engraver.cc b/lily/span-bar-engraver.cc index d8f7590ea5..63c245e70c 100644 --- a/lily/span-bar-engraver.cc +++ b/lily/span-bar-engraver.cc @@ -22,6 +22,8 @@ #include "pointer-group-interface.hh" #include "lily-imports.hh" +#include "translator.icc" + /** Make bars that span multiple "staves". Catch bars, and span a @@ -92,8 +94,6 @@ Span_bar_engraver::stop_translation_timestep () bars_.resize (0); } -#include "translator.icc" - ADD_ACKNOWLEDGER (Span_bar_engraver, bar_line); ADD_TRANSLATOR (Span_bar_engraver, /* doc */ diff --git a/lily/span-bar-stub-engraver.cc b/lily/span-bar-stub-engraver.cc index 0f1df50b6e..3517c3f5fd 100644 --- a/lily/span-bar-stub-engraver.cc +++ b/lily/span-bar-stub-engraver.cc @@ -27,6 +27,8 @@ #include "pointer-group-interface.hh" #include "engraver.hh" +#include "translator.icc" + /* The Span_bar_stub_engraver creates SpanBarStub grobs in the contexts that a grouping context contains. For example, if a PianoStaff contains @@ -174,8 +176,6 @@ Span_bar_stub_engraver::stop_translation_timestep () axis_groups_ = axis_groups; } -#include "translator.icc" - ADD_ACKNOWLEDGER (Span_bar_stub_engraver, span_bar); ADD_ACKNOWLEDGER (Span_bar_stub_engraver, hara_kiri_group_spanner); ADD_TRANSLATOR (Span_bar_stub_engraver, diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index 7874e50db3..0648d0aae8 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -29,6 +29,8 @@ #include "warn.hh" #include "lily-imports.hh" +#include "translator.icc" + /* Perform a staff. Individual notes should have their instrument (staff-wide) set, so we override play_element () */ @@ -77,8 +79,6 @@ map Staff_performer::static_channel_map_; int Staff_performer::channel_count_ = 0; int Staff_performer::staff_performer_count_ = 0; -#include "translator.icc" - ADD_TRANSLATOR (Staff_performer, /* doc */ "", diff --git a/lily/system-start-delimiter-engraver.cc b/lily/system-start-delimiter-engraver.cc index a37c520dfc..7eadbb0eec 100644 --- a/lily/system-start-delimiter-engraver.cc +++ b/lily/system-start-delimiter-engraver.cc @@ -26,6 +26,8 @@ #include "staff-symbol.hh" #include "system-start-delimiter.hh" +#include "translator.icc" + struct Bracket_nesting_node { public: @@ -227,8 +229,6 @@ System_start_delimiter_engraver::acknowledge_system_start_delimiter (Grob_info i nesting_->add_support (inf.grob ()); } -#include "translator.icc" - ADD_ACKNOWLEDGER (System_start_delimiter_engraver, staff_symbol); ADD_ACKNOWLEDGER (System_start_delimiter_engraver, system_start_delimiter);