]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3531: replaced function argument 'string' by 'const string&' where it makes...
authorFrédéric Bron <frederic.bron@m4x.org>
Fri, 23 Aug 2013 15:30:34 +0000 (17:30 +0200)
committerDavid Kastrup <dak@gnu.org>
Tue, 10 Sep 2013 01:15:34 +0000 (03:15 +0200)
Measurements on x86_64 (i7-2760QM, 2.40GHz) Fedora 19 with g++ 4.8.1, with
configure --enable-optimising --disable-debugging; tests run 10 times, average
elapsed time compared (/usr/bin/time)

* Bach, Concerto in E major or violin and strings, BWV 1042 (Mutopia source),
  38 pages:
  $ lilypond score.ly -> master: 15.4s, with patch: -0.1%
* lilypond regression tests (1153 .ly files):
  $ lilypond *.ly -> master: 276.6s, with patch: -2.5%

83 files changed:
flower/file-name.cc
flower/file-path.cc
flower/include/file-name.hh
flower/include/file-path.hh
flower/include/international.hh
flower/include/std-string.hh
flower/include/std-vector.hh
flower/include/string-convert.hh
flower/include/warn.hh
flower/international.cc
flower/std-string.cc
flower/string-convert.cc
flower/warn.cc
lily/all-font-metrics.cc
lily/audio-item.cc
lily/auto-change-iterator.cc
lily/axis-group-interface.cc
lily/change-iterator.cc
lily/context.cc
lily/control-track-performer.cc
lily/file-name-map.cc
lily/font-metric.cc
lily/function-documentation.cc
lily/global-context.cc
lily/gregorian-ligature.cc
lily/grob.cc
lily/includable-lexer.cc
lily/include/all-font-metrics.hh
lily/include/audio-item.hh
lily/include/axis-group-interface.hh
lily/include/change-iterator.hh
lily/include/context.hh
lily/include/file-name-map.hh
lily/include/font-metric.hh
lily/include/global-context.hh
lily/include/grob.hh
lily/include/includable-lexer.hh
lily/include/input.hh
lily/include/lily-guile-macros.hh
lily/include/lily-guile.hh
lily/include/lily-lexer.hh
lily/include/lily-parser.hh
lily/include/lilypond-version.hh
lily/include/midi-chunk.hh
lily/include/midi-stream.hh
lily/include/misc.hh
lily/include/modified-font-metric.hh
lily/include/note-head.hh
lily/include/open-type-font.hh
lily/include/output-def.hh
lily/include/pango-font.hh
lily/include/paper-outputter.hh
lily/include/relocate.hh
lily/include/rest.hh
lily/include/slur-configuration.hh
lily/include/slur-proto-engraver.hh
lily/include/source-file.hh
lily/include/tie-configuration.hh
lily/input.cc
lily/lexer.ll
lily/lily-guile.cc
lily/lily-lexer.cc
lily/lily-parser.cc
lily/lilypond-version.cc
lily/main.cc
lily/midi-chunk.cc
lily/midi-stream.cc
lily/misc.cc
lily/modified-font-metric.cc
lily/note-head.cc
lily/open-type-font.cc
lily/output-def.cc
lily/pango-font.cc
lily/paper-outputter.cc
lily/parser.yy
lily/relocate.cc
lily/rest.cc
lily/slur-configuration.cc
lily/slur-proto-engraver.cc
lily/source-file.cc
lily/staff-performer.cc
lily/tie-configuration.cc
lily/ttf.cc

index c24c0731e4f237bccba2ac3dd1d0b8b450210a19..1746c2c28d84adc5cbe8cd19f5e8d431dec10383 100644 (file)
@@ -51,7 +51,7 @@ using namespace std;
 
 #ifdef __CYGWIN__
 static string
-dos_to_posix (string file_name)
+dos_to_posix (const string &file_name)
 {
   char buf[PATH_MAX] = "";
   char s[PATH_MAX] = {0};
@@ -78,7 +78,7 @@ slashify (string file_name)
 }
 
 string
-dir_name (string const file_name)
+dir_name (const string &file_name)
 {
   string s = file_name;
   s = slashify (s);
index d0dd3a1f990afd846dc1dc73ed0a06485aa80024..b19732d15ee43050025792b2098a0b229baee662 100644 (file)
@@ -47,13 +47,13 @@ File_path::directories () const
 
 #include <algorithm>
 void
-File_path::parse_path (string p)
+File_path::parse_path (const string &p)
 {
   concat (dirs_, string_split (p, PATHSEP));
 }
 
 bool
-is_file (string file_name)
+is_file (const string &file_name)
 {
 #if !STAT_MACROS_BROKEN
   struct stat sbuf;
@@ -106,7 +106,7 @@ directory, in this order.
 The file name if found, or empty string if not found. */
 
 string
-File_path::find (string name) const
+File_path::find (const string &name) const
 {
   if (!name.length () || (name == "-"))
     return name;
@@ -146,7 +146,7 @@ File_path::find (string name) const
   where EXT is from EXTENSIONS.
 */
 string
-File_path::find (string name, char const *extensions[])
+File_path::find (const string &name, char const *extensions[])
 {
   if (name.empty () || name == "-")
     return name;
@@ -195,13 +195,13 @@ File_path::to_string () const
 }
 
 void
-File_path::append (string str)
+File_path::append (const string &str)
 {
   dirs_.push_back (str);
 }
 
 void
-File_path::prepend (string str)
+File_path::prepend (const string &str)
 {
   dirs_.insert (dirs_.begin (), str);
 }
index b30dd9cd5b6d8f89ccb1e586a5ca3f3a8e595d1c..4822783fc6b956241c363cbbb0521008234221a6 100644 (file)
@@ -23,7 +23,7 @@
 #include "std-vector.hh"
 #include "std-string.hh"
 
-std::string dir_name (std::string file_name);
+std::string dir_name (const std::string &file_name);
 std::string get_working_directory ();
 
 class File_name
index 29ca17f24638a81dd3f4cf988ac5c7c21d5748af..8c8049391d9b5e1c1834643752b5818cf776c329 100644 (file)
@@ -38,16 +38,16 @@ class File_path
 
 public:
   vector<string> directories () const;
-  string find (string name) const;
-  string find (string name, char const *extensions[]);
+  string find (const string &name) const;
+  string find (const string &name, char const *extensions[]);
   string to_string () const;
   bool try_append (string str);
-  void append (string str);
-  void parse_path (string);
-  void prepend (string str);
+  void append (const string&);
+  void parse_path (const string&);
+  void prepend (const string&);
 };
 
-bool is_file (string file_name);
+bool is_file (const string &file_name);
 bool is_dir (string file_name);
 
 #endif /* FILE_PATH */
index 6dd46c28e96b429be9ddf40d8fd4b1d3c8525ed7..5797a293f73d29bee72be298877acb5c9064008d 100644 (file)
@@ -43,7 +43,7 @@ string _ (char const *ch);
 */
 string _f (char const *format, ...)
 __attribute__ ((format (printf, 1, 2)));
-string _f (char const *format, string s, string s2 = "", string s3 = "");
+string _f (char const *format, const string &s, const string &s2 = "", const string &s3 = "");
 /**
    va_list version of _f
  */
index 5b7d2af11dac0363dfaa985cf6c1819920106c68..6b6e8ef9728ea7ab815b4b3ac1c03804d5eb0819 100644 (file)
@@ -39,7 +39,7 @@ using namespace std;
 typedef size_t ssize;
 #define NPOS string::npos
 
-string to_string (string s);
+string to_string (const string&);
 string to_string (char c, int n = 1);
 string to_string (int i, char const *format = 0);
 string to_string (double f, char const *format = 0);
@@ -53,7 +53,7 @@ __attribute__ ((format (printf, 1, 2)));
 
 string &replace_all (string *str, string const &find, string const &replace);
 string &replace_all (string *str, char find, char replace);
-char *string_copy (string s);
+char *string_copy (const string &s);
 
 int string_compare (string const &, string const &);
 
index dd276df1861c3696c8a54825dca76250afbb65ba..e7f29a8fcbb05065e0157f7c60c586b4e2309823 100644 (file)
@@ -258,7 +258,7 @@ junk_pointers (vector<T> &v)
 }
 
 vector<string> string_split (string str, char c);
-string string_join (vector<string> const &strs, string infix);
+string string_join (vector<string> const &strs, const string &infix);
 
 #define iterof(i,s) typeof((s).begin()) i((s).begin())
 
index 396eee2f912139cc85d467903bcdb7ac6c7e166f..6b4fba023f4f1ebb23efec44ecf006d471b2c9db 100644 (file)
@@ -19,19 +19,19 @@ class String_convert
   static int hex2nibble (Byte byte);
   static Byte nibble2hex_byte (Byte byte);
 public:
-  static string pad_to (string s, size_t length);
+  static string pad_to (const string &s, size_t length);
   static string bool_string (bool b);
   static string bin2hex (Byte bin_char);
-  static string bin2hex (string bin_string);
-  static int bin2int (string bin_string);
-  static unsigned bin2unsigned (string bin_string);
+  static string bin2hex (const string &bin_string);
+  static int bin2int (const string &bin_string);
+  static unsigned bin2unsigned (const string &bin_string);
   static string char_string (char c, int n);
-  static int dec2int (string dec_string);
-  static double dec2double (string dec_string);
+  static int dec2int (const string &dec_string);
+  static double dec2double (const string &dec_string);
   static string double_string (double f, char const *fmt = 0);
   static string form_string (char const *format, ...) __attribute__ ((format (printf, 1, 2)));
   static string vform_string (char const *format, va_list args);
-  static string hex2bin (string str);
+  static string hex2bin (const string &str);
   static string int_string (int i, char const *fmt = 0);
   static string unsigned_string (unsigned);
   static string unsigned_long_string (unsigned long);
index 25240113ca2243e459839d7689db25b60c742206..333e95a94e5feece710e71a0a1470603bec63992 100644 (file)
@@ -44,25 +44,25 @@ extern int loglevel;
 extern bool warning_as_error;
 
 /* output messages, in decreasing order of importance */
-void error (string s, string location = ""); // Fatal error, exits lilypond!
-void programming_error (string s, string location = "");
-void non_fatal_error (string, string location = "");
-void warning (string s, string location = "");
-void basic_progress (string s, string location = "");
+void error (string s, const string &location = ""); // Fatal error, exits lilypond!
+void programming_error (const string &s, const string &location = "");
+void non_fatal_error (const string&, const string &location = "");
+void warning (const string &s, const string &location = "");
+void basic_progress (const string &s, const string &location = "");
 /* progress_indication does by default *NOT* start on a new line */
-void progress_indication (string s, bool newline = false, string location = "");
-void message (string s, bool newline = true, string location = "");
-void debug_output (string s, bool newline = true, string location = "");
+void progress_indication (const string &s, bool newline = false, const string &location = "");
+void message (const string &s, bool newline = true, const string &location = "");
+void debug_output (const string &s, bool newline = true, const string &location = "");
 
 /* Helper functions that always print out the message. Callers should ensure
    that the loglevel is obeyed */
-void print_message (int level, string location, string s, bool newline = true);
+void print_message (int level, const string &location, string s, bool newline = true);
 
 bool is_loglevel (int level);
 void set_loglevel (int level);
 void set_loglevel (string level);
 
-void expect_warning (string msg);
+void expect_warning (const string &msg);
 void check_expected_warnings ();
 
 #endif /* WARN_HH */
index cbdcf58d6e9bf80abcb2c3951eabfe9c74be2ea7..2e6a09df9fcaf1456097c0d601a3f06cae34018c 100644 (file)
@@ -55,7 +55,7 @@ v_f (char const *format, va_list args)
 }
 
 string
