]> git.donarmstrong.com Git - lilypond.git/commitdiff
* flower/*.cc: remove <? and >?
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 30 Apr 2005 23:43:03 +0000 (23:43 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 30 Apr 2005 23:43:03 +0000 (23:43 +0000)
* lily/*.cc: remove <? and >?

41 files changed:
ChangeLog
flower/getopt-long.cc
flower/include/compare.hh
flower/include/interval.hh
flower/include/interval.tcc
flower/include/real.hh
flower/include/string-data.icc
flower/string-convert.cc
flower/string.cc
lily/afm.cc
lily/align-interface.cc
lily/auto-beam-engraver.cc
lily/beam-concave.cc
lily/beam-engraver.cc
lily/beam-quanting.cc
lily/beam.cc
lily/beaming-info.cc
lily/binary-source-file.cc
lily/break-algorithm.cc
lily/break-align-interface.cc
lily/chord-tremolo-engraver.cc
lily/cluster-engraver.cc
lily/completion-note-heads-engraver.cc
lily/gourlay-breaking.cc
lily/grid-point-engraver.cc
lily/include/break-algorithm.hh
lily/ledger-line-spanner.cc
lily/line-interface.cc
lily/lookup.cc
lily/lyric-extender.cc
lily/lyric-hyphen.cc
lily/multi-measure-rest.cc
lily/music-sequence.cc
lily/note-head.cc
lily/note-spacing.cc
lily/ottava-bracket.cc
lily/part-combine-iterator.cc
lily/quote-iterator.cc
lily/simultaneous-music-iterator.cc
lily/spacing-engraver.cc
lily/spacing-spanner.cc

index d302f7d9f46c51187f72ad88e25893f758bde8ad..00ad577359ed0c46e0b9f042074455b65258db6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2005-05-01  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * flower/*.cc: remove <? and >?
+       
+       * lily/*.cc: remove <? and >?
+
        * lily/tweak-registration.cc (insert_tweak_from_file): dubious
        bugfix. Make sure that 0x0 isn't passed into scm_cons(). Fixes
        crash with tweak editor.
index d8d750bf0e8bd83f865fc70de72a1f40f86e842c..85b5f0ba9bb07149217b59799e1d19a4052748e6 100644 (file)
@@ -312,7 +312,7 @@ Long_option_init::table_string (Long_option_init *l)
   int wid = 0;
   for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++)
     {
-      wid = wid >? l[i].str_for_help ().length ();
+      wid = max (wid, l[i].str_for_help ().length ());
     }
 
   for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++)
index 37e01f46eea3078ac6af4d99328e6beffa35bdc8..a0d7ed98fa97cd122214f02b05d1b0bd2072a0b2 100644 (file)
     return function (t1, t2) op 0;             \
   }
 
-#define GPP_MINMAX_OPERATOR(type, op, opp)     \
-  inline type                                  \
-  operator op (type t1, type t2)               \
-  {                                            \
-    return (t1 opp t2) ? t1 : t2;              \
-  }
-
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-#define GPP_MINMAX(type, prefix)               \
-  prefix GPP_MINMAX_OPERATOR (type, <?, <)     \
-    prefix GPP_MINMAX_OPERATOR (type, >?, >)
-#else
-#define GPP_MINMAX (type, prefix)
-#endif
-
 /**  handy notations for a signed comparison.
      make the operators{<,<=,==,>=,>} and the MAX and MIN of two.
      Please fill a & in the type argument if necessary.
@@ -39,7 +24,6 @@
     prefix ONE_OPERATOR (type, function, !=)                           \
     prefix ONE_OPERATOR (type, function, <)                            \
     prefix ONE_OPERATOR (type, function, <=)                           \
-    GPP_MINMAX (type, prefix)                                          \
     prefix inline type max (type t1, type t2) { return (t1 > t2) ? t1 : t2; } \
   prefix inline type min (type t1, type t2) { return (t1 < t2) ? t1 : t2; } \
                                                                        \
index fcaf39cdcec36939df1101f50550d27f3518314c..41f9c7887f543a6bf85f6632c41840976ed30a08 100644 (file)
@@ -50,8 +50,8 @@ struct Interval_t : public Drul_array<T>
   void intersect (Interval_t<T> h);
   void add_point (T p)
   {
-    elem_ref (LEFT) = elem (LEFT) <? p;
-    elem_ref (RIGHT) = elem (RIGHT) >? p;
+    elem_ref (LEFT) = min (elem (LEFT), p);
+    elem_ref (RIGHT) = max (elem (RIGHT), p);
   }
   T length () const;
   T delta () const;
index 4c2bedc808e53d121b5dfe4f4b486054f2421ef3..9aa70e4f190fc42e31899f48e711111ff9e0cd2a 100644 (file)
@@ -89,32 +89,19 @@ template<class T>
 void
 Interval_t<T>::unite (Interval_t<T> h)
 {
-  elem_ref (LEFT) = h.elem (LEFT) <? elem (LEFT);
-  elem_ref (RIGHT) = h.elem (RIGHT) >? elem (RIGHT);
+  elem_ref (LEFT) = min (h.elem (LEFT), elem (LEFT));
+  elem_ref (RIGHT) = max (h.elem (RIGHT), elem (RIGHT));
 }
 
 template<class T>
 void
 Interval_t<T>::intersect (Interval_t<T> h)
 {
-#if defined (__GNUG__) && !defined (__STRICT_ANSI__)
-  elem_ref (LEFT) = h.elem (LEFT) >? elem (LEFT);
-  elem_ref (RIGHT) = h.elem (RIGHT) <? elem (RIGHT);
-#else
   elem_ref (LEFT) = max (h.elem (LEFT), elem (LEFT));
   elem_ref (RIGHT) = min (h.elem (RIGHT), elem (RIGHT));
-#endif
 }
 
-#if 0 //this is called intersection
-template<class T>
-Interval_t<T>
-intersect (Interval_t<T> x, Interval_t<T> const &y)
-{
-  x.intersect (y);
-  return x;
-}
-#endif
+
 
 template<class T>
 String
index c75b14a0ce7cc648e3ee347daeef5fea1f88b14d..d8daa644335e92c27696bbf2c916fa49f6d41bdd 100644 (file)
@@ -13,6 +13,7 @@
 
 typedef double Real;
 extern const Real infinity_f;
+using namespace std;
 
 template<class T> inline T abs (T x)
 {
@@ -26,20 +27,12 @@ template<class T> inline int sign (T x)
   return 0;
 }
 
-template<class T> inline T max (T x, T y)
-{
-  return x >? y;
-}
 
 template<class T> inline T sqr (T x)
 {
   return x * x;
 }
 
-template<class T> inline T min (T x, T y)
-{
-  return x <? y;
-}
 
 inline Real
 distance (Real x, Real y)
index 2f759ff8a1a2d838474df91edf34b9618e695852..a87354cac539cc56a79a5c5a0a7a59325fb57d65 100644 (file)
@@ -9,12 +9,15 @@
 #ifndef STRINGDATA_INL
 #define STRINGDATA_INL
 
+#include "string-data.hh"
+
+#include <algorithm>
 #include <cassert>
 #include <cstring>
-
 #include <memory.h>
 
-#include "string-data.hh"
+using namespace std;
+
 const int INITIALMAX = 8;
 
 #include <sys/types.h>
@@ -90,7 +93,7 @@ String_data::remax (int j)
   if (j > maxlen)
     {
       Byte *p = new Byte[j + 1];
-      memcpy (p, data_byte_, (maxlen <? length_) + 1);
+      memcpy (p, data_byte_, min (maxlen, length_) + 1);
       maxlen = j;
       delete[] data_byte_;
       data_byte_ = p;
index e6aacb7a45e12204db9771f9f15417d34a4aa6e1..53a255db5bd3fb4b634bdbead210852e263186ac 100644 (file)
@@ -343,5 +343,5 @@ String_convert::long_string (long l)
 String
 String_convert::pad_to (String s, int n)
 {
-  return s + to_string (' ' , (n - s.length ()) >? 0);
+  return s + to_string (' ' , max (n - s.length (), 0));
 }
index 5279b6a2d5e7ff6f9f83390aee7b463e926cd33a..b19180401384fc433d78af1c4d101c0a31eafe07 100644 (file)
@@ -168,7 +168,7 @@ String::compare (String const &s1, String const &s2)
   /*
     don't forget the terminating '\0'
   */
