From 74fde288702efc2562b08a0edd9c05f5bfa1250a Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 23 Dec 2006 10:24:41 +0100 Subject: [PATCH] More "cannot oopses: _i and _f. --- lily/change-iterator.cc | 4 ++-- lily/context.cc | 6 +++--- lily/includable-lexer.cc | 2 +- lily/lily-guile.cc | 4 ++-- lily/lily-parser-scheme.cc | 4 ++-- lily/main.cc | 12 ++++++------ lily/midi-stream.cc | 2 +- lily/open-type-font.cc | 4 ++-- lily/piano-pedal-engraver.cc | 6 +++--- lily/piano-pedal-performer.cc | 2 +- lily/relocate.cc | 2 +- lily/source-file.cc | 2 +- lily/translator-group.cc | 2 +- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/lily/change-iterator.cc b/lily/change-iterator.cc index 6ff0cd6482..8b8f191006 100644 --- a/lily/change-iterator.cc +++ b/lily/change-iterator.cc @@ -20,7 +20,7 @@ Change_iterator::error (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")); - string warn1 = _f (cannot change `%s' to `%s'", to_type, to_id) + string warn1 = _f ("cannot change `%s' to `%s'", to_type, to_id) + ": " + reason; /* @@ -58,7 +58,7 @@ Change_iterator::process (Moment m) if (current && current->id_string () == to_id) { string msg; - msg += _f (cannot change, already in translator: %s", to_id); + msg += _f ("cannot change, already in translator: %s", to_id); } if (current) diff --git a/lily/context.cc b/lily/context.cc index bd999dea67..45a1562b1f 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -148,7 +148,7 @@ Context::create_unique_context (SCM name, string id, SCM operations) ret = daddy_context_->create_unique_context (name, id, operations); else { - warning (_f (cannot find or create new `%s'", + warning (_f ("cannot find or create new `%s'", ly_symbol2string (name).c_str ())); ret = 0; } @@ -210,7 +210,7 @@ Context::find_create_context (SCM n, string id, SCM operations) ret = daddy_context_->find_create_context (n, id, operations); else { - warning (_f (cannot find or create `%s' called `%s'", + warning (_f ("cannot find or create `%s' called `%s'", ly_symbol2string (n).c_str (), id)); ret = 0; } @@ -385,7 +385,7 @@ Context::get_default_interpreter () Context_def *t = unsmob_context_def (st); if (!t) { - warning (_f (cannot find or create: `%s'", name.c_str ())); + warning (_f ("cannot find or create: `%s'", name.c_str ())); t = unsmob_context_def (this->definition_); } diff --git a/lily/includable-lexer.cc b/lily/includable-lexer.cc index 777615e970..65bea4d00b 100644 --- a/lily/includable-lexer.cc +++ b/lily/includable-lexer.cc @@ -57,7 +57,7 @@ Includable_lexer::new_input (string name, Sources *sources) Source_file *file = sources->get_file (&name); if (!file) { - string msg = _f (cannot find file: `%s'", name); + string msg = _f ("cannot find file: `%s'", name); msg += "\n"; msg += _f ("(search path: `%s')", sources->path_->to_string ().c_str ()); diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 78fa3af5a4..cbd7903ba7 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -91,7 +91,7 @@ gulp_file_to_string (string fn, bool must_exist, int size) { if (must_exist) { - string e = _f (cannot find file: `%s'", fn); + string e = _f ("cannot find file: `%s'", fn); e += " "; e += _f ("(load path: `%s')", global_path.to_string ()); error (e); @@ -456,7 +456,7 @@ type_check_assignment (SCM sym, SCM val, SCM type_symbol) if (type != SCM_EOL && !ly_is_procedure (type)) { - warning (_f (cannot find property type-check for `%s' (%s).", + warning (_f ("cannot find property type-check for `%s' (%s).", ly_symbol2string (sym).c_str (), ly_symbol2string (type_symbol).c_str ()) + " " + _ ("perhaps a typing error?")); diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index dd47058451..85bf14be91 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -103,7 +103,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", if (init.length () && global_path.find (init).empty ()) { - warning (_f (cannot find init file: `%s'", init)); + warning (_f ("cannot find init file: `%s'", init)); warning (_f ("(search path: `%s')", global_path.to_string ().c_str ())); exit (2); @@ -113,7 +113,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", bool error = false; if ((file_name != "-") && file_name.empty ()) { - warning (_f (cannot find file: `%s'", file)); + warning (_f ("cannot find file: `%s'", file)); error = true; } else diff --git a/lily/main.cc b/lily/main.cc index 63f4a24263..410a749758 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -320,7 +320,7 @@ do_chroot_jail () if (errno == 0) error (_f ("no such user: %s", components[USER_NAME])); else - error (_f (cannot get user id from user name: %s: %s", + error (_f ("cannot get user id from user name: %s: %s", components[USER_NAME], strerror (errno))); exit (3); @@ -337,7 +337,7 @@ do_chroot_jail () if (errno == 0) error (_f ("no such group: %s", components[GROUP_NAME])); else - error (_f (cannot get group id from group name: %s: %s", + error (_f ("cannot get group id from group name: %s: %s", components[GROUP_NAME], strerror (errno))); exit (3); @@ -345,26 +345,26 @@ do_chroot_jail () if (chroot (components[JAIL].c_str ())) { - error (_f (cannot chroot to: %s: %s", components[JAIL], + error (_f ("cannot chroot to: %s: %s", components[JAIL], strerror (errno))); exit (3); } if (setgid (gid)) { - error (_f (cannot change group id to: %d: %s", gid, strerror (errno))); + error (_f ("cannot change group id to: %d: %s", gid, strerror (errno))); exit (3); } if (setuid (uid)) { - error (_f (cannot change user id to: %d: %s", uid, strerror (errno))); + error (_f ("cannot change user id to: %d: %s", uid, strerror (errno))); exit (3); } if (chdir (components[DIR].c_str ())) { - error (_f (cannot change working directory to: %s: %s", components[DIR], + error (_f ("cannot change working directory to: %s: %s", components[DIR], strerror (errno))); exit (3); } diff --git a/lily/midi-stream.cc b/lily/midi-stream.cc index f90688c2ab..b5d02f8400 100644 --- a/lily/midi-stream.cc +++ b/lily/midi-stream.cc @@ -25,7 +25,7 @@ Midi_stream::Midi_stream (string file_name) file_name_string_ = file_name; out_file_ = fopen (file_name.c_str (), "wb"); if (!out_file_) - error (_f (cannot open for write: %s: %s", file_name, strerror (errno))); + error (_f ("cannot open for write: %s: %s", file_name, strerror (errno))); } Midi_stream::~Midi_stream () diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index d47d7944e8..2f2e5fdaad 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -30,11 +30,11 @@ load_table (char const *tag_str, FT_Face face, FT_ULong *length) { FT_Byte *buffer = (FT_Byte *) malloc (*length); if (buffer == NULL) - error (_f (cannot allocate %lu bytes", *length)); + error (_f ("cannot allocate %lu bytes", *length)); error_code = FT_Load_Sfnt_Table (face, tag, 0, buffer, length); if (error_code) - error (_f (cannot load font table: %s", tag_str)); + error (_f ("cannot load font table: %s", tag_str)); return buffer; } diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index 353ea91d56..debc884360 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -298,7 +298,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed) if (!mixed) { if (!p->start_ev_) - p->event_drul_[STOP]->origin ()->warning (_f (cannot find start of piano pedal: `%s'", p->type_->base_name_.c_str ())); + p->event_drul_[STOP]->origin ()->warning (_f ("cannot find start of piano pedal: `%s'", p->type_->base_name_.c_str ())); else s = scm_cadr (strings); p->start_ev_ = p->event_drul_[START]; @@ -309,7 +309,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed) if (!mixed) { if (!p->start_ev_) - p->event_drul_[STOP]->origin ()->warning (_f (cannot find start of piano pedal: `%s'", p->type_->base_name_.c_str ())); + p->event_drul_[STOP]->origin ()->warning (_f ("cannot find start of piano pedal: `%s'", p->type_->base_name_.c_str ())); else s = scm_caddr (strings); p->start_ev_ = 0; @@ -344,7 +344,7 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed) { if (!p->bracket_ && p->event_drul_[STOP]) { - string msg = _f (cannot find start of piano pedal bracket: `%s'", p->type_->base_name_.c_str ()); + string msg = _f ("cannot find start of piano pedal bracket: `%s'", p->type_->base_name_.c_str ()); p->event_drul_[STOP]->origin ()->warning (msg); p->event_drul_[STOP] = 0; } diff --git a/lily/piano-pedal-performer.cc b/lily/piano-pedal-performer.cc index 6224b00ab3..1ab27bca07 100644 --- a/lily/piano-pedal-performer.cc +++ b/lily/piano-pedal-performer.cc @@ -90,7 +90,7 @@ Piano_pedal_performer::process_music () if (p->event_drul_[STOP]) { if (!p->start_event_) - p->event_drul_[STOP]->origin ()->warning (_f (cannot find start of piano pedal: `%s'", pedal_type)); + p->event_drul_[STOP]->origin ()->warning (_f ("cannot find start of piano pedal: `%s'", pedal_type)); else { Audio_piano_pedal *a = new Audio_piano_pedal; diff --git a/lily/relocate.cc b/lily/relocate.cc index 6e3b2ab71e..f1206fb758 100644 --- a/lily/relocate.cc +++ b/lily/relocate.cc @@ -355,7 +355,7 @@ read_relocation_file (string filename) char const *cname = filename.c_str (); FILE *f = fopen (cname, "r"); if (!f) - error (_f (cannot open file %s", cname)); + error (_f ("cannot open file %s", cname)); while (!feof (f)) { diff --git a/lily/source-file.cc b/lily/source-file.cc index 05b90b4f36..4415e8dad7 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -51,7 +51,7 @@ gulp_file (string filename, int desired_size) FILE *f = fopen (filename.c_str (), "rb"); if (!f) { - warning (_f (cannot open file: `%s'", filename.c_str ())); + warning (_f ("cannot open file: `%s'", filename.c_str ())); vector cxx_arr; return cxx_arr; diff --git a/lily/translator-group.cc b/lily/translator-group.cc index c0aff72021..0fa39c662a 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -148,7 +148,7 @@ Translator_group::create_child_translator (SCM sev) { Translator *type = get_translator (scm_car (s)); if (!type) - warning (_f (cannot find: `%s'", ly_symbol2string (scm_car (s)).c_str ())); + warning (_f ("cannot find: `%s'", ly_symbol2string (scm_car (s)).c_str ())); else { Translator *tr = type->clone (); -- 2.39.5