lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue 4560: group #include directives at top of file (issue 263730043 by


From: nine . fierce . ballads
Subject: Issue 4560: group #include directives at top of file (issue 263730043 by address@hidden)
Date: Fri, 14 Aug 2015 01:12:07 +0000

Reviewers: ,

Description:
Issue 4560: group #include directives at top of file

This is so that using-declarations can later be added without
appearing before #includes.

Please review this at https://codereview.appspot.com/263730043/

Affected files (+47, -45 lines):
  M flower/file-path.cc
  M flower/include/direction.hh
  M flower/std-string.cc
  M lily/collision-engraver.cc
  M lily/function-documentation.cc
  M lily/grid-line-span-engraver.cc
  M lily/grob-pq-engraver.cc
  M lily/ledger-line-engraver.cc
  M lily/piano-pedal-align-engraver.cc
  M lily/pitched-trill-engraver.cc
  M lily/pure-from-neighbor-engraver.cc
  M lily/relocate.cc
  M lily/rest-collision-engraver.cc
  M lily/span-arpeggio-engraver.cc
  M lily/span-bar-engraver.cc
  M lily/span-bar-stub-engraver.cc
  M lily/staff-performer.cc
  M lily/system-start-delimiter-engraver.cc


Index: flower/file-path.cc
diff --git a/flower/file-path.cc b/flower/file-path.cc
index 09e9c4a2fae2d5b2e6119d2072b0f4ad7a4ecf33..65cd517e5a07247fc798277631be1857601679e0 100644
--- a/flower/file-path.cc
+++ b/flower/file-path.cc
@@ -39,13 +39,14 @@
 #define PATHSEP ':'
 #endif

+#include <algorithm>
+
 vector<string>
 File_path::directories () const
 {
   return dirs_;
 }

-#include <algorithm>
 void
 File_path::parse_path (const string &p)
 {
Index: flower/include/direction.hh
diff --git a/flower/include/direction.hh b/flower/include/direction.hh
index f3b31e3811a7c5245c294cbd72322b9dc3cd184d..e9a7eea230230492b9821377bc32bb83217c9f1b 100644
--- a/flower/include/direction.hh
+++ b/flower/include/direction.hh
@@ -20,6 +20,7 @@
 #ifndef DIRECTION_HH
 #define DIRECTION_HH

+#include <algorithm>
 #include "axis.hh"

 enum Direction
Index: flower/std-string.cc
diff --git a/flower/std-string.cc b/flower/std-string.cc
index 347f0f3688a449fe1d219cd6a4040804cf4ee9dc..4b2ff4a4e6ceb7ffc25bce2bef8313c94dd58449 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)
@@ -122,8 +123,6 @@ string_compare (string const &a, string const &b)
   return a.compare (b);
 }