-  int f = (s1.length () <? s2.length ());
+  int f = min (s1.length (), s2.length ());
   int cmp_length = 1+ f;
   int i = memcmp (p1, p2, cmp_length);
   return i;
index 348cfbeadd9a9d362852754c58c7e4b4f58fe385..e5b463ce5a5313d1ab68eda63921e99997d756ac 100644 (file)
@@ -20,7 +20,7 @@ Adobe_font_metric::Adobe_font_metric (AFM_Font_info *fi)
   font_info_ = fi;
   design_size_ = 1.0;
 
-  for (int i = 256 >? fi->numOfChars; i--;)
+  for (int i = max (256, fi->numOfChars); i--;)
     ascii_to_metric_idx_.push (-1);
 
   for (int i = 0; i < fi->numOfChars; i++)
index 7489f6692c7107cbdb07c24d4a656be062f4ff51..3e4b9c5ca85de378a70e65096ef7c9358c12d2d9 100644 (file)
@@ -178,8 +178,8 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a)
       dy *= stacking_dir;
       if (j)
        {
-         dy = (dy >? threshold[SMALLER])
-           <? threshold[BIGGER];
+         dy = min (max (dy, threshold[SMALLER]),
+                   threshold[BIGGER]);
        }
 
       where_f += stacking_dir * dy;
index 38585b06d5960f73d321f40f183e94e1e0a17dc9..e4d71d0754e4ba6814f3b003078e19d67ebb7a3b 100644 (file)
@@ -379,7 +379,7 @@ Auto_beam_engraver::acknowledge_grob (Grob_info info)
                           durlog - 2);
       stems_->push (stem);
       last_add_mom_ = now;
-      extend_mom_ = (extend_mom_ >? now) + m->get_length ();
+      extend_mom_ = max (extend_mom_, now) + m->get_length ();
     }
 }
 
