summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libguile/strings.c4
-rw-r--r--libguile/strings.h2
-rw-r--r--module/language/assembly/compile-bytecode.scm2
-rw-r--r--module/language/glil/compile-assembly.scm8
4 files changed, 8 insertions, 8 deletions
diff --git a/libguile/strings.c b/libguile/strings.c
index 50adee817..7ae100d8c 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -1098,11 +1098,11 @@ SCM_DEFINE (scm_string_length, "string-length", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_string_width, "string-width", 1, 0, 0,
+SCM_DEFINE (scm_string_bytes_per_char, "string-bytes-per-char", 1, 0, 0,
(SCM string),
"Return the bytes used to represent a character in @var{string}."
"This will return 1 or 4.")
-#define FUNC_NAME s_scm_string_width
+#define FUNC_NAME s_scm_string_bytes_per_char
{
SCM_VALIDATE_STRING (1, string);
if (!scm_i_is_narrow_string (string))
diff --git a/libguile/strings.h b/libguile/strings.h
index fe9162d25..390b4f6a8 100644
--- a/libguile/strings.h
+++ b/libguile/strings.h
@@ -102,7 +102,7 @@ SCM_API SCM scm_string_p (SCM x);
SCM_API SCM scm_string (SCM chrs);
SCM_API SCM scm_make_string (SCM k, SCM chr);
SCM_API SCM scm_string_length (SCM str);
-SCM_API SCM scm_string_width (SCM str);
+SCM_API SCM scm_string_bytes_per_char (SCM str);
SCM_API SCM scm_string_ref (SCM str, SCM k);
SCM_API SCM scm_string_set_x (SCM str, SCM k, SCM chr);
SCM_API SCM scm_substring (SCM str, SCM start, SCM end);
diff --git a/module/language/assembly/compile-bytecode.scm b/module/language/assembly/compile-bytecode.scm
index 4706cce64..688cb6b31 100644
--- a/module/language/assembly/compile-bytecode.scm
+++ b/module/language/assembly/compile-bytecode.scm
@@ -82,7 +82,7 @@
(write-string str))
(define (write-sized-loader str)
(let ((len (string-length str))
- (wid (string-width str)))
+ (wid (string-bytes-per-char str)))
(write-loader-len len)
(write-byte wid)
(if (= wid 4)
diff --git a/module/language/glil/compile-assembly.scm b/module/language/glil/compile-assembly.scm
index c67ef694b..121d9db9f 100644
--- a/module/language/glil/compile-assembly.scm
+++ b/module/language/glil/compile-assembly.scm
@@ -391,17 +391,17 @@
((number? x)
`((load-number ,(number->string x))))
((string? x)
- (case (string-width x)
+ (case (string-bytes-per-char x)
((1) `((load-string ,x)))
((4) (align-code `(load-wide-string ,x) addr 4 4))
- (else (error "bad string width" x))))
+ (else (error "bad string bytes per char" x))))
((symbol? x)
(let ((str (symbol->string x)))
- (case (string-width str)
+ (case (string-bytes-per-char str)
((1) `((load-symbol ,str)))
((4) `(,@(dump-object str addr)
(make-symbol)))
- (else (error "bad string width" str)))))
+ (else (error "bad string bytes per char" str)))))
((keyword? x)
`(,@(dump-object (keyword->symbol x) addr)
(make-keyword)))