X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fsource-file.cc;h=90bc5fcabde4a01ecfd8d0e6a55e09d8aa1621f5;hb=024e51d1cb0e21d211baf91ad0774bc766dff687;hp=57d67b464b6e16b83d14ca454b841197ba2bcacc;hpb=940328e9523c8af21ba16ebc1bc95b37aa1fddcc;p=lilypond.git diff --git a/lily/source-file.cc b/lily/source-file.cc index 57d67b464b..90bc5fcabd 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2006 Jan Nieuwenhuizen + (c) 1997--2007 Jan Nieuwenhuizen Han-Wen Nienhuys */ @@ -51,7 +51,7 @@ gulp_file (string filename, int desired_size) FILE *f = fopen (filename.c_str (), "rb"); if (!f) { - warning (_f ("can't open file: `%s'", filename.c_str ())); + warning (_f ("cannot open file: `%s'", filename.c_str ())); vector cxx_arr; return cxx_arr; @@ -138,9 +138,9 @@ Source_file::Source_file (string filename_string) void Source_file::init_port () { - SCM str = scm_makfrom0str (c_str ()); + SCM str = scm_from_locale_string (c_str ()); str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, __FUNCTION__); - scm_set_port_filename_x (str_port_, scm_makfrom0str (name_.c_str ())); + scm_set_port_filename_x (str_port_, ly_string2scm (name_)); } @@ -188,7 +188,7 @@ Source_file::quote_input (char const *pos_str0) const string context = line.substr (0, ch) + to_string ('\n') + to_string (' ', col) - + line.substr (ch, line.length()-ch); + + line.substr (ch, line.length ()-ch); return context; } @@ -277,12 +277,11 @@ Source_file::get_counts (char const *pos_str0, while (left > 0) { - wchar_t multibyte[2]; - /* FIXME, this is apparently locale dependent. */ #if HAVE_MBRTOWC + wchar_t multibyte[2]; size_t thislen = mbrtowc (multibyte, line_chars, left, &state); #else size_t thislen = 1; @@ -366,9 +365,9 @@ Source_file::get_port () const #include "ly-smobs.icc" -IMPLEMENT_SMOBS(Source_file); -IMPLEMENT_DEFAULT_EQUAL_P(Source_file); -IMPLEMENT_TYPE_P(Source_file, "ly:source-file?"); +IMPLEMENT_SMOBS (Source_file); +IMPLEMENT_DEFAULT_EQUAL_P (Source_file); +IMPLEMENT_TYPE_P (Source_file, "ly:source-file?"); SCM Source_file::mark_smob (SCM smob)