index 91c772a06b12fca6a5c6dcc0b0ac0aa2f338c884..cf0653b09d0a7d281bb62c95dd9b9043ab8931c7 100644 (file)
@@ -36,7 +36,7 @@ is_concave_single_notes (Array<int> const &positions, Direction beam_dir)
     note is reached in the opposite direction as the last-first dy
   */
   int dy = positions.top () - positions[0];
-  int closest = (beam_dir * positions.top ()) >? (beam_dir * positions[0]);
+  int closest = max (beam_dir * positions.top (), beam_dir * positions[0]);
   for (int i = 2; !concave && i < positions.size () - 1; i++)
     {
       int inner_dy = positions[i] - positions[i - 1];
@@ -67,7 +67,7 @@ calc_concaveness (Array<int> const &positions, Direction beam_dir)
     {
       Real line_y = slope * i + positions[0];
 
-      concaveness += (beam_dir * (positions[i] - line_y)) >? 0.0;
+      concaveness += max (beam_dir * (positions[i] - line_y), 0.0);
     }
 
   concaveness /= positions.size ();
index f5ea6a3ca9567549740be2e9a6bd6d5586fc65af..7e3a898dd34f89ccbcaef675a50d7dbd67f7ce6d 100644 (file)
@@ -261,7 +261,7 @@ Beam_engraver::acknowledge_grob (Grob_info info)
                              scm_int2num (durlog));
          Moment stem_location = now - beam_start_mom_ + beam_start_location_;
          beam_info_->add_stem (stem_location,
-                               (durlog- 2) >? 0);
+                               max (durlog- 2, 0));
          Beam::add_stem (beam_, stem);
        }
     }
index dfc7fa6d92030ad58bb80c7be835904fde1e7985..c950349fc18fd5082bd1e7f3d5803b1c5ac2402d 100644 (file)
@@ -7,11 +7,13 @@
   Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
+#include "beam.hh"
+
+#include <algorithm>
 #include <math.h>
 
 #include "warn.hh"
 #include "staff-symbol-referencer.hh"
-#include "beam.hh"
 #include "stem.hh"
 #include "output-def.hh"
 #include "group-interface.hh"