-_f (char const *format, string s, string s2, string s3)
+_f (char const *format, const string &s, const string &s2, const string &s3)
 {
   return String_convert::form_string (gettext (format), s.c_str (), s2.c_str (),
                                       s3.c_str ());
index d2c2d624d2981893ce9ac21879d450015f2364d9..7dc9d47311446f649db2f8d550b7d0ed40801419 100644 (file)
@@ -21,7 +21,7 @@
 #include "string-convert.hh"
 
 string
-to_string (string s)
+to_string (const string &s)
 {
   return s;
 }
@@ -106,7 +106,7 @@ replace_all (string *str, char find, char replace)
 }
 
 char *
-string_copy (string s)
+string_copy (const string &s)
 {
   ssize len = s.length ();
   char *dest = new char[len + 1];
@@ -144,7 +144,7 @@ string_split (string str, char c)
 }
 
 string
-string_join (vector<string> const &strs, string infix)
+string_join (vector<string> const &strs, const string &infix)
 {
   string result;
   for (vsize i = 0; i < strs.size (); i++)
index 68e6a0c0b82b199c9a499cf0e00c4d75a65dc12a..eebcd92708076919e17f874ddab85e8b28474270 100644 (file)
@@ -43,7 +43,7 @@ String_convert::bin2hex (Byte bin_char)
 }
 
 string
-String_convert::bin2hex (string bin_string)
+String_convert::bin2hex (const string &bin_string)
 {
   string str;
   Byte const *byte = (Byte const *)bin_string.data ();
@@ -56,13 +56,13 @@ String_convert::bin2hex (string bin_string)
 }
 
 int
-String_convert::bin2int (string bin_string)
+String_convert::bin2int (const string &bin_string)
 {
   return bin2unsigned (bin_string);
 }
 
 unsigned
-String_convert::bin2unsigned (string bin_string)
+String_convert::bin2unsigned (const string &bin_string)
 {
   assert (bin_string.length () <= (int)sizeof (unsigned));
 
@@ -76,7 +76,7 @@ String_convert::bin2unsigned (string bin_string)
 }
 
 int
-String_convert::dec2int (string dec_string)
+String_convert::dec2int (const string &dec_string)
 {
   if (!dec_string.length ())
     return 0;
@@ -100,7 +100,7 @@ String_convert::i64_string (I64 i64, char const *fmt)
 }
 // breendet imp from string
 double
-String_convert::dec2double (string dec_string)
+String_convert::dec2double (const string &dec_string)
 {
   if (!dec_string.length ())
     return 0;
@@ -134,7 +134,7 @@ String_convert::hex2bin (string hex_string, string &bin_string_r)
 }
 
 string
-String_convert::hex2bin (string hex_string)
+String_convert::hex2bin (const string &hex_string)
 {
   string str;
 
@@ -352,7 +352,7 @@ String_convert::unsigned_long_string (unsigned long ul)
 }
 
 string
-String_convert::pad_to (string s, size_t n)
+String_convert::pad_to (const string &s, size_t n)
 {
   return s + string (max (int (n - s.length ()), 0), ' ');
 }
@@ -360,13 +360,13 @@ String_convert::pad_to (string s, size_t n)
 string
 String_convert::to_upper (string s)
 {
-  return strnupr ((char *)s.c_str (), s.length ());
+  return strnupr (const_cast<char*>(s.c_str ()), s.length ());
 }
 
 string
 String_convert::to_lower (string s)
 {
-  return strnlwr ((char *)s.c_str (), s.length ());
+  return strnlwr (const_cast<char*>(s.c_str ()), s.length ());
 }
 
 string
index f3f6e1c74369e8f92d0b4a9a849ac9889548ed5a..52e2a425086ed1b42a3eeecd40d0d306f37ee779 100644 (file)
@@ -99,7 +99,7 @@ set_loglevel (string level)
  * expected warnings again.
  */
 vector<string> expected_warnings;
-void expect_warning (string msg)
+void expect_warning (const string &msg)
 {
   expected_warnings.push_back (msg);
 }
@@ -119,7 +119,7 @@ void check_expected_warnings ()
   expected_warnings.clear ();
 }
 
