mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Rename string-width to string-bytes-per-char
* libguile/strings.h: rename scm_string_width to scm_string_bytes_per_char * libguile/strings.c (scm_string_width): renamed to scm_string_bytes_per_char (scm_string_bytes_per_char): renamed from scm_string_width * module/language/assembly/compile-bytecode.scm (write-bytecode): string-width -> string-bytes-per-char * module/language/glil/compile-assembly.scm (dump-object): string-width -> string-bytes-per-char
This commit is contained in:
parent
1c7b216f84
commit
f8ba2bb911
4 changed files with 8 additions and 8 deletions
|
@ -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))
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue