From fe6406de76a7f2276f7485dc6583ace8a26ea446 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 20 Feb 2017 22:26:07 -0800 Subject: [PATCH] Convert a bunch of string-allocate references to make-legacy-string. --- src/gdbm/gdbm.scm | 4 ++-- src/runtime/rgxcmp.scm | 6 +++--- src/runtime/utabs.scm | 4 ++-- src/win32/clipbrd.scm | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gdbm/gdbm.scm b/src/gdbm/gdbm.scm index a98aa200c..309237aa7 100644 --- a/src/gdbm/gdbm.scm +++ b/src/gdbm/gdbm.scm @@ -295,7 +295,7 @@ USA. (if (alien-null? data) #f (let* ((size (C-> args "gdbm_args key dsize")) - (string (string-allocate size))) + (string (make-legacy-string size))) (c-peek-bytes data 0 size string 0) string)))) @@ -304,7 +304,7 @@ USA. (if (alien-null? data) #f (let* ((size (C-> args "gdbm_args content dsize")) - (string (string-allocate size))) + (string (make-legacy-string size))) (c-peek-bytes data 0 size string 0) string)))) diff --git a/src/runtime/rgxcmp.scm b/src/runtime/rgxcmp.scm index 860146528..87e94bc83 100644 --- a/src/runtime/rgxcmp.scm +++ b/src/runtime/rgxcmp.scm @@ -182,7 +182,7 @@ USA. ;;;; String Compiler (define (re-compile-char char case-fold?) - (let ((result (string-allocate 2))) + (let ((result (make-legacy-string 2))) (vector-8b-set! result 0 re-code:exact-1) (string-set! result 1 (if case-fold? (char-upcase char) char)) (make-compiled-regexp result case-fold?))) @@ -195,7 +195,7 @@ USA. (if (fix:zero? n) (make-compiled-regexp string case-fold?) (let ((result - (string-allocate + (make-legacy-string (let ((qr (integer-divide n 255))) (fix:+ (fix:* 257 (integer-divide-quotient qr)) (let ((r (integer-divide-remainder qr))) @@ -237,7 +237,7 @@ USA. n))))) (if (zero? n) string - (let ((result (string-allocate (+ end n)))) + (let ((result (make-legacy-string (+ end n)))) (let loop ((start 0) (i 0)) (let ((index (substring-find-next-char-in-set string start end diff --git a/src/runtime/utabs.scm b/src/runtime/utabs.scm index ac43bc954..2249cde61 100644 --- a/src/runtime/utabs.scm +++ b/src/runtime/utabs.scm @@ -73,8 +73,8 @@ USA. (define (intern string) ((ucode-primitive string->symbol) - (let ((size (string-length string))) - (let ((result (string-allocate size))) + (let ((size ((ucode-primitive string-length) string))) + (let ((result ((ucode-primitive string-allocate) size))) ((ucode-primitive substring-move-right!) string 0 size result 0) ((ucode-primitive substring-downcase!) result 0 size) result)))) diff --git a/src/win32/clipbrd.scm b/src/win32/clipbrd.scm index 0ac52679c..27482cb99 100644 --- a/src/win32/clipbrd.scm +++ b/src/win32/clipbrd.scm @@ -47,7 +47,7 @@ USA. (let ((mem (get-clipboard-data CF_TEXT))) (and (not (= mem 0)) (let* ((maxlen (global-size mem)) - (s (string-allocate maxlen)) + (s (make-legacy-string maxlen)) (ptr (global-lock mem))) (copy-memory s ptr maxlen) (global-unlock mem) -- 2.25.1