-bool is_expected (string s)
+bool is_expected (const string &s)
 {
   bool expected = false;
   for (vsize i = 0; i < expected_warnings.size (); i++)
@@ -151,7 +151,7 @@ static bool message_newline = true;
    if newline is true, start the message on a new line.
 */
 void
-print_message (int level, string location, string s, bool newline)
+print_message (int level, const string &location, string s, bool newline)
 {
   /* Only print the message if the current loglevel allows it: */
   if (!is_loglevel (level))
@@ -178,7 +178,7 @@ print_message (int level, string location, string s, bool newline)
 
 /* Display a fatal error message.  Also exits lilypond.  */
 void
-error (string s, string location)
+error (string s, const string &location)
 {
   print_message (LOG_ERROR, location, _f ("fatal error: %s", s) + "\n");
   exit (1);
@@ -186,7 +186,7 @@ error (string s, string location)
 
 /* Display a severe programming error message, but don't exit.  */
 void
-programming_error (string s, string location)
+programming_error (const string &s, const string &location)
 {
   if (is_expected (s))
     print_message (LOG_DEBUG, location, _f ("suppressed programming error: %s", s) + "\n");
@@ -201,7 +201,7 @@ programming_error (string s, string location)
 
 /* Display a non-fatal error message, don't exit.  */
 void
-non_fatal_error (string s, string location)
+non_fatal_error (const string &s, const string &location)
 {
   if (is_expected (s))
     print_message (LOG_DEBUG, location, _f ("suppressed error: %s", s) + "\n");
@@ -213,7 +213,7 @@ non_fatal_error (string s, string location)
 
 /* Display a warning message. */
 void
-warning (string s, string location)
+warning (const string &s, const string &location)
 {
   if (is_expected (s))
     print_message (LOG_DEBUG, location, _f ("suppressed warning: %s", s) + "\n");
@@ -225,21 +225,21 @@ warning (string s, string location)
 
 /* Display a success message.  */
 void
-basic_progress (string s, string location)
+basic_progress (const string &s, const string &location)
 {
   print_message (LOG_BASIC, location, s + "\n", true);
 }
 
 /* Display information about the progress.  */
 void
-progress_indication (string s, bool newline, string location)
+progress_indication (const string &s, bool newline, const string &location)
 {
   print_message (LOG_PROGRESS, location, s, newline);
 }
 
 /* Display a single info message.  */
 void
-message (string s, bool newline, string location)
+message (const string &s, bool newline, const string &location)
 {
   // Use the progress loglevel for all normal messages (including progress msg)
   print_message (LOG_INFO, location, s, newline);
@@ -247,7 +247,7 @@ message (string s, bool newline, string location)
 
 /* Display a debug information, not necessarily on a new line.  */
 void
-debug_output (string s, bool newline, string location)
+debug_output (const string &s, bool newline, const string &location)
 {
   print_message (LOG_DEBUG, location, s, newline);
 }
index 36ede54bb45236d4307738ac355aecf4a1b7e81f..cf0d4e90860d79d8268fdd463ed4bf717a3953d9 100644 (file)
@@ -28,7 +28,7 @@
 #include "warn.hh"
 
 Index_to_charcode_map const *
-All_font_metrics::get_index_to_charcode_map (string filename,
+All_font_metrics::get_index_to_charcode_map (const string &filename,
                                              int face_index,
                                              FT_Face face)
 {
@@ -40,7 +40,7 @@ All_font_metrics::get_index_to_charcode_map (string filename,
   return &filename_charcode_maps_map_[key];
 }
 
-All_font_metrics::All_font_metrics (string path)
+All_font_metrics::All_font_metrics (const string &path)
 {
   otf_dict_ = new Scheme_hash_table;
 
@@ -109,7 +109,7 @@ All_font_metrics::find_pango_font (PangoFontDescription const *description,
 #endif
 
 Open_type_font *
-All_font_metrics::find_otf (string name)
+All_font_metrics::find_otf (const string &name)
 {
   SCM sname = ly_symbol2scm (name.c_str ());
   SCM val;
@@ -140,7 +140,7 @@ All_font_metrics::find_otf (string name)
 }
 
 Font_metric *
-All_font_metrics::find_font (string name)
+All_font_metrics::find_font (const string &name)
 {
   Font_metric *f = find_otf (name);
 
index 895439e78401bbbb118a0c227eaaa592e457855a..b7a5ef21112c5decf3189fb48238dd85399a3ad7 100644 (file)
@@ -198,7 +198,7 @@ Audio_time_signature::Audio_time_signature (int beats, int one_beat)
   one_beat_ = one_beat;
 }
 
-Audio_text::Audio_text (Audio_text::Type type, string text_string)
+Audio_text::Audio_text (Audio_text::Type type, const string &text_string)
 {
   text_string_ = text_string;
   type_ = type;
index b52fb16bb4b8dc80fcc4526cec1c7c2785a5459a..1efa379e9d2cc2194e57c97756a7e932ad0466c3 100644 (file)
@@ -38,7 +38,7 @@ protected:
 private:
   SCM split_list_;
   Direction where_dir_;
-  void change_to (Music_iterator *, SCM, string);
+  void change_to (Music_iterator *, SCM, const string&);
   Moment start_moment_;
 
   Context_handle up_;
@@ -47,7 +47,7 @@ private:
 
 void
 Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym,
-                                 string to_id)
+                                 const string &to_id)
 {
   Context *current = it->get_outlet ();
   Context *last = 0;
index 819a32d6f4245169169729faf5fa6e09b1e4fe4b..d4d3d4102210a5896ddcd09886186beda7465294 100644 (file)
@@ -485,7 +485,7 @@ Axis_group_interface::calc_pure_relevant_grobs (SCM smob)
 }
 
 SCM
-Axis_group_interface::internal_calc_pure_relevant_grobs (Grob *me, string grob_set_name)
+Axis_group_interface::internal_calc_pure_relevant_grobs (Grob *me, const string &grob_set_name)
 {
   extract_grob_set (me, grob_set_name.c_str (), elts);
 
index 0adac3b8b3808d424847b345cba9a706a1174ca1..aa505f9fe104f83eee797770447e15fa10fc08c9 100644 (file)
@@ -26,7 +26,7 @@
 #include "warn.hh"
 
 void
-Change_iterator::error (string reason)
+Change_iterator::error (const string &reason)
 {
   string to_type = ly_symbol2string (get_music ()->get_property ("change-to-type"));
   string to_id = ly_scm2string (get_music ()->get_property ("change-to-id"));
index 583b2eac89b7705762fb32968e310c6fb7e202ac..8d44ca8f85c67d43c4ee5ab596839e2cd40e37cf 100644 (file)
@@ -105,7 +105,7 @@ Context::Context ()
 
 /* TODO:  this shares code with find_create_context ().  */
 Context *
-Context::create_unique_context (SCM name, string id, SCM operations)
+Context::create_unique_context (SCM name, const string &id, SCM operations)
 {
   /*
     Don't create multiple score contexts.
@@ -154,7 +154,7 @@ Context::create_unique_context (SCM name, string id, SCM operations)
 }
 
 Context *
-Context::find_create_context (SCM n, string id, SCM operations)
+Context::find_create_context (SCM n, const string &id, SCM operations)
 {
   /*
     Don't create multiple score contexts.
@@ -361,7 +361,7 @@ Context::path_to_acceptable_context (SCM name) const
 
 Context *
 Context::create_context (Context_def *cdef,
-                         string id,
+                         const string &id,
                          SCM ops)
 {
   infant_event_ = 0;
@@ -411,7 +411,7 @@ Context::is_bottom_context () const
 }
 
 Context *
-Context::get_default_interpreter (string context_id)
+Context::get_default_interpreter (const string &context_id)
 {
   if (!is_bottom_context ())
     {
@@ -572,7 +572,7 @@ Context::disconnect_from_parent ()
 */
 Context *
 find_context_below (Context *where,
-                    SCM type, string id)
+                    SCM type, const string &id)
 {
   if (where->is_alias (type))
     {
index 84f8044b4728a45b5248c43b7663cb3f9d2e3f78..9b0d676870d5d08d6074e2a3d2c6090657b5a7b0 100644 (file)
@@ -13,7 +13,7 @@ class Control_track_performer : public Performer
 {
   Audio_staff *control_track_;
 
-  void add_text (Audio_text::Type, string);
+  void add_text (Audio_text::Type, const string&);
   TRANSLATOR_DECLARATIONS (Control_track_performer);
 protected:
 
@@ -40,7 +40,7 @@ Control_track_performer::acknowledge_audio_element (Audio_element_info info)
 }
 
 void
-Control_track_performer::add_text (Audio_text::Type text_type, string str)
+Control_track_performer::add_text (Audio_text::Type text_type, const string &str)
 {
   Audio_item *text = new Audio_text (text_type, str);
   control_track_->add_audio_item (text);
index 96be62c9a2985bc8822420f9338cb7b2af1cf914..b124fda9b154d3f00195867223faf9e2c5d8e0b0 100644 (file)
@@ -26,10 +26,10 @@ using namespace std;
 map<string, string> file_name_map_global;
 
 string
-map_file_name (string s)
+map_file_name (const string &s)
 {
   if (file_name_map_global.find (s) != file_name_map_global.end ())
-    s = file_name_map_global[s];
+    return file_name_map_global[s];
   return s;
 }
 
index 6990afe5476f31fd9f04c845165f2c2719fdc624..892319f3b837668bf404d350605e285aa67e13f5 100644 (file)
@@ -84,12 +84,6 @@ Font_metric::get_indexed_char_dimensions (size_t) const
   return Box (Interval (0, 0), Interval (0, 0));
 }
 
-size_t
-Font_metric::name_to_index (string) const
-{
-  return (size_t) - 1;
-}
-
 Offset
 Font_metric::get_indexed_wxwy (size_t) const
 {
@@ -145,7 +139,7 @@ Font_metric::index_to_charcode (size_t i) const
 }
 
 Offset
-Font_metric::attachment_point (string) const
+Font_metric::attachment_point (const string&) const
 {
   return Offset (0, 0);
 }
@@ -158,7 +152,7 @@ Font_metric::sub_fonts () const
 
 Stencil
 Font_metric::text_stencil (Output_def *state,
-                           string, bool) const
+                           const string&, bool) const
 {
   (void) state;
 
index b1384076b1ed2dc8f7a726beaeaa46753ac71dcc..ec2355733387d435b561392f50cf9e0637d515a8 100644 (file)
@@ -27,7 +27,7 @@ using namespace std;
 static SCM doc_hash_table;
 
 void
-ly_check_name (string cxx, string scm_name)
+ly_check_name (const string &cxx, const string &scm_name)
 {
   string mangle = mangle_cxx_identifier (cxx);
   if (mangle != scm_name)
@@ -38,9 +38,9 @@ ly_check_name (string cxx, string scm_name)
 
 void
 ly_add_function_documentation (SCM func,
-                               string fname,
-                               string varlist,
-                               string doc)
+                               const string &fname,
+                               const string &varlist,
+                               const string &doc)
 {
   if (doc == "")
     return;
@@ -70,7 +70,7 @@ map<void *, string> type_names;
 
 void
 ly_add_type_predicate (void *ptr,
-                       string name)
+                       const string &name)
 {
   type_names[ptr] = name;
 }
index 49bfff6e19248326c4347662fd6249559dea617d..3fa5089e8076ec559395aa159fafb917df32f07b 100644 (file)
@@ -202,7 +202,7 @@ Global_context::previous_moment () const
 }
 
 Context *
-Global_context::get_default_interpreter (string /* context_id */)
+Global_context::get_default_interpreter (const string &/* context_id */)
 {
   if (get_score_context ())
     return get_score_context ()->get_default_interpreter ();
index e6e16e43931d0d6eb6f6280631fc3db8a00a73f9..a0f54ed162f3ec2c75a73195bc4d1b37f1557e1d 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "grob.hh"
 
-void check_prefix (string name, int mask, int prefix_set, string *str)
+void check_prefix (const string &name, int mask, int prefix_set, string *str)
 {
   if (prefix_set & mask)
     {
index 43828310a799d833820018766c776d8cbd138288..dee7bdaa3cfd5d4506f51b8c11250bbcc1fe95a9 100644 (file)
@@ -724,7 +724,7 @@ Grob::internal_vertical_less (Grob *g1, Grob *g2, bool pure)
   MESSAGES
 ****************************************************************/
 void
-Grob::programming_error (string s) const
+Grob::programming_error (const string &s) const
 {
   SCM cause = self_scm ();
   while (Grob *g = unsmob_grob (cause))
@@ -740,7 +740,7 @@ Grob::programming_error (string s) const
 }
 
 void
-Grob::warning (string s) const
+Grob::warning (const string &s) const
 {
   SCM cause = self_scm ();
   while (Grob *g = unsmob_grob (cause))
index 806eb1512f198254a50fe9e1c83d11c54b3b88ce..8c00965744f3c327a5576241fe32a274cb2a08d5 100644 (file)
@@ -59,7 +59,7 @@ Includable_lexer::Includable_lexer ()
 
 /** Set the new input file to NAME, remember old file.  */
 void
-Includable_lexer::new_input (string name, Sources *sources)
+Includable_lexer::new_input (const string &name, Sources *sources)
 {
   string current_dir = dir_name (main_input_name_);
   if (relative_includes)
@@ -94,7 +94,7 @@ Includable_lexer::new_input (string name, Sources *sources)
 }
 
 void
-Includable_lexer::new_input (string name, string data, Sources *sources)
+Includable_lexer::new_input (const string &name, string data, Sources *sources)
 {
   Source_file *file = new Source_file (name, data);
   sources->add (file);
index 3bb5b583778f02b0cf8bfc6a123d8ea013116fb6..7f2ca8326ab669b6a4afe7c71a83ddf68202ea62 100644 (file)
@@ -49,18 +49,18 @@ class All_font_metrics
   All_font_metrics (All_font_metrics const &);
 public:
 
-  Index_to_charcode_map const *get_index_to_charcode_map (string filename,
+  Index_to_charcode_map const *get_index_to_charcode_map (const string &filename,
                                                           int face_index,
                                                           FT_Face face);
 
-  All_font_metrics (string search_path);
+  All_font_metrics (const string &search_path);
   ~All_font_metrics ();
 
   Pango_font *find_pango_font (PangoFontDescription const *description,
                                Real scale);
 
-  Font_metric *find_font (string name);
-  Open_type_font *find_otf (string name);
+  Font_metric *find_font (const string &name);
+  Open_type_font *find_otf (const string &name);
   SCM font_descriptions () const;
 };
 
index 5e5d499fbd433d6d1876a1ef98468e2d91b6574e..544dd8378d74c743d6db59797e42a09ac9b7834a 100644 (file)
@@ -114,7 +114,7 @@ public:
     MARKER, CUE_POINT
   };
 
-  Audio_text (Audio_text::Type type, string text_string);
+  Audio_text (Audio_text::Type type, const string &text_string);
 
   Type type_;
   string text_string_;
index b33a555c7cd81b65bded19d111b770fc6ea8323c..5995c70e658f0b5ee29e312828c1f23a3f1eec7f 100644 (file)
@@ -49,7 +49,7 @@ class Axis_group_interface
   DECLARE_SCHEME_CALLBACK (calc_pure_relevant_items, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_pure_relevant_spanners, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_pure_y_common, (SCM));
-  static SCM internal_calc_pure_relevant_grobs (Grob *, string);
+  static SCM internal_calc_pure_relevant_grobs (Grob *, const string&);
   static Interval relative_group_extent (vector<Grob *> const &list,
                                          Grob *common, Axis);
   static Interval relative_maybe_bound_group_extent (vector<Grob *> const &list,
index 482f53d970d34164f493a55cf102c45005f211e5..2c9cb33125a7de97454a9b9500c5c4aebb6daa46 100644 (file)
@@ -31,7 +31,7 @@ public:
   DECLARE_CLASSNAME (Change_iterator);
 
 private:
-  void error (string);
+  void error (const string&);
 };
 
 #endif
index 14c348f6e4a91c658f30ec36d1570a5b93609ed2..c779074007cbfe3061051419be0471f2e01b25a2 100644 (file)
@@ -102,7 +102,7 @@ public:
   void instrumented_set_property (SCM, SCM, const char *, int, const char *);
   void internal_set_property (SCM var_sym, SCM value);
 
-  Context *create_context (Context_def *, string, SCM);
+  Context *create_context (Context_def *, const string&, SCM);
   DECLARE_LISTENER (create_context_from_event);
   DECLARE_LISTENER (acknowledge_infant);
   DECLARE_LISTENER (remove_context);
@@ -116,7 +116,7 @@ public:
   virtual Context *get_score_context () const;
   virtual Output_def *get_output_def () const;
   virtual Moment now_mom () const;
-  virtual Context *get_default_interpreter (string context_id = "");
+  virtual Context *get_default_interpreter (const string &context_id = "");
 
   bool is_alias (SCM) const;
   void add_alias (SCM);
@@ -125,8 +125,8 @@ public:
   bool is_removable () const;
 
   Context *find_create_context (SCM context_name,
-                                string id, SCM ops);
-  Context *create_unique_context (SCM context_name, string context_id,
+                                const string &id, SCM ops);
+  Context *create_unique_context (SCM context_name, const string &context_id,
                                   SCM ops);
   vector<Context_def *> path_to_acceptable_context (SCM alias) const;
 };
@@ -144,7 +144,7 @@ void sloppy_general_pushpop_property (Context *context,
                                       SCM context_property, SCM grob_property_path, SCM val);
 SCM updated_grob_properties (Context *tg, SCM sym);
 Context *find_context_below (Context *where,
-                             SCM type_sym, string id);
+                             SCM type_sym, const string &id);
 bool melisma_busy (Context *);
 
 Context *get_voice_to_lyrics (Context *lyrics);
index 3e25d7e5cfc95ab5d0dc1d8c5eb813dff47b6283..5999f7558223b4006724be9328cbb575569f5cd2 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "std-string.hh"
 
-string map_file_name (string s);
+string map_file_name (const string &s);
 
 #endif /* FILE_NAME_MAP_HH */
 
index 70a77fd6854b38562ee5d42828df5987c79e9c21..4c11989729ffc50a78323ef77ed209d8b5e6d703 100644 (file)
@@ -41,14 +41,14 @@ public:
   // Return stencil for given string. output_state may be modified to
   // record the font.
   virtual Stencil text_stencil (Output_def *output_state,
-                                string text, bool music) const;
+                                const string &text, bool music) const;
 
   virtual string font_name () const;
   virtual size_t count () const;
-  virtual Offset attachment_point (string) const;
+  virtual Offset attachment_point (const string&) const;
   virtual Offset get_indexed_wxwy (size_t) const;
   virtual Box get_indexed_char_dimensions (size_t index) const;
-  virtual size_t name_to_index (string) const;
+  virtual size_t name_to_index (string) const=0;
   virtual size_t index_to_charcode (size_t) const;
   virtual Real design_size () const;
   virtual Stencil find_by_name (string) const;
index 079162d27223bfac8295a577118135360d25b6e4..1ea2b38dc70d750b83268941ef42604b7874dd4c 100644 (file)
@@ -46,7 +46,7 @@ public:
   virtual SCM get_output ();
   virtual Output_def *get_output_def () const;
   virtual Moment now_mom () const;
-  virtual Context *get_default_interpreter (string context_id = "");
+  virtual Context *get_default_interpreter (const string &context_id = "");
 
   Moment previous_moment () const;
 protected:
index bc4071eb042410c2a83c4ee22869307ed5d9a6d5..a0902d6d8907a74542ee3260efea9b1003fd2246 100644 (file)
@@ -114,8 +114,8 @@ public:
   void internal_set_property (SCM sym, SCM val);
 
   /* messages */
-  void warning (string) const;
-  void programming_error (string) const;
+  void warning (const string&) const;
+  void programming_error (const string&) const;
 
   /* class hierarchy */
   virtual System *get_system () const;
index c9595f923b84e44d7ef2ee48293b45f6dba93354..8378404513cabf9b3169b26b5bf71584f12d12d7 100644 (file)
@@ -53,9 +53,9 @@ public:
   vector<string> file_name_strings_;
 
   Source_file *get_source_file () const;
-  virtual void new_input (string s, Sources *);
+  virtual void new_input (const string &s, Sources *);
 
-  void new_input (string name, string data, Sources *);
+  void new_input (const string &name, string data, Sources *);
 
   char const *here_str0 () const;
 };
index 2ae9f093eed3fa7d9cf580f25ac6e1c7825e346b..a11f8f8c1b25f787bd632aaa41bc7388eea3340f 100644 (file)
@@ -36,12 +36,12 @@ public:
   char const *end () const;
 
   void set (Source_file *, char const *, char const *);
-  void error (string) const;
-  void programming_error (string) const;
-  void non_fatal_error (string) const;
-  void warning (string) const;
-  void message (string) const;
-  void debug_output (string) const;
+  void error (const string&) const;
+  void programming_error (const string&) const;
+  void non_fatal_error (const string&) const;
+  void warning (const string&) const;
+  void message (const string&) const;
+  void debug_output (const string&) const;
   void set_spot (Input const &);
   void step_forward ();
   void set_location (Input const &, Input const &);
@@ -63,7 +63,7 @@ public:
   Input ();
 protected:
   string message_location () const;
-  string message_string (string msg) const;
+  string message_string (const string &msg) const;
 };
 
 #include "smobs.hh"
index c0df65849824051b13d50f5dcd3d9dc748abcfef..a273f5ac5d3da229e0cd49122edba438cddfabc5 100644 (file)
@@ -129,7 +129,7 @@ inline SCM ly_symbol2scm (char const *x) { return scm_from_locale_symbol ((x));
 
 string mangle_cxx_identifier (string);
 
-void ly_add_type_predicate (void *ptr, string name);
+void ly_add_type_predicate (void *ptr, const string &name);
 string predicate_to_typename (void *ptr);
 
 /*
@@ -159,8 +159,8 @@ string predicate_to_typename (void *ptr);
 #define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT)                      \
   MAKE_SCHEME_CALLBACK_WITH_OPTARGS(TYPE,FUNC,ARGCOUNT, 0, "");
 
-void ly_add_function_documentation (SCM proc, string fname, string varlist, string doc);
-void ly_check_name (string cxx, string fname);
+void ly_add_function_documentation (SCM proc, const string &fname, const string &varlist, const string &doc);
+void ly_check_name (const string &cxx, const string &fname);
 
 #define ADD_SCM_INIT_FUNC(name, func)           \
   class name ## _scm_initter                    \
index f2b8f08ba17bfa00fcae3aacf13035d68a30aa17..4592b2497db9321b5bac7a96829e49a272328031 100644 (file)
@@ -50,12 +50,12 @@ SCM ly_truncate_list (int k, SCM lst);
 
 extern SCM global_lily_module;
 
-string gulp_file_to_string (string fn, bool must_exist, int size);
+string gulp_file_to_string (const string &fn, bool must_exist, int size);
 
 SCM ly_string2scm (string const &s);
 string ly_scm2string (SCM s);
 string ly_symbol2string (SCM);
-string robust_symbol2string (SCM, string);
+string robust_symbol2string (SCM, const string&);
 Rational ly_scm2rational (SCM);
 SCM ly_rational2scm (Rational);
 SCM ly_offset2scm (Offset);
@@ -78,7 +78,7 @@ Drul_array<Real> robust_scm2drul (SCM, Drul_array<Real>);
 Drul_array<bool> robust_scm2booldrul (SCM, Drul_array<bool>);
 Interval robust_scm2interval (SCM, Drul_array<Real>);
 Offset robust_scm2offset (SCM, Offset);
-string robust_scm2string (SCM, string);
+string robust_scm2string (SCM, const string&);
 Rational robust_scm2rational (SCM, Rational);
 vector<Real> ly_scm2floatvector (SCM);
 SCM ly_floatvector2scm (vector<Real> v);
index c12fcedd5dc57903fcca9412bb262ebe729938c2..4bc4cbe887403eb685cecf84442c2f741ad0f7f7 100644 (file)
@@ -36,10 +36,10 @@ class Lily_lexer : public Includable_lexer
   DECLARE_SMOBS (Lily_lexer);
 
 private:
-  int lookup_keyword (string);
-  int scan_bare_word (string);
-  int scan_escaped_word (string);
-  int scan_shorthand (string);
+  int lookup_keyword (const string&);
+  int scan_bare_word (const string&);
+  int scan_escaped_word (const string&);
+  int scan_shorthand (const string&);
   int scan_scm_id (SCM);
   int identifier_type (SCM);
   char escaped_char (char) const;
@@ -87,12 +87,12 @@ public:
 
   void start_main_input ();
 
-  virtual void new_input (string s, Sources *);
-  virtual void new_input (string s, string d, Sources *);
+  virtual void new_input (const string &s, Sources *);
+  virtual void new_input (const string &s, string d, Sources *);
 
   bool top_input () { return include_stack_.size () < 2; }
   SCM keyword_list () const;
-  SCM lookup_identifier (string s);
+  SCM lookup_identifier (const string &s);
   SCM lookup_identifier_symbol (SCM s);
   void push_extra_token (int token_type, SCM scm = SCM_UNSPECIFIED);
   void push_chord_state (SCM alist);
index 5009e693e34af90dd52b49b92b00d5d5af32e546..3b4c757d657192a315e97bfa893b7591b583c2e9 100644 (file)
@@ -62,14 +62,14 @@ public:
   void clear ();
   void do_init_file ();
   SCM do_yyparse ();
-  void include_string (string ly_code);
-  void parse_file (string init, string name, string out_name);
-  void parse_string (string ly_code);
-  SCM parse_string_expression (string ly_code, string filename, int line);
-  void parser_error (string);
-  void parser_error (Input const &, string);
+  void include_string (const string &ly_code);
+  void parse_file (const string &init, const string &name, const string &out_name);
+  void parse_string (const string &ly_code);
+  SCM parse_string_expression (const string &ly_code, const string &filename, int line);
+  void parser_error (const string&);
+  void parser_error (Input const &, const string&);
   // The following is called as yyerror
-  static void parser_error (Input const *i, Lily_parser *parser, SCM *, string s);
+  static void parser_error (Input const *i, Lily_parser *parser, SCM *, const string &s);
   void set_yydebug (bool);
 
   SCM make_scope () const;
index 952b19b8e1f1c632d3f24576fca573f395f0826b..e79f01137af90f731856e813da91e4082c6a91a2 100644 (file)
@@ -25,7 +25,7 @@
 struct Lilypond_version
 {
   Lilypond_version (int major, int minor, int patch);
-  Lilypond_version (string str);
+  Lilypond_version (const string &str);
 
   string to_string () const;
   operator int () const;
index d73b6af790fd17b0e21f767c45e0581980de7c1c..c87adf6491a91c8a8ccbc4a0b041a2f06ca6f808 100644 (file)
@@ -43,7 +43,7 @@ public:
 class Midi_chunk
 {
 public:
-  void set (string header_string, string data_string, string footer_string);
+  void set (const string &header_string, const string &data_string, const string &footer_string);
   virtual string to_string () const;
   virtual string data_string () const;
   DECLARE_CLASSNAME (Midi_chunk);
index ee1534da07d73a43ebf79361f38dcab4637974e0..7ea838fdd0f845ebb50eb676c27b9c42031605e7 100644 (file)
@@ -29,10 +29,10 @@ using namespace std;
 
 struct Midi_stream
 {
-  Midi_stream (string file_name_string);
+  Midi_stream (const string &file_name_string);
   ~Midi_stream ();
 
-  void write (string);
+  void write (const string&);
   void write (Midi_chunk const &);
   void open ();
 
index 511fc0545f8fd51ca377551b8fe47bb7aa0801e1..9bba2d09e936bb2ef8499f48661b883a6c4fe03a 100644 (file)
@@ -64,7 +64,7 @@ Real directed_round (Real f, Direction d);
 Offset get_point_in_y_direction (Offset orig, Real slope, Real dist, Direction dir);
 Real peak_around (Real epsilon, Real threshold, Real x);
 Real convex_amplifier (Real standard_x, Real increase_factor, Real x);
-string camel_case_to_lisp_identifier (string in);
+string camel_case_to_lisp_identifier (const string &in);
 
 #endif
 
index 6bf2d8d6d0e9f9e3c4c61236c128f4918726fec4..40533cb3c3e36aeb608b6299fcb49e7969ba2f5f 100644 (file)
 struct Modified_font_metric : public Font_metric
 {
 public:
-  Stencil text_stencil (Output_def *output_state, string, bool) const;
+  Stencil text_stencil (Output_def *output_state, const string&, bool) const;
   Real get_magnification () const;
 
   static SCM make_scaled_font_metric (Font_metric *fm, Real magnification);
   size_t count () const;
   Offset get_indexed_wxwy (size_t) const;
-  Offset attachment_point (string) const;
+  Offset attachment_point (const string&) const;
   size_t name_to_index (string) const;
   size_t index_to_charcode (size_t) const;
   Font_metric *original_font () const;
index 532933b84b59b34cde0022e33c322fccbdcefcdc..6155dd7dc6513a4bf4cda1c759282dc38e24d2c1 100644 (file)
@@ -36,7 +36,7 @@ public:
   static Real stem_attachment_coordinate (Grob *, Axis a);
   static int get_balltype (Grob *);
 
-  static Offset get_stem_attachment (Font_metric *, string);
+  static Offset get_stem_attachment (Font_metric *, const string&);
 };
 #endif // NOTEHEAD_HH
 
index 00ca9addb94cdef67ffe1773c2b9ef3bffc15077..cb55e9744bc890842a0445bb221a66886e834f7c 100644 (file)
@@ -48,11 +48,11 @@ public:
   SCM glyph_list () const;
   SCM get_glyph_outline (size_t signed_idx) const;
   Box get_glyph_outline_bbox (size_t signed_idx) const;
-  string get_otf_table (string tag) const;
-  static SCM make_otf (string);
+  string get_otf_table (const string &tag) const;
+  static SCM make_otf (const string&);
   string font_name () const;
   ~Open_type_font ();
-  Offset attachment_point (string) const;
+  Offset attachment_point (const string&) const;
   size_t count () const;
   Box get_indexed_char_dimensions (size_t) const;
   Box get_unscaled_indexed_char_dimensions (size_t) const;
@@ -63,7 +63,7 @@ public:
   Real design_size () const;
 };
 
-string get_otf_table (FT_Face face, string tag);
-FT_Face open_ft_face (string str, FT_Long idx);
+string get_otf_table (FT_Face face, const string &tag);
+FT_Face open_ft_face (const string&, FT_Long idx);
 
 #endif /* OPEN_TYPE_FONT_HH */
index 3f44061513064044bf173a496e43c332ac8f8bcc..eff52c2c3845a7b3f47f85a42b2defcaf7595ed7 100644 (file)
@@ -65,7 +65,7 @@ public:
   /*
     variables.
    */
-  SCM c_variable (string id) const;
+  SCM c_variable (const string &id) const;
   SCM lookup_variable (SCM sym) const;
   void set_variable (SCM sym, SCM val);
   void normalize ();
index f57b5d5b762eb83a945c4599ec5a4338d5d7c5f5..ad559551d1fe9d6a7919c3da9d6841e70e07fde1 100644 (file)
@@ -48,7 +48,7 @@ public:
 
   string description_string () const;
   SCM font_file_name () const;
-  void register_font_file (string, string, int);
+  void register_font_file (const string &filename, const string &ps_name, int face_index);
 
   size_t name_to_index (string) const;
   SCM get_glyph_outline (size_t signed_idx) const;
@@ -59,7 +59,7 @@ public:
   Stencil pango_item_string_stencil (PangoGlyphItem const *) const;
 
   virtual Stencil text_stencil (Output_def *output_state,
-                                string text, bool music) const;
+                                const string &text, bool music) const;
   virtual void derived_mark () const;
 };
 
index 90500a9f6fe838ab509057a49143f3795cd84c25..02bc2746a2f841103bfae79194c81253f6ebc158 100644 (file)
@@ -40,7 +40,7 @@ public:
   DECLARE_SMOBS (Paper_outputter);
 
 public:
-  Paper_outputter (SCM port, string format);
+  Paper_outputter (SCM port, const string &format);
 
   void close ();
   SCM dump_string (SCM);
index 1a3e8a38d9928ea161112debe86754d3a69c6a8a..5fda3c73a7647d1a51e339932c35c1e28fbbfc41 100644 (file)
 
 #include "std-string.hh"
 
-void read_relocation_dir (string dirname);
-void read_relocation_file (string filename);
-string expand_environment_variables (string orig);
+void read_relocation_dir (const string &dirname);
+void read_relocation_file (const string &filename);
+string expand_environment_variables (const string &orig);
 
-int sane_putenv (char const *key, string value, bool overwrite);
+int sane_putenv (char const *key, const string &value, bool overwrite);
 void setup_paths (char const *argv0);
 extern bool relocate_binary;
 
index 9a0b811ed7c30e4dc73aaf5ba2eee579e6493874..d5dbae9e25791f385858ded77d6a146558ae98cc 100644 (file)
@@ -30,7 +30,7 @@ public:
   DECLARE_SCHEME_CALLBACK (y_offset_callback, (SCM));
   DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM));
   DECLARE_GROB_INTERFACE ();
-  static string glyph_name (Grob *, int, string, bool, Real);
+  static string glyph_name (Grob *, int durlog, const string &style, bool, Real);
   static Real staff_position_internal (Grob *, int /* duration_log */,
                                        int /* dir */);
   static SCM brew_internal_stencil (Grob *, bool);
index 48ec73644840e93d9f720439f4242482973caaa6..5114815619659f834461230d21512715fda383f1 100644 (file)
@@ -51,7 +51,7 @@ public:
 
   Real score () const { return score_; }
   string card () const { return score_card_; }
-  void add_score (Real, string);
+  void add_score (Real, const string&);
 
   void generate_curve (Slur_score_state const &state, Real r0, Real h_inf,
                        vector<Offset> const &);
index 0b0861775c767f2558e9ad53520d0fdda44da4a9..e27c96a759db69d3eca94da7761f347fd1ee7581 100644 (file)
@@ -57,8 +57,8 @@ protected:
   void stop_translation_timestep ();
   void process_music ();
 
-  bool can_create_slur (string, vsize, vsize *, Stream_event *);
-  void create_slur (string spanner_id, Stream_event *ev_cause, Grob *g_cause, Direction dir, bool left_broken);
+  bool can_create_slur (const string&, vsize, vsize *, Stream_event *);
+  void create_slur (const string &spanner_id, Stream_event *ev_cause, Grob *g_cause, Direction dir, bool left_broken);
   bool try_to_end (Stream_event *ev);
 
   virtual void set_melisma (bool);
index e4bdc3f63843ac97019412e11d9f328957de7a29..5f3553aea08c46e94a746ad410bfa3ec18d8d2e5 100644 (file)
@@ -48,8 +48,8 @@ class Source_file
 
   DECLARE_SMOBS (Source_file);
 public:
-  Source_file (string fn);
-  Source_file (string, string);
+  Source_file (const string &fn);
+  Source_file (const string&, const string&);
 
   char const *c_str () const;
   virtual string quote_input (char const *pos_str0) const;
@@ -73,7 +73,7 @@ protected:
   int line_offset_;
 };
 
-vector<char> gulp_file (string fn, int desired);
+vector<char> gulp_file (const string &fn, int desired);
 
 #endif /* SOURCE_FILE_HH */
 
index 32ffb45a955f1ec72a5cdf3d8dcd5680f7be191c..9da9e45a40a478aea507ac4eb7adaa6f1a7befc0 100644 (file)
@@ -46,7 +46,7 @@ public:
   /* computed. */
   Interval attachment_x_;
 
-  void add_score (Real, string);
+  void add_score (Real, const string&);
   Tie_configuration ();
   void center_tie_vertically (Tie_details const &);
   Bezier get_transformed_bezier (Tie_details const &) const;
@@ -72,8 +72,8 @@ class Ties_configuration : public vector<Tie_configuration>
   friend class Tie_formatting_problem;
 public:
   Ties_configuration ();
-  void add_score (Real amount, string description);
-  void add_tie_score (Real amount, int i, string description);
+  void add_score (Real amount, const string &description);
+  void add_tie_score (Real amount, int i, const string &description);
   Real score () const;
   void reset_score ();
   string card () const;
index bc1e79b373554cc5dd2b720ddf444ddd4610a701..a091ef9855c72111c069d77d4931599bc3df9e83 100644 (file)
@@ -79,7 +79,7 @@ Input::set_location (Input const &i_start, Input const &i_end)
   [file:line:column:][warning:]message
 */
 string
-Input::message_string (string msg) const
+Input::message_string (const string &msg) const
 {
   if (source_file_)
     return msg + "\n" + source_file_->quote_input (start_);
@@ -93,7 +93,7 @@ Input::message_location () const
   return (source_file_) ? location_string () : "";
 }
 void
-Input::error (string s) const
+Input::error (const string &s) const
 {
   ::non_fatal_error (message_string (s), message_location ());
   // UGH, fix naming or usage (use non_fatal_error in most places, instead)
@@ -101,31 +101,31 @@ Input::error (string s) const
 }
 
 void
-Input::programming_error (string s) const
+Input::programming_error (const string &s) const
 {
   ::programming_error (message_string (s), message_location ());
 }
 
 void
-Input::non_fatal_error (string s) const
+Input::non_fatal_error (const string &s) const
 {
   ::non_fatal_error (message_string (s), message_location ());
 }
 
 void
-Input::warning (string s) const
+Input::warning (const string &s) const
 {
   ::warning (message_string (s), message_location ());
 }
 
 void
-Input::message (string s) const
+Input::message (const string &s) const
 {
   ::message (message_string (s), true, message_location ());
 }
 
 void
-Input::debug_output (string s) const
+Input::debug_output (const string &s) const
 {
   ::debug_output (message_string (s), true, message_location ());
 }
index 50b79a848810b57e7500764ae22029b11799ddce..18b999da82f20f2a3045f796b37322ff5fd3d65d 100644 (file)
@@ -907,7 +907,7 @@ Lily_lexer::identifier_type (SCM sid)
 
 
 int
-Lily_lexer::scan_escaped_word (string str)
+Lily_lexer::scan_escaped_word (const string &str)
 {
        // use more SCM for this.
 
@@ -937,7 +937,7 @@ Lily_lexer::scan_escaped_word (string str)
 }
 
 int
-Lily_lexer::scan_shorthand (string str)
+Lily_lexer::scan_shorthand (const string &str)
 {
        SCM sid = lookup_identifier (str);
        if (Music *m = unsmob_music (sid))
@@ -1014,7 +1014,7 @@ Lily_lexer::scan_scm_id (SCM sid)
 }
 
 int
-Lily_lexer::scan_bare_word (string str)
+Lily_lexer::scan_bare_word (const string &str)
 {
        SCM sym = ly_symbol2scm (str.c_str ());
        if ((YYSTATE == notes) || (YYSTATE == chords)) {
index 5e3b1c0f697ed6bcdda79e01ee761849163028b2..06018c4c9c48502dde6b90eedd16fd05c17c6acf 100644 (file)
@@ -75,13 +75,13 @@ ly_symbol2string (SCM s)
 }
 
 string
-robust_symbol2string (SCM sym, string str)
+robust_symbol2string (SCM sym, const string &str)
 {
   return scm_is_symbol (sym) ? ly_symbol2string (sym) : str;
 }
 
 string
-gulp_file_to_string (string fn, bool must_exist, int size)
+gulp_file_to_string (const string &fn, bool must_exist, int size)
 {
   string s = global_path.find (fn);
   if (s == "")
@@ -554,10 +554,10 @@ ly_floatvector2scm (vector<Real> v)
 }
 
 string
-robust_scm2string (SCM k, string s)
+robust_scm2string (SCM k, const string &s)
 {
   if (scm_is_string (k))
-    s = ly_scm2string (k);
+    return ly_scm2string (k);
   return s;
 }
 
index c196808a2fef49b9a3c62ec0cafd964477021bfe..c72ff8fc129eca056015f930b7a94c02d528902a 100644 (file)
@@ -178,7 +178,7 @@ Lily_lexer::set_current_scope ()
 }
 
 int
-Lily_lexer::lookup_keyword (string s)
+Lily_lexer::lookup_keyword (const string &s)
 {
   return keytable_->lookup (s.c_str ());
 }
@@ -217,7 +217,7 @@ Lily_lexer::lookup_identifier_symbol (SCM sym)
 }
 
 SCM
-Lily_lexer::lookup_identifier (string name)
+Lily_lexer::lookup_identifier (const string &name)
 {
   return lookup_identifier_symbol (ly_symbol2scm (name.c_str ()));
 }
@@ -236,13 +236,13 @@ Lily_lexer::start_main_input ()
 }
 
 void
-Lily_lexer::new_input (string str, string d, Sources *ss)
+Lily_lexer::new_input (const string &str, string d, Sources *ss)
 {
   Includable_lexer::new_input (str, d, ss);
 }
 
 void
-Lily_lexer::new_input (string str, Sources *ss)
+Lily_lexer::new_input (const string &str, Sources *ss)
 {
   if (is_main_input_ && be_safe_global)
     {
index 1b78abaed0588debaf4adb9769ed328ce70e88d5..cd7819e9c8d5f6823592e310783025ed15933280 100644 (file)
@@ -97,7 +97,7 @@ Lily_parser::print_smob (SCM s, SCM port, scm_print_state *)
 
 /* Process one .ly file, or book.  */
 void
-Lily_parser::parse_file (string init, string name, string out_name)
+Lily_parser::parse_file (const string &init, const string &name, const string &out_name)
 {
   lexer_->set_identifier (ly_symbol2scm ("parser"), self_scm ());
   output_basename_ = out_name;
@@ -139,7 +139,7 @@ Lily_parser::parse_file (string init, string name, string out_name)
 }
 
 void
-Lily_parser::parse_string (string ly_code)
+Lily_parser::parse_string (const string &ly_code)
 {
   lexer_->main_input_name_ = "<string>";
   lexer_->new_input (lexer_->main_input_name_, ly_code, sources_);
@@ -155,7 +155,7 @@ Lily_parser::parse_string (string ly_code)
 }
 
 SCM
-Lily_parser::parse_string_expression (string ly_code, string filename,
+Lily_parser::parse_string_expression (const string &ly_code, const string &filename,
                                       int line)
 {
   lexer_->main_input_name_ = filename;
@@ -178,7 +178,7 @@ Lily_parser::parse_string_expression (string ly_code, string filename,
 }
 
 void
-Lily_parser::include_string (string ly_code)
+Lily_parser::include_string (const string &ly_code)
 {
   lexer_->new_input ("<included string>", ly_code, sources_);
 }
@@ -202,14 +202,14 @@ Lily_parser::here_str0 () const
 }
 
 void
-Lily_parser::parser_error (string s)
+Lily_parser::parser_error (const string &s)
 {
   lexer_->here_input ().error (_ (s.c_str ()));
   error_level_ = 1;
 }
 
 void
-Lily_parser::parser_error (Input const &i, string s)
+Lily_parser::parser_error (Input const &i, const string &s)
 {
   i.error (s);
   error_level_ = 1;
index 28bb08d76152cca62c7d50a10c0cd1b8ad19f111..9c6d2130a331dd5f2599bbcae66090f501cf7ac7 100644 (file)
@@ -30,7 +30,7 @@ Lilypond_version::Lilypond_version (int major, int minor, int patch)
   patch_ = patch;
 }
 
-Lilypond_version::Lilypond_version (string str)
+Lilypond_version::Lilypond_version (const string &str)
 {
   major_ = 0;
   minor_ = 0;
index 18adbb2cb731ee16922ab0731aeae2282dd5a1b1..5ac75067a070ad4db7a2fd71863e5426ccd291e5 100644 (file)
@@ -334,7 +334,7 @@ warranty ()
 }
 
 static void
-prepend_scheme_list (string dir, string scmlist)
+prepend_scheme_list (const string &dir, const string &scmlist)
 /*
  *  Inserts an item at the front of a Scheme list, e.g. %load-path
  *  Parameters:
@@ -563,7 +563,7 @@ setup_localisation ()
 }
 
 static void
-add_output_format (string format)
+add_output_format (const string &format)
 /*
  * Capture information internally from command-line options
  * re output format.
index 699ec7e89876049d379858b5dd287118f4266271..f98c76373e9728e68c66863a7008c20e7c548d74 100644 (file)
@@ -181,7 +181,7 @@ Midi_chunk::~Midi_chunk ()
 }
 
 void
-Midi_chunk::set (string header_string, string data_string, string footer_string)
+Midi_chunk::set (const string &header_string, const string &data_string, const string &footer_string)
 {
   data_string_ = data_string;
   footer_string_ = footer_string;
index 2d9429c76753c98a8b31bd4161eaa67947b142e7..289bb1494a3b52091a7871d71eebcb4600d2b336 100644 (file)
@@ -30,7 +30,7 @@ using namespace std;
 #include "string-convert.hh"
 #include "warn.hh"
 
-Midi_stream::Midi_stream (string file_name)
+Midi_stream::Midi_stream (const string &file_name)
 {
   file_name_string_ = file_name;
   out_file_ = fopen (file_name.c_str (), "wb");
@@ -44,7 +44,7 @@ Midi_stream::~Midi_stream ()
 }
 
 void
-Midi_stream::write (string str)
+Midi_stream::write (const string &str)
 {
   size_t sz = sizeof (Byte);
   size_t n = str.length ();
index f90d641a6040fc3c047d67c9609dfb65860a19b3..58d0a6e9d301af63baead8b7e8f96d2f7cb0d0ff 100644 (file)
@@ -78,7 +78,7 @@ convex_amplifier (Real standard_x, Real increase_factor, Real x)
 }
 
 string
-camel_case_to_lisp_identifier (string in)
+camel_case_to_lisp_identifier (const string &in)
 {
   vector<char> out;
 
@@ -113,4 +113,4 @@ get_point_in_y_direction (Offset orig, Real slope, Real dist, Direction dir)
   complex<Real> res = orig_c + to_move;
 
   return Offset (real (res), imag (res));
-}
\ No newline at end of file
+}
index 7a54948fed13a96882fc40d0567cd34de9708d09..1657cf5a9e68722954d8d67f6c4c4661b0206a35 100644 (file)
@@ -74,7 +74,7 @@ Modified_font_metric::count () const
 }
 
 Offset
-Modified_font_metric::attachment_point (string s) const
+Modified_font_metric::attachment_point (const string &s) const
 {
   Offset o = orig_->attachment_point (s);
   return o * magnification_;
@@ -87,7 +87,7 @@ Modified_font_metric::get_indexed_wxwy (vsize k) const
   return o * magnification_;
 }
 
-vsize
+size_t
 Modified_font_metric::name_to_index (string s) const
 {
   return orig_->name_to_index (s);
@@ -106,7 +106,7 @@ Modified_font_metric::derived_mark () const
 
 Stencil
 Modified_font_metric::text_stencil (Output_def *state,
-                                    string text, bool feta) const
+                                    const string &text, bool feta) const
 {
   Box b;
   if (Pango_font *pf = dynamic_cast<Pango_font *> (orig_))
index 287b10dc043a42ce8ebe613422a8c51fe916874b..4bf8168eb1092c4fe34b147bbfc5d17e318774fa 100644 (file)
@@ -162,7 +162,7 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a)
 }
 
 Offset
-Note_head::get_stem_attachment (Font_metric *fm, string key)
+Note_head::get_stem_attachment (Font_metric *fm, const string &key)
 {
   Offset att;
 
index 680dfe92348f364f5cc154772220556dc17003a7..df6a744d0e42165e6d31837d1b474c16b78c8fc9 100644 (file)
@@ -59,7 +59,7 @@ load_table (char const *tag_str, FT_Face face, FT_ULong *length)
 }
 
 string
-Open_type_font::get_otf_table (string tag) const
+Open_type_font::get_otf_table (const string &tag) const
 {
   return ::get_otf_table (face_, tag);
 }
@@ -91,7 +91,7 @@ Open_type_font::~Open_type_font ()
   UGH fix naming
 */
 string
-get_otf_table (FT_Face face, string tag)
+get_otf_table (FT_Face face, const string &tag)
 {
   FT_ULong len;
   FT_Byte *tab = load_table (tag.c_str (), face, &len);
@@ -102,7 +102,7 @@ get_otf_table (FT_Face face, string tag)
 }
 
 FT_Face
-open_ft_face (string str, FT_Long idx)
+open_ft_face (const string &str, FT_Long idx)
 {
   FT_Face face;
   FT_Error error_code = FT_New_Face (freetype2_library, str.c_str (), idx, &face);
@@ -117,7 +117,7 @@ open_ft_face (string str, FT_Long idx)
 }
 
 SCM
-Open_type_font::make_otf (string str)
+Open_type_font::make_otf (const string &str)
 {
   FT_Face face = open_ft_face (str, 0 /* index */);
   Open_type_font *otf = new Open_type_font (face);
@@ -151,7 +151,7 @@ Open_type_font::derived_mark () const
 }
 
 Offset
-Open_type_font::attachment_point (string glyph_name) const
+Open_type_font::attachment_point (const string &glyph_name) const
 {
   SCM sym = ly_symbol2scm (glyph_name.c_str ());
   SCM entry = scm_hashq_ref (lily_character_table_, sym, SCM_BOOL_F);
index e425dbf4f93cd2dba5fc03172017a02f04ff63b4..addb0ef1ef57f5ee858b3e0a8804da09ace1fbc0 100644 (file)
@@ -129,7 +129,7 @@ Output_def::lookup_variable (SCM sym) const
 }
 
 SCM
-Output_def::c_variable (string s) const
+Output_def::c_variable (const string &s) const
 {
   return lookup_variable (ly_symbol2scm (s.c_str ()));
 }
index e4a07a9fd5ca8bd719c83f4bd084dc442998650e..ee986fc94d76a653256212c0a7e9ab7d80517bbc 100644 (file)
@@ -81,8 +81,8 @@ Pango_font::~Pango_font ()
 }
 
 void
-Pango_font::register_font_file (string filename,
-                                string ps_name,
+Pango_font::register_font_file (const string &filename,
+                                const string &ps_name,
                                 int face_index)
 {
   scm_hash_set_x (physical_font_tab_,
@@ -383,7 +383,7 @@ extern bool music_strings_to_paths;
 
 Stencil
 Pango_font::text_stencil (Output_def * /* state */,
-                          string str, bool music_string) const
+                          const string &str, bool music_string) const
 {
   /*
     The text assigned to a PangoLayout is automatically divided
index 06b490472c7b5a2ef9e378dbcfa87e07afc75da3..34110554dc3b6b2514d5bbcb1ddaa195e07bab92 100644 (file)
@@ -40,7 +40,7 @@ using namespace std;
 
 #include "ly-smobs.icc"
 
-Paper_outputter::Paper_outputter (SCM port, string format)
+Paper_outputter::Paper_outputter (SCM port, const string &format)
 {
   file_ = port;
   output_module_ = SCM_EOL;
index a1e1a9f080704571d1b9568ea5a91581726c605e..9752da58ed13a1c7ae4819ab647a3ecea02becca 100644 (file)
@@ -157,7 +157,7 @@ using namespace std;
 #include "warn.hh"
 
 void
-Lily_parser::parser_error (Input const *i, Lily_parser *parser, SCM *, string s)
+Lily_parser::parser_error (Input const *i, Lily_parser *parser, SCM *, const string &s)
 {
        parser->parser_error (*i, s);
 }
index 7408106d8bb8fce3c9c00e086ef768010d754985..3a13f03701f421397feec39a723942cea8c1d0c4 100644 (file)
@@ -42,7 +42,7 @@
 #define FRAMEWORKDIR ".."
 
 int
-sane_putenv (char const *key, string value, bool overwrite)
+sane_putenv (char const *key, const string &value, bool overwrite)
 {
   if (overwrite || !getenv (key))
     {
@@ -64,7 +64,7 @@ sane_putenv (char const *key, string value, bool overwrite)
 }
 
 static int
-set_env_file (char const *key, string value, bool overwrite = false)
+set_env_file (char const *key, const string &value, bool overwrite = false)
 {
   if (is_file (value))
     return sane_putenv (key, value, overwrite);
@@ -75,7 +75,7 @@ set_env_file (char const *key, string value, bool overwrite = false)
 }
 
 static int
-set_env_dir (char const *key, string value)
+set_env_dir (char const *key, const string &value)
 {
   if (is_dir (value))
     return sane_putenv (key, value, false);
@@ -108,7 +108,7 @@ prepend_env_path (char const *key, string value)
 #endif
 
 static void
-prefix_relocation (string prefix)
+prefix_relocation (const string &prefix)
 {
   string bindir = prefix + "/bin";
   string datadir = prefix + "/share";
@@ -141,7 +141,7 @@ prefix_relocation (string prefix)
 */
 
 static void
-framework_relocation (string prefix)
+framework_relocation (const string &prefix)
 {
   debug_output (_f ("Relocation: framework_prefix=%s", prefix));
 
@@ -257,7 +257,7 @@ setup_paths (char const *argv0_ptr)
 }
 
 string
-expand_environment_variables (string orig)
+expand_environment_variables (const string &orig)
 {
   char const *start_ptr = orig.c_str ();
   char const *ptr = orig.c_str ();
@@ -340,7 +340,7 @@ read_line (FILE *f)
 }
 
 void
-read_relocation_file (string filename)
+read_relocation_file (const string &filename)
 {
   debug_output (_f ("Relocation file: %s", filename.c_str ()) + "\n");
   char const *cname = filename.c_str ();
@@ -383,7 +383,7 @@ read_relocation_file (string filename)
 }
 
 void
-read_relocation_dir (string dirname)
+read_relocation_dir (const string &dirname)
 {
   if (DIR *dir = opendir (dirname.c_str ()))
     while (struct dirent *ent = readdir (dir))
index bf6f43758b0e764d1e0766e6f6548c97e92d454a..c4c5de1e73a19f5e1cadc839f2d7f70d0a63efc4 100644 (file)
@@ -159,7 +159,7 @@ Rest::calc_cross_staff (SCM smob)
   make this function easily usable in C++
 */
 string
-Rest::glyph_name (Grob *me, int durlog, string style, bool try_ledgers,
+Rest::glyph_name (Grob *me, int durlog, const string &style, bool try_ledgers,
                   Real offset)
 {
   bool is_ledgered = false;
index b144b2656ff927aeb5a51f506e631b98cf441499..332995ac99ef051d760cf1a786080a16f8bf6314 100644 (file)
@@ -187,7 +187,7 @@ Slur_configuration::Slur_configuration ()
 };
 
 void
-Slur_configuration::add_score (Real s, string desc)
+Slur_configuration::add_score (Real s, const string &desc)
 {
   if (s < 0)
     {
index fbc5f00b844ae5488b6bfb889548e42c01d143fc..f2e345691354d291a77c0f9562f0bfaf04b889e0 100644 (file)
@@ -123,7 +123,7 @@ Slur_proto_engraver::finalize ()
 }
 
 void
-Slur_proto_engraver::create_slur (string spanner_id, Stream_event *ev_cause, Grob *g_cause, Direction dir, bool left_broken)
+Slur_proto_engraver::create_slur (const string &spanner_id, Stream_event *ev_cause, Grob *g_cause, Direction dir, bool left_broken)
 {
   Grob *ccc = unsmob_grob (get_property ("currentCommandColumn"));
   SCM cause = ev_cause ? ev_cause->self_scm () : g_cause->self_scm ();
@@ -149,7 +149,7 @@ Slur_proto_engraver::create_slur (string spanner_id, Stream_event *ev_cause, Gro
 }
 
 bool
-Slur_proto_engraver::can_create_slur (string id, vsize old_slurs, vsize *event_idx, Stream_event *ev)
+Slur_proto_engraver::can_create_slur (const string &id, vsize old_slurs, vsize *event_idx, Stream_event *ev)
 {
   for (vsize j = slurs_.size (); j--;)
     {
index 6ecedc9854f1880df2106802053df8dfa0aadb92..26426ae8af1e80824e2626f41c1ff1449e134d99 100644 (file)
@@ -55,7 +55,7 @@ Source_file::load_stdin ()
   return contents of FILENAME. *Not 0-terminated!*
  */
 vector<char>
-gulp_file (string filename, int desired_size)
+gulp_file (const string &filename, int desired_size)
 {
   /* "b" must ensure to open literally, avoiding text (CR/LF)
      conversions.  */
@@ -106,7 +106,7 @@ Source_file::init ()
   smobify_self ();
 }
 
-Source_file::Source_file (string filename, string data)
+Source_file::Source_file (const string &filename, const string &data)
 {
   init ();
 
@@ -124,7 +124,7 @@ Source_file::Source_file (string filename, string data)
       newline_locations_.push_back (&characters_[0] + i);
 }
 
-Source_file::Source_file (string filename_string)
+Source_file::Source_file (const string &filename_string)
 {
   init ();
 
index 31f3af6176ef91189a924c449e0fb3d7e57b4eb1..c06ad9b72189a6416b93848c7f70f9b353071de1 100644 (file)
@@ -46,12 +46,12 @@ protected:
 
 private:
   string new_instrument_string ();
-  void set_instrument_name (string voice);
-  void set_instrument (int channel, string voice);
-  int get_channel (string instrument);
-  Audio_staff *get_audio_staff (string voice);
-  Audio_staff *new_audio_staff (string voice);
-  Audio_dynamic *get_dynamic (string voice);
+  void set_instrument_name (const string &voice);
+  void set_instrument (int channel, const string &voice);
+  int get_channel (const string &instrument);
+  Audio_staff *get_audio_staff (const string &voice);
+  Audio_staff *new_audio_staff (const string &voice);
+  Audio_dynamic *get_dynamic (const string &voice);
 
   string instrument_string_;
   int channel_;
@@ -111,7 +111,7 @@ Staff_performer::initialize ()
 }
 
 Audio_staff *
-Staff_performer::new_audio_staff (string voice)
+Staff_performer::new_audio_staff (const string &voice)
 {
   Audio_staff *audio_staff = new Audio_staff;
   audio_staff->merge_unisons_
@@ -132,7 +132,7 @@ Staff_performer::new_audio_staff (string voice)
 }
 
 Audio_staff *
-Staff_performer::get_audio_staff (string voice)
+Staff_performer::get_audio_staff (const string &voice)
 {
   SCM channel_mapping = get_property ("midiChannelMapping");
   if (channel_mapping != ly_symbol2scm ("instrument")
@@ -152,7 +152,7 @@ Staff_performer::get_audio_staff (string voice)
 }
 
 Audio_dynamic *
-Staff_performer::get_dynamic (string voice)
+Staff_performer::get_dynamic (const string &voice)
 {
   map<string, Audio_dynamic *>::const_iterator i = dynamic_map_.find (voice);
   if (i != dynamic_map_.end ())
@@ -166,7 +166,7 @@ Staff_performer::process_music ()
 }
 
 void
-Staff_performer::set_instrument (int channel, string voice)
+Staff_performer::set_instrument (int channel, const string &voice)
 {
   instrument_ = new Audio_instrument (instrument_string_);
   instrument_->channel_ = channel;
@@ -179,7 +179,7 @@ Staff_performer::set_instrument (int channel, string voice)
 }
 
 void
-Staff_performer::set_instrument_name (string voice)
+Staff_performer::set_instrument_name (const string &voice)
 {
   instrument_name_ = new Audio_text (Audio_text::INSTRUMENT_NAME,
                                      instrument_string_);
@@ -242,7 +242,7 @@ Staff_performer::new_instrument_string ()
 }
 
 int
-Staff_performer::get_channel (string instrument)
+Staff_performer::get_channel (const string &instrument)
 {
   SCM channel_mapping = get_property ("midiChannelMapping");
   map<string, int> &channel_map
index 79992fb80885cdb87347faf4991a5e43c44aa1b4..19bcbd822c250df3a3a9862d30a5010c58dad213 100644 (file)
@@ -102,7 +102,7 @@ Tie_configuration::distance (Tie_configuration const &a,
 }
 
 void
-Tie_configuration::add_score (Real s, string desc)
+Tie_configuration::add_score (Real s, const string &desc)
 {
   assert (!scored_);
   score_ += s;
@@ -136,7 +136,7 @@ Ties_configuration::reset_score ()
 }
 
 void
-Ties_configuration::add_tie_score (Real s, int i, string desc)
+Ties_configuration::add_tie_score (Real s, int i, const string &desc)
 {
   assert (!scored_);
   score_ += s;
@@ -150,7 +150,7 @@ Ties_configuration::add_tie_score (Real s, int i, string desc)
 }
 
 void
-Ties_configuration::add_score (Real s, string desc)
+Ties_configuration::add_score (Real s, const string &desc)
 {
   assert (!scored_);
   score_ += s;
index be7cfe543cc170ec6674ba7f27a901b12dff0d20..eaeb67adfb25a46b9dfbd16858a4abd0d1e755b4 100644 (file)
@@ -467,7 +467,7 @@ print_trailer (void *out,
 }
 
 static void
-create_type42_font (void *out, string name, int idx)
+create_type42_font (void *out, const string &name, int idx)
 {
   FT_Face face;