@@ -333,7 +335,7 @@ Beam::score_stem_lengths (Link_array<Grob> const &stems,
       Stem_info info = stem_infos[i];
       Direction d = info.dir_;
 
-      score[d] += limit_penalty * (0 >? (d * (info.shortest_y_ - current_y)));
+      score[d] += limit_penalty * max (0.0,  (d * (info.shortest_y_ - current_y)));
 
       Real ideal_diff = d * (current_y - info.ideal_y_);
       Real ideal_score = shrink_extra_weight (ideal_diff, 1.5);
@@ -352,7 +354,7 @@ Beam::score_stem_lengths (Link_array<Grob> const &stems,
   Direction d = DOWN;
   do
     {
-      score[d] /= (count[d] >? 1);
+      score[d] /= max (count[d], 1);
     }
   while (flip (&d) != DOWN);
 
@@ -381,7 +383,7 @@ Beam::score_slopes_dy (Real yl, Real yr,
       dem += DAMPING_DIRECTION_PENALTY;
     }
 
-  dem += MUSICAL_DIRECTION_FACTOR *(0 >? (fabs (dy) - fabs (dy_mus)));
+  dem += MUSICAL_DIRECTION_FACTOR * max (0.0, (fabs (dy) - fabs (dy_mus)));
 
   Real slope_penalty = IDEAL_SLOPE_FACTOR;
 
@@ -420,7 +422,7 @@ Beam::score_forbidden_quants (Real yl, Real yr,
   Drul_array<Real> y (yl, yr);
   Drul_array<Direction> dirs (ldir, rdir);
 
-  Real extra_demerit = SECONDARY_BEAM_DEMERIT / (beam_counts[LEFT] >? beam_counts[RIGHT]);
+  Real extra_demerit = SECONDARY_BEAM_DEMERIT / (max (beam_counts[LEFT], beam_counts[RIGHT]));
 
   Direction d = LEFT;
   Real dem = 0.0;
@@ -448,7 +450,7 @@ Beam::score_forbidden_quants (Real yl, Real yr,
               k <= radius + BEAM_EPS; k += 1.0)
            if (gap.contains (k))
              {
-               Real dist = fabs (gap[UP] - k) <? fabs (gap[DOWN] - k);
+               Real dist = min (fabs (gap[UP] - k), fabs (gap[DOWN] - k));
 
                /*
                  this parameter is tuned to grace-stem-length.ly
@@ -463,7 +465,7 @@ Beam::score_forbidden_quants (Real yl, Real yr,
     }
   while ((flip (&d)) != LEFT);
 
-  if ((beam_counts[LEFT] >? beam_counts[RIGHT]) >= 2)
+  if (max (beam_counts[LEFT], beam_counts[RIGHT]) >= 2)
     {
       Real straddle = 0.0;
       Real sit = (thickness - slt) / 2;
index 7d277dac508f45f4190bd17944bc0a25860611db..15be9c876e81573753e1b63db1259faa7abb2b64 100644 (file)
@@ -91,7 +91,7 @@ Beam::get_beam_count (Grob *me)
   for (SCM s = me->get_property ("stems"); scm_is_pair (s); s = scm_cdr (s))
     {
       Grob *stem = unsmob_grob (scm_car (s));
-      m = m >? (Stem::beam_multiplicity (stem).length () + 1);
+      m = max (m, (Stem::beam_multiplicity (stem).length () + 1));
     }
   return m;
 }
@@ -451,7 +451,7 @@ Beam::print (SCM grob)
          Real lw = nw_f;
          Real rw = nw_f;
          if (i > 0)
-           rw = nw_f <? ((xposn - last_xposn) / 2);
+           rw = min (nw_f, ((xposn - last_xposn) / 2));
          else
            /*
              TODO: 0.5 is a guess.
@@ -460,7 +460,7 @@ Beam::print (SCM grob)
              - 0.5;
 
          if (st)
-           lw = nw_f <? ((xposn - last_xposn) / 2);
+           lw = min (nw_f, ((xposn - last_xposn) / 2));
          else
            lw = me->get_bound (RIGHT)->relative_coordinate (xcommon, X_AXIS)
              - last_xposn;
@@ -534,7 +534,7 @@ Beam::get_default_dir (Grob *me)
        Grob *s = stems[i];
        Direction sd = get_grob_direction (s);
 
-       int center_distance = int (- d * Stem::head_positions (s) [-d]) >? 0;
+       int center_distance = max (int (- d * Stem::head_positions (s) [-d]), 0);
        int current = sd ? (1 + d * sd) / 2 : center_distance;
 
        if (current)
@@ -783,9 +783,8 @@ set_minimum_dy (Grob *me, Real *dy)
       Real inter = 0.5;
       Real hang = 1.0 - (thickness - slt) / 2;
 
-      *dy = sign (*dy) * (fabs (*dy)
-                         >?
-                         (sit <? inter <? hang));
+      *dy = sign (*dy) * max (fabs (*dy),
+                             min (min (sit, inter), hang));
     }
 }
 
@@ -1200,7 +1199,7 @@ Beam::set_beaming (Grob *me, Beaming_info_list *beaming)
              if (i > 0
                  && i < stems.size () -1
                  && Stem::is_invisible (st))
-               b = b <? beaming->infos_.elem (i).beams_i_drul_[-d];
+               b = min (b, beaming->infos_.elem (i).beams_i_drul_[-d]);
 
              Stem::set_beaming (st, b, d);
            }
@@ -1342,7 +1341,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
     = + staff_space * (robust_scm2double (stem->get_property ("stemlet-length"), 0.0)
                       + robust_scm2double (rest->get_property ("minimum-distance"), 0.0));
 
-  Real shift = d * (((beam_y - d * minimum_distance) - rest_dim) * d <? 0.0);
+  Real shift = d * min (((beam_y - d * minimum_distance) - rest_dim) * d, 0.0);
 
   shift /= staff_space;
   Real rad = Staff_symbol_referencer::line_count (rest) * staff_space / 2;
@@ -1398,7 +1397,7 @@ Beam::get_direction_beam_count (Grob *me, Direction d)
        Should we take invisible stems into account?
       */
       if (Stem::get_direction (stems[i]) == d)
-       bc = bc >? (Stem::beam_multiplicity (stems[i]).length () + 1);
+       bc = max (bc, (Stem::beam_multiplicity (stems[i]).length () + 1));
     }
 
   return bc;
index 50b94a6fb9d24b3e3aa7f56e6f43767a03cccc35..1165148b9415e729fc9ca56709c8a9d6d9d9d948 100644 (file)
@@ -56,7 +56,7 @@ Beaming_info_list::beam_extend_count (Direction d) const
   Beaming_info thisbeam = infos_.boundary (d, 0);
   Beaming_info next = infos_.boundary (d, 1);
 
-  return thisbeam.beams_i_drul_[-d] <? next.beams_i_drul_[d];
+  return min (thisbeam.beams_i_drul_[-d], next.beams_i_drul_[d]);
 }
 
 void
@@ -80,8 +80,8 @@ Beaming_info_list::beamify (Moment &beat_length, bool subdivide)
   while (flip (&d) != LEFT);
 
   int middle_beams = (split ? 1
-                     : splits[RIGHT].beam_extend_count (LEFT) <?
-                     splits[LEFT].beam_extend_count (RIGHT));
+                     : min (splits[RIGHT].beam_extend_count (LEFT),
+                            splits[LEFT].beam_extend_count (RIGHT)));
 
   do
     {
index 5f00138cf166fa88d6851a526c4974f34c36a038..b1a78b16dc47ae48b18dc20ea352503eeb9ecdc0 100644 (file)
@@ -27,8 +27,8 @@ Binary_source_file::error_string (char const *pos_str0) const
   if (!contains (pos_str0))
     return "";
 
-  char const *begin_str0 = pos_str0 - 8 >? to_str0 ();
-  char const *end_str0 = pos_str0 + 7 <? to_str0 () + length ();
+  char const *begin_str0 = max (pos_str0 - 8, to_str0 ());
+  char const *end_str0 = min (pos_str0 + 7, to_str0 () + length ());
 
   String pre_string ((Byte const *)begin_str0, pos_str0 - begin_str0);
   pre_string = String_convert::bin2hex (pre_string);
index 96f4031a08957e5c7e610c7c5c11fc85775da699..3a18f16766c21aa30b31b53302ddce48909d8a3c 100644 (file)
@@ -99,3 +99,7 @@ Break_algorithm::solve () const
   return h;
 }
 
+
+Break_algorithm::~Break_algorithm ()
+{
+}
index 7c1d1ff2199b0b3ad2469830ae35f7b265d76a8b..f1469a03f6de56ee454856e1daa8a36d2caf07d0 100644 (file)
@@ -225,7 +225,7 @@ Break_align_interface::do_alignment (Grob *grob)
              - extents[next_idx][LEFT];
          /* should probably junk minimum-space */
          else if (type == ly_symbol2scm ("minimum-space"))
-           offsets[next_idx] = extents[idx][RIGHT] >? distance;
+           offsets[next_idx] = max (extents[idx][RIGHT], distance);
        }
       else
        {
index 5e983fdc9413cb97f562a47933044622afc329b5..50d4e382cd6f0ab3b4be1cd451847bf57e4b66aa 100644 (file)
@@ -100,7 +100,7 @@ Chord_tremolo_engraver::try_music (Music *m)
       Rational total_dur = l.main_part_;
       Rational note_dur = total_dur / Rational (elt_count * Repeated_music::repeat_count (repeat_));
 
-      total_duration_flags_ = 0 >? (intlog2 (total_dur.den ()) - 2);
+      total_duration_flags_ = max (0, (intlog2 (total_dur.den ()) - 2));
 
       flags_ = intlog2 (note_dur.den ()) -2;
 
index cdbfcd9b5dd72328c7bd49afb54b49d65ad85e2a..c6ea93dc8694370fb44001d4f3fa4cb9de0057bd 100644 (file)
@@ -85,8 +85,8 @@ Cluster_spanner_engraver::process_music ()
 
          int p = (pit ? pit->steps () : 0) + c0;
 
-         pmax = pmax >? p;
-         pmin = pmin <? p;
+         pmax = max (pmax, p);
+         pmin = min (pmin, p);
        }
 
       beacon_ = make_item ("ClusterSpannerBeacon", cluster_notes_[0]->self_scm ());
