From ddc79e206f765e1d9d4c6143bc95eced6b5556ba Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:58:23 +0000 Subject: [PATCH] lilypond-0.1.16 --- flower/include/string.hh | 14 ++++++++++---- flower/string.cc | 7 ++++++- lily/chord-iterator.cc | 2 +- lily/clef-grav.cc | 4 ++-- lily/dimen.cc | 2 +- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/flower/include/string.hh b/flower/include/string.hh index b749b7ee06..9e60bf9858 100644 --- a/flower/include/string.hh +++ b/flower/include/string.hh @@ -83,21 +83,27 @@ public: Byte const* byte_C() const; char* ch_l(); Byte* byte_l(); - +#if 0 /// deprecated; use ch_C() operator char const*() const { return ch_C(); } - +#endif String &operator =(String const & source); /// concatenate s void operator += (char const* s) { strh_ += s; } void operator += (String s); - /// is the string empty? - operator bool () const + bool empty_b () const; +#if 0 + /** is the string empty? + + Ugh-ugh-thank-you-cygnus. W32 barfs on this + */ + operator bool () const; { return length_i (); } +#endif void append (String); void prepend (String); diff --git a/flower/string.cc b/flower/string.cc index a68afb5887..74ae9a7865 100644 --- a/flower/string.cc +++ b/flower/string.cc @@ -139,6 +139,11 @@ String::ch_l() return strh_.ch_l(); } +bool +String::empty_b () const +{ + return !length_i (); +} /** Do a signed comparison, analogous to memcmp; */ @@ -214,7 +219,7 @@ String::index_i (char c) const find the substring. @return - index of leftmost occurrence of #searchfor# +1 index of leftmost occurrence of #searchfor# */ int String::index_i (String searchfor) const diff --git a/lily/chord-iterator.cc b/lily/chord-iterator.cc index 83c5435ed6..054990199f 100644 --- a/lily/chord-iterator.cc +++ b/lily/chord-iterator.cc @@ -32,7 +32,7 @@ Chord_iterator::construct_children() Music_iterator * mi = get_iterator_p (i.ptr()); if (mi->ok()) { - if (!chord_C_->translator_type_str_) + if (chord_C_->translator_type_str_.empty_b ()) set_translator (mi->report_to_l()->ancestor_l (chord_C_->multi_level_i_)); children_p_list_.bottom().add (mi); } diff --git a/lily/clef-grav.cc b/lily/clef-grav.cc index 5571327077..670e5d9cd0 100644 --- a/lily/clef-grav.cc +++ b/lily/clef-grav.cc @@ -63,7 +63,7 @@ Clef_engraver::read_req (Clef_change_req*c_l) void Clef_engraver::acknowledge_element (Score_elem_info info) { - if (info.elem_l_->name() == Bar::static_name () && clef_type_str_) + if (info.elem_l_->name() == Bar::static_name () && clef_type_str_.length_i()) { create_clef(); if (!clef_req_l_) @@ -77,7 +77,7 @@ Clef_engraver::do_creation_processing() Scalar def = get_property ("defaultclef"); if (def) set_type (def); - if (clef_type_str_) + if (clef_type_str_.length_i ()) create_clef(); clef_p_->default_b_ = false; } diff --git a/lily/dimen.cc b/lily/dimen.cc index 499d286cf2..4665221692 100644 --- a/lily/dimen.cc +++ b/lily/dimen.cc @@ -7,7 +7,7 @@ Real parse_dimen (String dim) { int i=dim.length_i()-1; - char const *s = dim; + char const *s = dim.ch_C (); while (i > 0 && (isspace (s[i]) || isalpha (s[i]))) { i--; -- 2.39.5