From abce0ae1eb2a4fd6c8b542dc9dbf07e4465814be Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 17 Jan 2007 16:12:57 +0100 Subject: [PATCH] small backport fixes. --- lily/include/lily-guile.hh | 1 + lily/include/smobs.hh | 2 +- lily/lily-guile.cc | 7 +++++++ scm/output-ps.scm | 4 +++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 02cdf7ddca..c99f452c05 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -44,6 +44,7 @@ extern SCM global_lily_module; string gulp_file_to_string (string fn, bool must_exist, int size); string ly_scm2string (SCM s); +SCM ly_string2scm (string const &str); string ly_symbol2string (SCM); SCM ly_offset2scm (Offset); Offset ly_scm2offset (SCM); diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index a2dcdb613d..6618a87d65 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -146,7 +146,7 @@ extern bool parsed_objects_should_be_dead; #define ASSERT_LIVE_IS_ALLOWED() \ static bool passed_here_once;\ if (parsed_objects_should_be_dead && !passed_here_once) { \ - programming_error (string ("Parsed object should be dead: ") + __PRETTY_FUNCTION__ ); \ + ::programming_error (string ("Parsed object should be dead: ") + __PRETTY_FUNCTION__ ); \ passed_here_once = true;\ } diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index e1a0e9bffd..99e8cb307b 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -132,6 +132,13 @@ ly_scm2string (SCM str) (int) scm_i_string_length (str)); } +SCM +ly_string2scm (string const &str) +{ + return scm_from_locale_stringn (str.c_str(), + str.length ()); +} + char * ly_scm2newstr (SCM str, size_t *lenp) { diff --git a/scm/output-ps.scm b/scm/output-ps.scm index a5abcf2079..8af5b3fa3d 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -69,7 +69,9 @@ (ly:number->string num))) (define (number-pair->string4 numpair) - (format #f "~f ~f" (round4 (car numpair)) (round4 (cdr numpair)))) + (string-append (str4 (car numpair)) + " " + (str4 (cdr numpair)))) (define (numbers->string4 numlist) (string-join (map str4 numlist) " ")) -- 2.39.2