index 955b4bf4e2522dcff93c24281f5d54a604651b79..8a9ac0fbef04082cbdc63de762f0ef902e391fb4 100644 (file)
@@ -89,7 +89,7 @@ Completion_heads_engraver::try_music (Music *m)
          musiclen.grace_part_ = musiclen.main_part_;
          musiclen.main_part_ = Rational (0, 1);
        }
-      note_end_mom_ = note_end_mom_ >? (now + musiclen);
+      note_end_mom_ = max (note_end_mom_, (now + musiclen));
       do_nothing_until_ = Rational (0, 0);
 
       return true;
index 3c7ed01a9727bcdc99a634dd26f979ff7e2ec34b..24eeb934a8a5c12a6f93d7f64789a27da38dee99 100644 (file)
@@ -263,7 +263,7 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev,
 
        add 20000 to the demerits, so that a break penalty
        of -10000 won't change the result */
-      demerit = (demerit + 20000) >? 2000;
+      demerit = max ((demerit + 20000), 2000.0);
 
       demerit *= 10;
     }
index 7da25e279167d0b3339457ba1166f4995b37636b..f2125a36cdf61c3b1736731ec59b8eb28242630b 100644 (file)
@@ -28,7 +28,7 @@ Grid_point_engraver::process_music ()
 
       if (!now.main_part_.mod_rat (mom->main_part_))
        {
-         Item * it = make_item ("GridPoint", SCM_EOL);
+         make_item ("GridPoint", SCM_EOL);
        }
     }
 }
index a891c7c140fa87e9f0dab79bde512e0c40d87cf0..025c56406e09da577d00c211654b863d23d525bf 100644 (file)
@@ -31,8 +31,8 @@ protected:
   Simple_spacer_wrapper *generate_spacing_problem (Link_array<Grob> const &, Interval) const;
 
   virtual Array<Column_x_positions> do_solve () const = 0;
-
 public:
+  virtual ~Break_algorithm ();
   Simple_spacer *(*get_line_spacer) ();
   Break_algorithm ();
   void set_pscore (Paper_score *);
index 02e4660e5a4bd7fa3734bde7e1a03917c5dd99dd..e56851fbe0601b9fadeb321cd69d00b77f873e85 100644 (file)
@@ -246,7 +246,7 @@ Ledger_line_spanner::print (SCM smob)
          reqs[rank][vdir].ledger_extent_.unite (ledger_extent);
          reqs[rank][vdir].head_extent_.unite (head_extent);
          reqs[rank][vdir].position_
-           = vdir * ((vdir * reqs[rank][vdir].position_) >? (vdir * pos));
+           = vdir * max (vdir * reqs[rank][vdir].position_, vdir * pos);
        }
     }
 
@@ -283,7 +283,7 @@ Ledger_line_spanner::print (SCM smob)
 
                  Real limit = (center + (both ? which * gap / 2 : 0));
                  lr.ledger_extent_.elem_ref (-which)
-                   = which * (which * lr.ledger_extent_[-which] >? which * limit);
+                   = which * max (which * lr.ledger_extent_[-which], which * limit);
                }
              while (flip (&which) != LEFT);
            }
