]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/staff-spacing.cc
Issue 4550 (2/2) Avoid "using namespace std;" in included files
[lilypond.git] / lily / staff-spacing.cc
index d693feaee1056fd5d293f27eff0e7d873765e66f..52dedd5d77605a4c07929e92971e10fe7c69a3e1 100644 (file)
@@ -20,7 +20,6 @@
 #include "staff-spacing.hh"
 
 #include <cstdio>
-using namespace std;
 
 #include "international.hh"
 #include "paper-column.hh"
@@ -62,7 +61,7 @@ Staff_spacing::optical_correction (Grob *me, Grob *g, Interval bar_height)
 
           stem_posns.intersect (bar_height);
 
-          ret = min (abs (stem_posns.length () / 7.0), 1.0);
+          ret = std::min (abs (stem_posns.length () / 7.0), 1.0);
           ret *= robust_scm2double (me->get_property ("stem-spacing-correction"), 1);
         }
     }
@@ -106,7 +105,7 @@ Staff_spacing::next_notes_correction (Grob *me,
   Real max_optical = 0.0;
 
   for (vsize i = 0; i < note_columns.size (); i++)
-    max_optical = max (max_optical, optical_correction (me, note_columns[i], bar_size));
+    max_optical = std::max (max_optical, optical_correction (me, note_columns[i], bar_size));
 
   return max_optical;
 }
@@ -181,10 +180,10 @@ Staff_spacing::get_spacing (Grob *me, Grob *right_col, Real situational_space)
       ideal = fixed + distance / 2;
     }
   else if (scm_is_eq (type, ly_symbol2scm ("minimum-space")))
-    ideal = last_ext[LEFT] + max (last_ext.length (), distance);
+    ideal = last_ext[LEFT] + std::max (last_ext.length (), distance);
   else if (scm_is_eq (type, ly_symbol2scm ("minimum-fixed-space")))
     {
-      fixed = last_ext[LEFT] + max (last_ext.length (), distance);
+      fixed = last_ext[LEFT] + std::max (last_ext.length (), distance);
       ideal = fixed;
     }
 
@@ -201,13 +200,13 @@ Staff_spacing::get_spacing (Grob *me, Grob *right_col, Real situational_space)
   Real min_dist = Paper_column::minimum_distance (left_col, right_col);
 
   /* ensure that the "fixed" distance will leave a gap of at least 0.3 ss. */
-  Real min_dist_correction = max (0.0, 0.3 + min_dist - fixed);
+  Real min_dist_correction = std::max (0.0, 0.3 + min_dist - fixed);
   fixed += min_dist_correction;
-  ideal = max (ideal, fixed);
+  ideal = std::max (ideal, fixed);
 
   Spring ret (ideal, min_dist);
-  ret.set_inverse_stretch_strength (max (0.0, stretchability));
-  ret.set_inverse_compress_strength (max (0.0, ideal - fixed));
+  ret.set_inverse_stretch_strength (std::max (0.0, stretchability));
+  ret.set_inverse_compress_strength (std::max (0.0, ideal - fixed));
   return ret;
 }