summaryrefslogtreecommitdiff
path: root/lily
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@xs4all.nl>2005-04-30 23:43:03 +0000
committerHan-Wen Nienhuys <hanwen@xs4all.nl>2005-04-30 23:43:03 +0000
commitd3c50bb3e14b4ded57e6747ed5d122fabedebecb (patch)
treeed00c7bb3959af63df6de8147051489292ab75cc /lily
parentf2ea6d166d05a6653865e18ec7aff5b81d84b5f0 (diff)
* flower/*.cc: remove <? and >?
* lily/*.cc: remove <? and >?
Diffstat (limited to 'lily')
-rw-r--r--lily/afm.cc2
-rw-r--r--lily/align-interface.cc4
-rw-r--r--lily/auto-beam-engraver.cc2
-rw-r--r--lily/beam-concave.cc4
-rw-r--r--lily/beam-engraver.cc2
-rw-r--r--lily/beam-quanting.cc16
-rw-r--r--lily/beam.cc19
-rw-r--r--lily/beaming-info.cc6
-rw-r--r--lily/binary-source-file.cc4
-rw-r--r--lily/break-algorithm.cc4
-rw-r--r--lily/break-align-interface.cc2
-rw-r--r--lily/chord-tremolo-engraver.cc2
-rw-r--r--lily/cluster-engraver.cc4
-rw-r--r--lily/completion-note-heads-engraver.cc2
-rw-r--r--lily/gourlay-breaking.cc2
-rw-r--r--lily/grid-point-engraver.cc2
-rw-r--r--lily/include/break-algorithm.hh2
-rw-r--r--lily/ledger-line-spanner.cc6
-rw-r--r--lily/line-interface.cc4
-rw-r--r--lily/lookup.cc6
-rw-r--r--lily/lyric-extender.cc6
-rw-r--r--lily/lyric-hyphen.cc4
-rw-r--r--lily/multi-measure-rest.cc8
-rw-r--r--lily/music-sequence.cc4
-rw-r--r--lily/note-head.cc2
-rw-r--r--lily/note-spacing.cc4
-rw-r--r--lily/ottava-bracket.cc7
-rw-r--r--lily/part-combine-iterator.cc4
-rw-r--r--lily/quote-iterator.cc4
-rw-r--r--lily/simultaneous-music-iterator.cc2
-rw-r--r--lily/spacing-engraver.cc6
-rw-r--r--lily/spacing-spanner.cc18
32 files changed, 85 insertions, 79 deletions
diff --git a/lily/afm.cc b/lily/afm.cc
index 348cfbeadd..e5b463ce5a 100644
--- a/lily/afm.cc
+++ b/lily/afm.cc
@@ -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++)
diff --git a/lily/align-interface.cc b/lily/align-interface.cc
index 7489f6692c..3e4b9c5ca8 100644
--- a/lily/align-interface.cc
+++ b/lily/align-interface.cc
@@ -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;
diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc
index 38585b06d5..e4d71d0754 100644
--- a/lily/auto-beam-engraver.cc
+++ b/lily/auto-beam-engraver.cc
@@ -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 ();
}
}
diff --git a/lily/beam-concave.cc b/lily/beam-concave.cc
index 91c772a06b..cf0653b09d 100644
--- a/lily/beam-concave.cc
+++ b/lily/beam-concave.cc
@@ -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 ();
diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc
index f5ea6a3ca9..7e3a898dd3 100644
--- a/lily/beam-engraver.cc
+++ b/lily/beam-engraver.cc
@@ -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);
}
}
diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc
index dfc7fa6d92..c950349fc1 100644
--- a/lily/beam-quanting.cc
+++ b/lily/beam-quanting.cc
@@ -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;
diff --git a/lily/beam.cc b/lily/beam.cc
index 7d277dac50..15be9c876e 100644
--- a/lily/beam.cc
+++ b/lily/beam.cc
@@ -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;
diff --git a/lily/beaming-info.cc b/lily/beaming-info.cc
index 50b94a6fb9..1165148b94 100644
--- a/lily/beaming-info.cc
+++ b/lily/beaming-info.cc
@@ -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
{
diff --git a/lily/binary-source-file.cc b/lily/binary-source-file.cc
index 5f00138cf1..b1a78b16dc 100644
--- a/lily/binary-source-file.cc
+++ b/lily/binary-source-file.cc
@@ -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);
diff --git a/lily/break-algorithm.cc b/lily/break-algorithm.cc
index 96f4031a08..3a18f16766 100644
--- a/lily/break-algorithm.cc
+++ b/lily/break-algorithm.cc
@@ -99,3 +99,7 @@ Break_algorithm::solve () const
return h;
}
+
+Break_algorithm::~Break_algorithm ()
+{
+}
diff --git a/lily/break-align-interface.cc b/lily/break-align-interface.cc
index 7c1d1ff219..f1469a03f6 100644
--- a/lily/break-align-interface.cc
+++ b/lily/break-align-interface.cc
@@ -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
{
diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc
index 5e983fdc94..50d4e382cd 100644
--- a/lily/chord-tremolo-engraver.cc
+++ b/lily/chord-tremolo-engraver.cc
@@ -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;
diff --git a/lily/cluster-engraver.cc b/lily/cluster-engraver.cc
index cdbfcd9b5d..c6ea93dc86 100644
--- a/lily/cluster-engraver.cc
+++ b/lily/cluster-engraver.cc
@@ -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 ());
diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc
index 955b4bf4e2..8a9ac0fbef 100644
--- a/lily/completion-note-heads-engraver.cc
+++ b/lily/completion-note-heads-engraver.cc
@@ -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;
diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc
index 3c7ed01a97..24eeb934a8 100644
--- a/lily/gourlay-breaking.cc
+++ b/lily/gourlay-breaking.cc
@@ -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;
}
diff --git a/lily/grid-point-engraver.cc b/lily/grid-point-engraver.cc
index 7da25e2791..f2125a36cd 100644
--- a/lily/grid-point-engraver.cc
+++ b/lily/grid-point-engraver.cc
@@ -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);
}
}
}
diff --git a/lily/include/break-algorithm.hh b/lily/include/break-algorithm.hh
index a891c7c140..025c56406e 100644
--- a/lily/include/break-algorithm.hh
+++ b/lily/include/break-algorithm.hh
@@ -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 *);
diff --git a/lily/ledger-line-spanner.cc b/lily/ledger-line-spanner.cc
index 02e4660e5a..e56851fbe0 100644
--- a/lily/ledger-line-spanner.cc
+++ b/lily/ledger-line-spanner.cc
@@ -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 +
diff --git a/lily/line-interface.cc b/lily/line-interface.cc
index 163f685190..c759004e3c 100644
--- a/lily/line-interface.cc
+++ b/lily/line-interface.cc
@@ -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);
diff --git a/lily/lookup.cc b/lily/lookup.cc
index 56b0985421..57d668fe73 100644
--- a/lily/lookup.cc
+++ b/lily/lookup.cc
@@ -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);
diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc
index 53090bcafb..cbe0362185 100644
--- a/lily/lyric-extender.cc
+++ b/lily/lyric-extender.cc
@@ -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;
diff --git a/lily/lyric-hyphen.cc b/lily/lyric-hyphen.cc
index 95e8fd881f..f027211226 100644
--- a/lily/lyric-hyphen.cc
+++ b/lily/lyric-hyphen.cc
@@ -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));
diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc
index a1eb2dbfbf..f343047994 100644
--- a/lily/multi-measure-rest.cc
+++ b/lily/multi-measure-rest.cc
@@ -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);
diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc
index 555e2e3afb..9879da98e0 100644
--- a/lily/music-sequence.cc
+++ b/lily/music-sequence.cc
@@ -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;
}
diff --git a/lily/note-head.cc b/lily/note-head.cc
index 63bc9c342c..6096c7cd00 100644
--- a/lily/note-head.cc
+++ b/lily/note-head.cc
@@ -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",
diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc
index 9e34006967..82640d4d62 100644
--- a/lily/note-spacing.cc
+++ b/lily/note-spacing.cc
@@ -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);
diff --git a/lily/ottava-bracket.cc b/lily/ottava-bracket.cc
index 9a02f4b637..e5d04bb1d1 100644
--- a/lily/ottava-bracket.cc
+++ b/lily/ottava-bracket.cc
@@ -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;
diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc
index e9a5a9c4fb..006e0024d1 100644
--- a/lily/part-combine-iterator.cc
+++ b/lily/part-combine-iterator.cc
@@ -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;
}
diff --git a/lily/quote-iterator.cc b/lily/quote-iterator.cc
index 44266a6bc4..61b2d025e9 100644
--- a/lily/quote-iterator.cc
+++ b/lily/quote-iterator.cc
@@ -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;
}
diff --git a/lily/simultaneous-music-iterator.cc b/lily/simultaneous-music-iterator.cc
index 1c5a800206..550d1adeaf 100644
--- a/lily/simultaneous-music-iterator.cc
+++ b/lily/simultaneous-music-iterator.cc
@@ -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;
diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc
index 22931c8ecf..2c7f59360e 100644
--- a/lily/spacing-engraver.cc
+++ b/lily/spacing-engraver.cc
@@ -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")));
diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc
index fa48551ab9..b1a4a1867e 100644
--- a/lily/spacing-spanner.cc
+++ b/lily/spacing-spanner.cc
@@ -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);