From: Han-Wen Nienhuys Date: Sat, 30 Apr 2005 23:43:03 +0000 (+0000) Subject: * flower/*.cc: remove ? X-Git-Tag: release/2.5.22~28 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d3c50bb3e14b4ded57e6747ed5d122fabedebecb;p=lilypond.git * flower/*.cc: remove ? * lily/*.cc: remove ? --- diff --git a/ChangeLog b/ChangeLog index d302f7d9f4..00ad577359 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2005-05-01 Han-Wen Nienhuys + * flower/*.cc: remove ? + + * lily/*.cc: remove ? + * 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. diff --git a/flower/getopt-long.cc b/flower/getopt-long.cc index d8d750bf0e..85b5f0ba9b 100644 --- a/flower/getopt-long.cc +++ b/flower/getopt-long.cc @@ -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++) diff --git a/flower/include/compare.hh b/flower/include/compare.hh index 37e01f46ee..a0d7ed98fa 100644 --- a/flower/include/compare.hh +++ b/flower/include/compare.hh @@ -13,21 +13,6 @@ 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, ?, >) -#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; } \ \ diff --git a/flower/include/interval.hh b/flower/include/interval.hh index fcaf39cdce..41f9c7887f 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -50,8 +50,8 @@ struct Interval_t : public Drul_array void intersect (Interval_t h); void add_point (T p) { - elem_ref (LEFT) = elem (LEFT) ? p; + elem_ref (LEFT) = min (elem (LEFT), p); + elem_ref (RIGHT) = max (elem (RIGHT), p); } T length () const; T delta () const; diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index 4c2bedc808..9aa70e4f19 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -89,32 +89,19 @@ template void Interval_t::unite (Interval_t h) { - elem_ref (LEFT) = h.elem (LEFT) ? elem (RIGHT); + elem_ref (LEFT) = min (h.elem (LEFT), elem (LEFT)); + elem_ref (RIGHT) = max (h.elem (RIGHT), elem (RIGHT)); } template void Interval_t::intersect (Interval_t h) { -#if defined (__GNUG__) && !defined (__STRICT_ANSI__) - elem_ref (LEFT) = h.elem (LEFT) >? elem (LEFT); - elem_ref (RIGHT) = h.elem (RIGHT) -Interval_t -intersect (Interval_t x, Interval_t const &y) -{ - x.intersect (y); - return x; -} -#endif + template String diff --git a/flower/include/real.hh b/flower/include/real.hh index c75b14a0ce..d8daa64433 100644 --- a/flower/include/real.hh +++ b/flower/include/real.hh @@ -13,6 +13,7 @@ typedef double Real; extern const Real infinity_f; +using namespace std; template inline T abs (T x) { @@ -26,20 +27,12 @@ template inline int sign (T x) return 0; } -template inline T max (T x, T y) -{ - return x >? y; -} template inline T sqr (T x) { return x * x; } -template inline T min (T x, T y) -{ - return x #include #include - #include -#include "string-data.hh" +using namespace std; + const int INITIALMAX = 8; #include @@ -90,7 +93,7 @@ String_data::remax (int j) if (j > maxlen) { Byte *p = new Byte[j + 1]; - memcpy (p, data_byte_, (maxlen ? 0); + return s + to_string (' ' , max (n - s.length (), 0)); } diff --git a/flower/string.cc b/flower/string.cc index 5279b6a2d5..b191804013 100644 --- a/flower/string.cc +++ b/flower/string.cc @@ -168,7 +168,7 @@ String::compare (String const &s1, String const &s2) /* don't forget the terminating '\0' */ - int f = (s1.length () ? 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]) - 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 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 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 */ +#include "beam.hh" + +#include #include #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 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 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 y (yl, yr); Drul_array 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) ? 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 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 0 && i < stems.size () -1 && Stem::is_invisible (st)) - b = b 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 ? (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] ? to_str0 (); - char const *end_str0 = pos_str0 + 7 ? 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 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 const &, Interval) const; virtual Array 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) ? 0) 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 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); + 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 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 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 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) ? 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) 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] - 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 pending_moment (); + p = min (p, first_iter_->pending_moment ()); if (second_iter_->ok ()) - p = p 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 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 get_length (); if (m.to_bool ()) { - starter = starter (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 *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 *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 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 const &cols) d = m->main_part_; if (max_idx >= 0) - d = d 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 ? 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);