@@ -318,7 +318,7 @@ Ledger_line_spanner::print (SCM smob)
                                                        head_size[LEFT]),
                                      0.0);
 
-             left_shorten = (-ledger_size[LEFT] + d) >? 0;
+             left_shorten = max (-ledger_size[LEFT] + d, 0.0);
 
              /*
                TODO: shorten 2 ledger lines for the case natural +
index 163f685190f516e6514509612b6478f7dd4c2164..c759004e3c9e63a90cc152bbfc6d4da62d80aca9 100644 (file)
@@ -34,7 +34,7 @@ Stencil
 Line_interface::make_dashed_line (Real thick, Offset from, Offset to,
                                  Real dash_period, Real dash_fraction)
 {
-  dash_fraction = (dash_fraction >? 0) <? 1.0;
+  dash_fraction = min (max (dash_fraction, 0.0), 1.0);
   Real on = dash_fraction * dash_period + thick;
   Real off = dash_period - on;
 
@@ -124,7 +124,7 @@ Line_interface::line (Grob *me, Offset from, Offset to)
        ? 0.0
        : robust_scm2double (dash_fraction, 0.4);
 
-      fraction = (fraction >? 0) <? 1.0;
+      fraction = min (max (fraction, 0.0), 1.0);
       Real period = Staff_symbol_referencer::staff_space (me)
        * robust_scm2double (me->get_property ("dash-period"), 1.0);
 
index 56b0985421ee260925bb55eabad5da4097e0d388..57d668fe7313d3eb975fad01d5222a824b1f46de 100644 (file)
@@ -58,8 +58,8 @@ Stencil
 Lookup::beam (Real slope, Real width, Real thick, Real blot)
 {
   Real height = slope * width;
-  Real min_y = (0 <? height) - thick / 2;
-  Real max_y = (0 >? height) + thick / 2;
+  Real min_y = min (0., height) - thick / 2;
+  Real max_y = max (0., height) + thick / 2;
 
   Box b (Interval (0, width),
         Interval (min_y, max_y));
@@ -681,7 +681,7 @@ Lookup::triangle (Interval iv, Real thick, Real protude)
 {
   Box b;
   b[X_AXIS] = Interval (0, iv.length ());
-  b[Y_AXIS] = Interval (0 <? protude, 0 >? protude);
+  b[Y_AXIS] = Interval (min (0., protude), max (0.0, protude));
 
   Offset z1 (iv[LEFT], 0);
   Offset z2 (iv[RIGHT], 0);
index 53090bcafb53d0554d5a078afef83bcc176570a9..cbe036218512c2b6eab77b659954ea86c3d7834d 100644 (file)
@@ -57,17 +57,17 @@ Lyric_extender::print (SCM smob)
     = left_point + (robust_scm2double (minlen, 0));
 
   if (heads.size ())
-    right_point = right_point >? heads.top ()->extent (common, X_AXIS)[RIGHT];
+    right_point = max (right_point, heads.top ()->extent (common, X_AXIS)[RIGHT]);
 
   Real h = sl * robust_scm2double (me->get_property ("thickness"), 0);
   Real pad = 2* h;
 
   if (right_text)
-    right_point = right_point <? (robust_relative_extent (right_text, common, X_AXIS)[LEFT] - pad);
+    right_point = min (right_point, (robust_relative_extent (right_text, common, X_AXIS)[LEFT] - pad));
 
   /* run to end of line. */
   if (me->get_bound (RIGHT)->break_status_dir ())
-    right_point = right_point >? (robust_relative_extent (me->get_bound (RIGHT), common, X_AXIS)[LEFT] - pad);
+    right_point = max (right_point, (robust_relative_extent (me->get_bound (RIGHT), common, X_AXIS)[LEFT] - pad));
 
   left_point += pad;
   Real w = right_point - left_point;
index 95e8fd881f3c45663031fa66d40010ca822a46f4..f02721122679d298fcba82270776cd351399dba0 100644 (file)
@@ -65,7 +65,7 @@ Hyphen_spanner::print (SCM smob)
       && !bounds[RIGHT]->break_status_dir ())
     {
       Real minimum_length = robust_scm2double (me->get_property ("minimum-length"), .3);
-      dash_length = (l - 2 * padding) >? minimum_length;
+      dash_length = max ((l - 2 * padding), minimum_length);
     }
 
   Real space_left = l - dash_length - (n - 1) * dash_period;
@@ -78,7 +78,7 @@ Hyphen_spanner::print (SCM smob)
       && !bounds[RIGHT]->break_status_dir ())
     return SCM_EOL;
 
-  space_left = space_left >? 0.0;
+  space_left = max (space_left, 0.0);
 
   Box b (Interval (0, dash_length), Interval (h, h + th));
   Stencil dash_mol (Lookup::round_filled_box (b, 0.8 * lt));
index a1eb2dbfbfbe97fb72164ef05e3e7898c66f98b9..f3430479944c9571993a6c526304ce22d70a6ce9 100644 (file)
@@ -50,7 +50,7 @@ Multi_measure_rest::percent (SCM smob)
     we gotta stay clear of sp_iv, so move a bit to the right if
     needed.
   */
