From 65e2bfc166f16145c12e98b18208e17618293142 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 12 Dec 2004 20:51:20 +0000 Subject: [PATCH] * lily/lily-guile.cc: Use scm_from_locale_stringn. * lily/include/guile-compatibility.hh (scm_from_locale_stringn): Add compatibility. --- ChangeLog | 7 +++++++ lily/include/guile-compatibility.hh | 1 + lily/lily-guile.cc | 7 +------ scm/framework-ps.scm | 1 - scm/lily-library.scm | 7 +++++-- scm/output-gnome.scm | 14 -------------- 6 files changed, 14 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6adda6f98f..3026e59237 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-12-12 Jan Nieuwenhuizen + + * lily/lily-guile.cc: Use scm_from_locale_stringn. + + * lily/include/guile-compatibility.hh (scm_from_locale_stringn): Add + compatibility. + 2004-12-12 Han-Wen Nienhuys * lily/open-type-font.cc (get_indexed_char): scale metrics by diff --git a/lily/include/guile-compatibility.hh b/lily/include/guile-compatibility.hh index 581124d62a..161ba4e6e4 100644 --- a/lily/include/guile-compatibility.hh +++ b/lily/include/guile-compatibility.hh @@ -41,6 +41,7 @@ inline SCM scm_cadar (SCM x) { return SCM_CADAR (x); } #define scm_is_integer(x) SCM_INUMP (x) #define scm_is_string(x) SCM_STRINGP (x) #define scm_hash_table_p scm_vector_p +#define scm_from_locale_stringn(s, n) scm_mem2string (s, n) #define scm_i_string_chars(x) SCM_STRING_CHARS (x) #define scm_i_string_length(x) SCM_STRING_LENGTH (x) inline bool ly_c_number_p (SCM x) { return SCM_NUMBERP (x); } diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 9250bc956d..f418df157d 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -127,12 +127,7 @@ LY_DEFINE (ly_gulp_file, "ly:gulp-file", { SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string"); String contents = gulp_file_to_string (ly_scm2string (name), true); - - char * data ; - SCM scm_str = scm_i_make_string (contents.length(), &data); - memcpy (data, contents.get_bytes(), contents.length()); - - return scm_str; + return scm_from_locale_stringn (contents.get_str0 (), contents.length ()); } diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index be7e7c5a1d..114be63aa9 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -71,7 +71,6 @@ )) - (define (load-fonts paper) (let* ((fonts (ly:paper-fonts paper)) (font-names (uniq-list (sort (map ly:font-file-name fonts) stringinteger char))) diff --git a/scm/output-gnome.scm b/scm/output-gnome.scm index c5689033aa..217640a0da 100644 --- a/scm/output-gnome.scm +++ b/scm/output-gnome.scm @@ -285,19 +285,6 @@ lilypond -fgnome input/simple-song.ly (filledbox (- x1) (- x2 x1) (* .5 thickness) (* .5 thickness))) (define (placebox x y expr) - - (debugf "x,y: ~S,~S\n" x y) - ;; FIXME: dimensions with bigcheese are broken - ;;; help hello-world of bigcheese a bit to figure out what's - ;;; wrong - (set! x (+ 10 (/ x 50))) - (if (< y -800) - (set! y (+ y 700))) - (if (< y -250) - (set! y (+ y 250))) - - (debugf "item: ~S\n" expr) - (debugf "x,y: ~S,~S\n" x y) (let ((item expr)) ;;(if item ;; FIXME ugly hack to skip #unspecified ... @@ -411,7 +398,6 @@ lilypond -fgnome input/simple-song.ly ;; ugh, experimental placement corections ;; #:x 0.0 #:y 0.0 #:x 0.0 #:y (if (memq encoding '(fetaMusic fetaBraces)) 0.15 0.69) - #:anchor (if (memq encoding '(fetaMusic fetaBraces)) 'west 'south-west) #:font (pango-font-name font) #:size-points (pango-font-size font) -- 2.39.5