From 9d339e7d22577f7b7306e2015fc29536c625243b Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sat, 25 Feb 2017 18:31:43 -0700 Subject: [PATCH] cairo: Use bytevectors instead of strings. --- src/cairo/cairo-graphics.scm | 4 ++-- src/cairo/cairo.scm | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cairo/cairo-graphics.scm b/src/cairo/cairo-graphics.scm index c7e74b265..09496187f 100644 --- a/src/cairo/cairo-graphics.scm +++ b/src/cairo/cairo-graphics.scm @@ -74,8 +74,8 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (define (cairo-graphics/open make-device #!optional width height) (let ((width (if (default-object? width) 512 width)) (height (if (default-object? height) 384 height))) - (guarantee-positive-fixnum width 'cairo-graphics/open) - (guarantee-positive-fixnum height 'cairo-graphics/open) + (guarantee positive-fixnum? width 'cairo-graphics/open) + (guarantee positive-fixnum? height 'cairo-graphics/open) (make-device (make-cairo-graphics width height)))) (define (cairo-graphics/close device) diff --git a/src/cairo/cairo.scm b/src/cairo/cairo.scm index ea09c9741..9e9a1cd77 100644 --- a/src/cairo/cairo.scm +++ b/src/cairo/cairo.scm @@ -59,7 +59,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (let ((msg (C-call "cairo_status_to_string" (make-alien '(* (const char))) status))) - (error msg surface))))) + (error (utf8->string (c-peek-cstring msg)) surface))))) (define (guarantee-cairo-surface object operator) (if (and (alien? object) (eq? (alien/ctype object) '|cairo_surface_t|)) @@ -68,8 +68,8 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (define (cairo-surface-write-to-png surface filename) (guarantee-cairo-surface surface 'cairo-surface-write-to-png) - (guarantee-string filename 'cairo-surface-write-to-png) - (C-call "cairo_surface_write_to_png" surface filename)) + (guarantee string? filename 'cairo-surface-write-to-png) + (C-call "cairo_surface_write_to_png" surface (string->utf8 filename))) (define (cairo-surface-flush surface) (guarantee-cairo-surface surface 'cairo-surface-flush) @@ -119,7 +119,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (let ((msg (C-call "cairo_status_to_string" (make-alien '(* (const char))) status))) - (error msg pattern))))) + (error (utf8->string (c-peek-cstring msg)) pattern))))) (define (guarantee-cairo-pattern object operator) (if (and (alien? object) (eq? (alien/ctype object) '|cairo_pattern_t|)) @@ -165,7 +165,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (let ((msg (C-call "cairo_status_to_string" (make-alien '(* (const char))) status))) - (error msg cairo))))) + (error (utf8->string (c-peek-cstring msg)) cairo))))) (define (guarantee-cairo object operator) (if (and (alien? object) (eq? (alien/ctype object) '|cairo_t|)) @@ -320,8 +320,8 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (define (cairo-show-text cairo string) (guarantee-cairo cairo 'cairo-show-text) - (guarantee-string string 'cairo-show-text) - (C-call "cairo_show_text" cairo string)) + (guarantee string? string 'cairo-show-text) + (C-call "cairo_show_text" cairo (string->utf8 string))) (define (cairo-paint cairo) (guarantee-cairo cairo 'cairo-paint) -- 2.25.1