-  x_off += (sp_iv[LEFT] - rx) >? 0;
+  x_off += max (sp_iv[LEFT] - rx, 0.0);
 
   /*
     center between stuff.
@@ -92,7 +92,7 @@ Multi_measure_rest::print (SCM smob)
     we gotta stay clear of sp_iv, so move a bit to the right if
     needed.
   */
-  Real x_off = (sp_iv[LEFT] - rx) >? 0;
+  Real x_off = max (sp_iv[LEFT] - rx, 0.0);
 
   Stencil mol;
   mol.add_stencil (symbol_stencil (me, space));
@@ -180,9 +180,9 @@ Multi_measure_rest::big_rest (Grob *me, Real width)
   Real slt = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
   Real y = slt * thick_thick / 2 * ss;
   Real ythick = hair_thick * slt * ss;
-  Box b (Interval (0, 0 >? (width - 2 * ythick)), Interval (-y, y));
+  Box b (Interval (0.0, max (0.0, (width - 2 * ythick))), Interval (-y, y));
 
-  Real blot = width ? (.8 * (y <? ythick)) : 0.0;
+  Real blot = width ? (.8 * min (y, ythick)) : 0.0;
 
   Stencil m = Lookup::round_filled_box (b, blot);
   Stencil yb = Lookup::round_filled_box (Box (Interval (-0.5, 0.5) * ythick, Interval (-ss, ss)), blot);
index 555e2e3afb084df344f6e05e6d0985df6789b501..9879da98e0bd3f6a9b896ffc3fe98fd04d7845ef 100644 (file)
@@ -50,7 +50,7 @@ Music_sequence::maximum_length (SCM l)
     {
       Music *m = unsmob_music (scm_car (s));
       Moment l = m->get_length ();
-      dur = dur >? l;
+      dur = max (dur, l);
     }
 
   return dur;
@@ -122,7 +122,7 @@ Music_sequence::minimum_start (SCM l)
 
   for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
     {
-      m = m <? unsmob_music (scm_car (s))->start_mom ();
+      m = min (m, unsmob_music (scm_car (s))->start_mom ());
     }
   return m;
 }
index 63bc9c342c3ab530f91018025c31155418c395d1..6096c7cd00aabde6fc10f1ef2656d05a3bf9808e 100644 (file)
@@ -162,7 +162,7 @@ int
 Note_head::get_balltype (Grob *me)
 {
   SCM s = me->get_property ("duration-log");
-  return scm_is_number (s) ? scm_to_int (s) <? 2 : 0;
+  return scm_is_number (s) ? min (scm_to_int (s), 2) : 0;
 }
 
 ADD_INTERFACE (Note_head, "note-head-interface",
index 9e34006967f78a9429317ade4ebd8ada16f0803f..82640d4d626c9db8841537815756c68498fe9263 100644 (file)
@@ -317,7 +317,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn,
              Real chord_start = hp[sd];
              Real stem_end = Stem::stem_end_position (stem);
 
-             stem_posns[d] = Interval (chord_start <? stem_end, chord_start>? stem_end);
+             stem_posns[d] = Interval (min (chord_start, stem_end), max (chord_start,  stem_end));
              head_posns[d].unite (hp);
            }
        }
@@ -383,7 +383,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn,
              /*
                Ugh. 7 is hardcoded.
              */
-             correction = (correction / 7) <? 1.0;
+             correction = min (correction / 7, 1.0);
              correction *= stem_dirs[LEFT];
              correction
                *= robust_scm2double (me->get_property ("stem-spacing-correction"), 0);
index 9a02f4b63746ca1da674123015ac62647110aeea..e5d04bb1d111da141d0d636ede8714e3d3e58cda 100644 (file)
@@ -120,9 +120,10 @@ Ottava_bracket::print (SCM smob)
   Real text_size = text.extent (X_AXIS).is_empty ()
     ? 0.0 : text.extent (X_AXIS)[RIGHT] + 0.3;
 
-  span_points[LEFT] = span_points[LEFT]
-    <? (span_points[RIGHT] - text_size
-       - robust_scm2double (me->get_property ("minimum-length"), -1.0));
+  span_points[LEFT] =
+    min (span_points[LEFT],
+        (span_points[RIGHT] - text_size
+         - robust_scm2double (me->get_property ("minimum-length"), -1.0)));
 
   Interval bracket_span_points = span_points;
   bracket_span_points[LEFT] += text_size;
index e9a5a9c4fb9c59ed60106b8aa19f9f7d85b22970..006e0024d1b2100b545ebc9a33703e50bcb472a1 100644 (file)
@@ -132,10 +132,10 @@ Part_combine_iterator::pending_moment () const
   Moment p;
   p.set_infinite (1);
   if (first_iter_->ok ())
-    p = p <? first_iter_->pending_moment ();
+    p = min (p, first_iter_->pending_moment ());
 
   if (second_iter_->ok ())
-    p = p <? second_iter_->pending_moment ();
+    p = min (p, second_iter_->pending_moment ());
   return p;
 }
 
index 44266a6bc469b703f2b206fd13e4d00547e20030..61b2d025e9519d757a658cf59651836494c383b3 100644 (file)
@@ -159,14 +159,14 @@ Quote_iterator::pending_moment () const
   Moment m (infty);
 
   if (Music_wrapper_iterator::ok ())