-#include "std-vector.hh"
-
 vector<string>
 string_split (string str, char c)
 {
Index: lily/collision-engraver.cc
diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc
index d2cf95e1e8515d33962325207af37dd59e456cb6..cb893738ac78dffa376573c0db56351055bbb9f1 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,
Index: lily/function-documentation.cc
diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc
index 8535f7f2a672fc0c80c411bdc7589b4a55e8220c..756f174512417ef14a58e3722d2ec84ebb72356a 100644
--- a/lily/function-documentation.cc
+++ b/lily/function-documentation.cc
@@ -18,12 +18,25 @@
 */

 #include <cstring>
+#include <map>
 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>
-
 map<void *, string> 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 ()
 {
Index: lily/grid-line-span-engraver.cc
diff --git a/lily/grid-line-span-engraver.cc b/lily/grid-line-span-engraver.cc index d51236b68150b5f958458bc13343782f56b20aea..a61f61df789162cd495cca4b73e202a995784019 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 */
Index: lily/grob-pq-engraver.cc
diff --git a/lily/grob-pq-engraver.cc b/lily/grob-pq-engraver.cc
index 8644f6f08315902e8597b596ad2d409b69a7669f..45b4ff2b359d7aca819c4ab074145eb9df430e4a 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 */
Index: lily/ledger-line-engraver.cc
diff --git a/lily/ledger-line-engraver.cc b/lily/ledger-line-engraver.cc
index 40ef019d234d80d0733e48455dd672b689b6ce30..8e871c1abf868c5ee53f34ffb82eaa5a4f2e6039 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,
Index: lily/piano-pedal-align-engraver.cc
diff --git a/lily/piano-pedal-align-engraver.cc b/lily/piano-pedal-align-engraver.cc index 0be5ff4b17d85f421a3bb0203b6c6587dcd5fc4c..7134a6cfc7797d895491db906a751d502bfc3295 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);
Index: lily/pitched-trill-engraver.cc
diff --git a/lily/pitched-trill-engraver.cc b/lily/pitched-trill-engraver.cc
index ac9e4dfd4d7f5be52aa9aa3e3b68aed6f0336026..30d734346e53df7565c419817a9637ad1524afc0 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);
Index: lily/pure-from-neighbor-engraver.cc
diff --git a/lily/pure-from-neighbor-engraver.cc b/lily/pure-from-neighbor-engraver.cc index 7061a9268498b3c492e9d2eb07a55cfccadd37b7..66a2ff1972ca3165a94e512d3118923d25016333 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<Grob *> 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,
Index: lily/relocate.cc
diff --git a/lily/relocate.cc b/lily/relocate.cc
index 73fde03f15dd77f656712654da90f1c6f5a05d2c..879377a1cc0928bae14c6fd92c5fd8f032eacac2 100644
--- a/lily/relocate.cc
+++ b/lily/relocate.cc
@@ -39,6 +39,10 @@
 #include "version.hh"
 #include "warn.hh"

+#ifdef __MINGW32__
+#include <winbase.h>
+#endif
+
 #define FRAMEWORKDIR ".."

 int
@@ -103,10 +107,6 @@ prepend_env_path (char const *key, string value)
   return -1;
 }

-#ifdef __MINGW32__
-#include <winbase.h>
-#endif
-
 static void
 prefix_relocation (const string &prefix)
 {
Index: lily/rest-collision-engraver.cc
diff --git a/lily/rest-collision-engraver.cc b/lily/rest-collision-engraver.cc index 20e7eb9fc784940fe610bec1d6348d5382616250..104c38ab3baf5236010496884613935268cd31ac 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.",
Index: lily/span-arpeggio-engraver.cc
diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc
index e81dcfe258235f2842b73c92b4072d57d24680f2..f66c8770b52333c9bbc23c19d9d3c01bbeb510a8 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,
Index: lily/span-bar-engraver.cc
diff --git a/lily/span-bar-engraver.cc b/lily/span-bar-engraver.cc
index d8f7590ea551248d35174a87875d63f074e4fbe3..63c245e70cbcb32f4620b4e8ecd4fd9a9ae4b8c7 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 */
Index: lily/span-bar-stub-engraver.cc
diff --git a/lily/span-bar-stub-engraver.cc b/lily/span-bar-stub-engraver.cc
index 0f1df50b6e3b3c027b3ea9f024e35ecbd65562e3..3517c3f5fd38e6e3938a567b90f63caab4adf733 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,
Index: lily/staff-performer.cc
diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc
index 7874e50db38230f697479a376c23eeec35da902a..0648d0aae8bee5c8a7214c563d54798526344092 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<string, int> 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 */
                 "",
Index: lily/system-start-delimiter-engraver.cc
diff --git a/lily/system-start-delimiter-engraver.cc b/lily/system-start-delimiter-engraver.cc index a37c520dfc9cc82e4b9969f20d0e2d71c910b6bd..7eadbb0eec3ca70d0cfec80e8685b888f33f5273 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);






reply via email to

[Prev in Thread] Current Thread [Next in Thread]