On 19/05/2012 00:36, Carl Sorensen wrote:
Thanks for the file, Julien.  I have split the warnings into various
issues.

See issues 2545, 2546, and 2548 through 2554 on the issue tracker.

http://code.google.com/p/lilypond/issues/detail?id=2545&colspec=ID%20Type%2
0Status%20Stars%20Owner%20Patch%20Needs%20Summary

http://code.google.com/p/lilypond/issues/detail?id=2546&colspec=ID%20Type%2
0Status%20Stars%20Owner%20Patch%20Needs%20Summary

etc.

Julien, if you want to fix any of these, I'd be happy to help you get
patches reviewed and pushed.

Here's instructions on uploading a patch for review:

http://lilypond.org/doc/v2.15/Documentation/contributor/commits-and-patches
#uploading-a-patch-for-review
Since I don't have a Google account to sign in to http://codereview.appspot.com/, I attached the patch for 2546. Don't hesitate to tell me if it's ok or not. (I attached a link to why prefix is better).

Julien.

PS : about why it's better to use != instead of < for end iterator comparison, see http://forums.codeguru.com/archive/index.php/t-428940.html
Sorry, I would have preferred a more "official" link
>From d14506cc2b98634be4fed45f142e0fb09bdff311 Mon Sep 17 00:00:00 2001
From: Julien Nabet <serval2...@yahoo.fr>
Date: Sat, 19 May 2012 07:33:17 +0200
Subject: [PATCH] Fix 2546: 	Prefix incrementers may be preferred for
 non-primitive types

See http://en.allexperts.com/q/C-1040/Increment-operators.htm for some explanation
---
 lily/dot-column.cc             |    2 +-
 lily/dot-configuration.cc      |   10 +++++-----
 lily/note-spacing-engraver.cc  |    2 +-
 lily/skyline.cc                |   14 +++++++-------
 lily/tie-engraver.cc           |    4 ++--
 lily/tie-formatting-problem.cc |    2 +-
 lily/tie-performer.cc          |    2 +-
 7 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/lily/dot-column.cc b/lily/dot-column.cc
index 1aa0b72..81b8124 100644
--- a/lily/dot-column.cc
+++ b/lily/dot-column.cc
@@ -194,7 +194,7 @@ Dot_column::calc_positioning_done (SCM smob)
   problem.register_configuration (cfg);
 
   for (Dot_configuration::const_iterator i (cfg.begin ());
-       i != cfg.end (); i++)
+       i != cfg.end (); ++i)
     {
       /*
         Junkme?
diff --git a/lily/dot-configuration.cc b/lily/dot-configuration.cc
index 940420c..d6c04c5 100644
--- a/lily/dot-configuration.cc
+++ b/lily/dot-configuration.cc
@@ -27,7 +27,7 @@ Dot_configuration::badness () const
 {
   int t = 0;
   for (Dot_configuration::const_iterator i (begin ());
-       i != end (); i++)
+       i != end (); ++i)
     {
       int p = i->first;
       int demerit = sqr (p - i->second.pos_) * 2;
@@ -50,7 +50,7 @@ Dot_configuration::print () const
 {
   printf ("dotconf { ");
   for (Dot_configuration::const_iterator i (begin ());
-       i != end (); i++)
+       i != end (); ++i)
     printf ("%d, ", i->first);
   printf ("}\n");
 }
@@ -71,7 +71,7 @@ Dot_configuration::shifted (int k, Direction d) const
   if (d > 0)
     {
       for (Dot_configuration::const_iterator i (begin ());
-           i != end (); i++)
+           i != end (); ++i)
         {
           int p = i->first;
           if (p == k)
@@ -98,7 +98,7 @@ Dot_configuration::shifted (int k, Direction d) const
       Dot_configuration::const_iterator i (end ());
       do
         {
-          i--;
+          --i;
 
           int p = i->first;
           if (p == k)
@@ -157,7 +157,7 @@ Dot_configuration::x_offset () const
 {
   Real off = 0.0;
   for (Dot_configuration::const_iterator i (begin ());
-       i != end (); i++)
+       i != end (); ++i)
     off = max (off, problem_->head_skyline_.height ((*i).first));
 
   return off;
diff --git a/lily/note-spacing-engraver.cc b/lily/note-spacing-engraver.cc
index 8cb1b35..c1d2405 100644
--- a/lily/note-spacing-engraver.cc
+++ b/lily/note-spacing-engraver.cc
@@ -51,7 +51,7 @@ void
 Note_spacing_engraver::derived_mark () const
 {
   for (Last_spacing_map::const_iterator i = last_spacings_.begin ();
-       i != last_spacings_.end (); i++)
+       i != last_spacings_.end (); ++i)
     scm_gc_mark (i->first->self_scm ());
 }
 
diff --git a/lily/skyline.cc b/lily/skyline.cc
index 0250fc0..2a3a369 100644
--- a/lily/skyline.cc
+++ b/lily/skyline.cc
@@ -62,7 +62,7 @@
 static void
 print_buildings (list<Building> const &b)
 {
-  for (list<Building>::const_iterator i = b.begin (); i != b.end (); i++)
+  for (list<Building>::const_iterator i = b.begin (); i != b.end (); ++i)
     i->print ();
 }
 
@@ -375,7 +375,7 @@ Skyline::Skyline (Skyline const &src)
 
   /* doesn't a list's copy constructor do this? -- jneem */
   for (list<Building>::const_iterator i = src.buildings_.begin ();
-       i != src.buildings_.end (); i++)
+       i != src.buildings_.end (); ++i)
     {
       buildings_.push_back (Building ((*i)));
     }