-    m = m <? Music_wrapper_iterator::pending_moment ();
+    m = min (m, Music_wrapper_iterator::pending_moment ());
 
   /*
     In case event_idx_ < 0, we're not initted yet, and the wrapped
     music expression determines the starting moment.
   */
   if (quote_ok ())
-    m = m <? vector_moment (event_idx_) - start_moment_;
+    m = min (m, vector_moment (event_idx_) - start_moment_);
 
   return m;
 }
index 1c5a8002062652b2ca3b8424b807699a912eac22..550d1adeaf1e8ed8e2fd11e64e80d6cb9420cf2a 100644 (file)
@@ -104,7 +104,7 @@ Simultaneous_music_iterator::pending_moment () const
   for (SCM s = children_list_; scm_is_pair (s); s = scm_cdr (s))
     {
       Music_iterator *it = unsmob_iterator (scm_car (s));
-      next = next <? it->pending_moment ();
+      next = min (next, it->pending_moment ());
     }
 
   return next;
index 22931c8ecf4d40fd31b487cd858afc1ed297b145..2c7f59360ee61da4ec5afe6cfc3b5d99d944a315 100644 (file)
@@ -131,7 +131,7 @@ Spacing_engraver::stop_translation_timestep ()
       if (mus)
        {
          Moment m = mus->get_length ();
-         shortest_playing = shortest_playing <? m;
+         shortest_playing = min (shortest_playing, m);
        }
     }
   Moment starter;
@@ -142,13 +142,13 @@ Spacing_engraver::stop_translation_timestep ()
       Moment m = now_durations_[i].info_.music_cause ()->get_length ();
       if (m.to_bool ())
        {
-         starter = starter <? m;
+         starter = min (starter, m);
          playing_durations_.insert (now_durations_[i]);
        }
     }
   now_durations_.clear ();
 
-  shortest_playing = shortest_playing <? starter;
+  shortest_playing = min (shortest_playing, starter);
 
   Paper_column *sc
     = dynamic_cast<Paper_column *> (unsmob_grob (get_property ("currentMusicalColumn")));
index fa48551ab9a04c39ce3916586a4273c5123706f4..b1a4a1867e8f2cb0a5875dcf5703d0b19d772c8e 100644 (file)
@@ -220,7 +220,7 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols, Rational
 
                      space -= increment;
 
-                     dists[d] = dists[d] >? space;
+                     dists[d] = max (dists[d], space);
                    }
                  else
                    {
@@ -228,7 +228,7 @@ Spacing_spanner::prune_loose_columns (Grob *me, Link_array<Grob> *cols, Rational
                      Staff_spacing::get_spacing_params (sp,
                                                         &space, &fixed_space);
 
-                     dists[d] = dists[d] >? fixed_space;
+                     dists[d] = max (dists[d], fixed_space);
                    }
                }
            }
@@ -430,7 +430,7 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
          SCM st = cols[i]->get_property ("shortest-starter-duration");
          Moment this_shortest = *unsmob_moment (st);
          assert (this_shortest.to_bool ());
-         shortest_in_measure = shortest_in_measure <? this_shortest.main_part_;
+         shortest_in_measure = min (shortest_in_measure, this_shortest.main_part_);
        }
       else if (!shortest_in_measure.is_infinity ()
               && Item::is_breakable (cols[i]))
@@ -480,7 +480,7 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
     d = m->main_part_;
 
   if (max_idx >= 0)
-    d = d <? durations[max_idx];
+    d = min (d, durations[max_idx]);
 
   return d;
 }
@@ -608,7 +608,7 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item *lc, Item *rc, Real incr
     TODO: this criterion is discontinuous in the derivative.
     Maybe it should be continuous?
   */
-  compound_fixed_note_space = compound_fixed_note_space <? compound_note_space;
+  compound_fixed_note_space = min (compound_fixed_note_space, compound_note_space);
 
   bool packed = to_boolean (me->get_layout ()->c_variable ("packed"));
   Real strength, distance;
@@ -762,7 +762,7 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r, Moment sh
     }
 
   assert (!isinf (compound_space));
-  compound_space = compound_space >? compound_fixed;
+  compound_space = max (compound_space, compound_fixed);
 
   /*
     Hmm.  we do 1/0 in the next thing. Perhaps we should check if this
@@ -859,13 +859,13 @@ Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc,
       Moment *dt = unsmob_moment (rc->get_property ("measure-length"));
       if (dt)
        {
-         delta_t = delta_t <? * dt;
+         delta_t = min (delta_t, *dt);
 
          /*
            The following is an extra safety measure, such that
            the length of a mmrest event doesn't cause havoc.
          */
-         shortest_playing_len = shortest_playing_len <? * dt;
+         shortest_playing_len = min (shortest_playing_len, *dt);
        }
     }
   Real dist = 0.0;
@@ -877,7 +877,7 @@ Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc,
     around to get chord tremolos to behave properly.
 
   */
-  shortest_playing_len = shortest_playing_len >? delta_t;
+  shortest_playing_len = max (shortest_playing_len, delta_t);
   if (delta_t.main_part_ && !lwhen.grace_part_)
     {
       dist = get_duration_space (me, shortest_playing_len, shortest.main_part_, expand_only);