@@ -492,7 +492,7 @@ void
 Skyline::raise (Real r)
 {
   list<Building>::iterator end = buildings_.end ();
-  for (list<Building>::iterator i = buildings_.begin (); i != end; i++)
+  for (list<Building>::iterator i = buildings_.begin (); i != end; ++i)
     i->y_intercept_ += sky_ * r;
 }
 
@@ -500,7 +500,7 @@ void
 Skyline::shift (Real s)
 {
   list<Building>::iterator end = buildings_.end ();
-  for (list<Building>::iterator i = buildings_.begin (); i != end; i++)
+  for (list<Building>::iterator i = buildings_.begin (); i != end; ++i)
     {
       i->end_ += s;
       i->y_intercept_ -= s * i->slope_;
@@ -563,9 +563,9 @@ Skyline::internal_distance (Skyline const &other, Real horizon_padding, Real *to
         touch = start;
 
       if (i->end_ <= j->end_)
-        i++;
+        ++i;
       else
-        j++;
+        ++j;
       start = end;
     }
 
@@ -585,7 +585,7 @@ Skyline::height (Real airplane) const
   assert (!isinf (airplane));
 
   list<Building>::const_iterator i;
-  for (i = buildings_.begin (); i != buildings_.end (); i++)
+  for (i = buildings_.begin (); i != buildings_.end (); ++i)
     {
       if (i->end_ >= airplane)
         return sky_ * i->height (airplane);
diff --git a/lily/tie-engraver.cc b/lily/tie-engraver.cc
index 40da0d3..fe948ec 100644
--- a/lily/tie-engraver.cc
+++ b/lily/tie-engraver.cc
@@ -237,7 +237,7 @@ Tie_engraver::stop_translation_timestep ()
       if (!wait)
         {
           vector<Head_event_tuple>::iterator it = heads_to_tie_.begin ();
-          for (; it < heads_to_tie_.end (); it++)
+          for (; it != heads_to_tie_.end (); ++it)
             report_unterminated_tie (*it);
           heads_to_tie_.clear ();
         }
@@ -322,7 +322,7 @@ Tie_engraver::stop_translation_timestep ()
   if (!wait && new_heads_to_tie.size ())
     {
       vector<Head_event_tuple>::iterator it = heads_to_tie_.begin ();
-      for (; it < heads_to_tie_.end (); it++)
+      for (; it != heads_to_tie_.end (); ++it)
         report_unterminated_tie (*it);
       heads_to_tie_.clear ();
     }
diff --git a/lily/tie-formatting-problem.cc b/lily/tie-formatting-problem.cc
index e2c3736..54af9ad 100644
--- a/lily/tie-formatting-problem.cc
+++ b/lily/tie-formatting-problem.cc
@@ -80,7 +80,7 @@ Tie_formatting_problem::Tie_formatting_problem ()
 Tie_formatting_problem::~Tie_formatting_problem ()
 {
   for (Tie_configuration_map::const_iterator i (possibilities_.begin ());
-       i != possibilities_.end (); i++)
+       i != possibilities_.end (); ++i)
     delete (*i).second;
 }
 
diff --git a/lily/tie-performer.cc b/lily/tie-performer.cc
index 9ef199d..061c51b 100644
--- a/lily/tie-performer.cc
+++ b/lily/tie-performer.cc
@@ -96,7 +96,7 @@ Tie_performer::acknowledge_audio_element (Audio_element_info inf)
       Stream_event *right_mus = inf.event_;
       for (it = heads_to_tie_.begin ();
            !found && (it != heads_to_tie_.end ());
-           it++)
+           ++it)
         {
           Audio_element_info et = (*it).head_;
           Audio_note *th = dynamic_cast<Audio_note *> (et.elem_);
-- 
1.7.10

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to