From: Chris Hanson Date: Wed, 21 Mar 2001 05:40:01 +0000 (+0000) Subject: Use SUBSTRING-MOVE! in preference to SUBSTRING-MOVE-LEFT! and X-Git-Tag: 20090517-FFI~2880 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=a3eecc3ffac819e0edc90e2e94c810e1d2f384fc;p=mit-scheme.git Use SUBSTRING-MOVE! in preference to SUBSTRING-MOVE-LEFT! and SUBSTRING-MOVE-RIGHT!. --- diff --git a/v7/src/runtime/dbgutl.scm b/v7/src/runtime/dbgutl.scm index fe6c4ced8..d2db37d25 100644 --- a/v7/src/runtime/dbgutl.scm +++ b/v7/src/runtime/dbgutl.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: dbgutl.scm,v 14.17 1999/01/02 06:06:43 cph Exp $ +$Id: dbgutl.scm,v 14.18 2001/03/21 05:39:39 cph Exp $ -Copyright (c) 1988-1999 Massachusetts Institute of Technology +Copyright (c) 1988-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; Debugger Utilities @@ -68,7 +69,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (output-to-string length thunk) (let ((x (with-output-to-truncated-string length thunk))) (if (and (car x) (> length 4)) - (substring-move-right! " ..." 0 4 (cdr x) (- length 4))) + (substring-move! " ..." 0 4 (cdr x) (- length 4))) (cdr x))) (define (show-frames environment depth port) diff --git a/v7/src/runtime/emacs.scm b/v7/src/runtime/emacs.scm index 8c3b4706d..ee66638e9 100644 --- a/v7/src/runtime/emacs.scm +++ b/v7/src/runtime/emacs.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: emacs.scm,v 14.28 2001/02/27 17:16:12 cph Exp $ +$Id: emacs.scm,v 14.29 2001/03/21 05:39:42 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; GNU Emacs/Scheme Interface @@ -189,7 +190,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (let ((buffer (make-string buffer-length))) (string-set! buffer 0 #\altmode) (string-set! buffer 1 type) - (substring-move-left! string 0 length buffer 2) + (substring-move! string 0 length buffer 2) (string-set! buffer (- buffer-length 1) #\altmode) (output-port/flush-output port) (with-absolutely-no-interrupts diff --git a/v7/src/runtime/infutl.scm b/v7/src/runtime/infutl.scm index e34681065..5a86640ea 100644 --- a/v7/src/runtime/infutl.scm +++ b/v7/src/runtime/infutl.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: infutl.scm,v 1.62 1999/03/04 05:50:01 cph Exp $ +$Id: infutl.scm,v 1.63 2001/03/21 05:39:44 cph Exp $ -Copyright (c) 1988-1999 Massachusetts Institute of Technology +Copyright (c) 1988-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; Compiled Code Information: Utilities @@ -528,7 +529,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (grow-buffer!) (let* ((new-size (fix:+ buffer-size (fix:quotient buffer-size 4))) (nbuffer (make-string new-size))) - (substring-move-right! buffer 0 buffer-size nbuffer 0) + (substring-move! buffer 0 buffer-size nbuffer 0) (set! buffer-size new-size) (set! buffer nbuffer) unspecific)) @@ -636,7 +637,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (retry-with-bigger-output-buffer) (let* ((new-size (fix:+ buffer-size (fix:quotient buffer-size 4))) (nbuffer (make-string new-size))) - (substring-move-right! buffer 0 buffer-size nbuffer 0) + (substring-move! buffer 0 buffer-size nbuffer 0) (parse-command bp cp ip ip-end nbuffer new-size))) (define (refill-input-buffer-and-retry needed) diff --git a/v7/src/runtime/krypt.scm b/v7/src/runtime/krypt.scm index 8909ee065..60c1041fe 100644 --- a/v7/src/runtime/krypt.scm +++ b/v7/src/runtime/krypt.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: krypt.scm,v 1.11 2000/04/10 03:33:42 cph Exp $ +$Id: krypt.scm,v 1.12 2001/03/21 05:39:47 cph Exp $ -Copyright (c) 1988-1999 Massachusetts Institute of Technology +Copyright (c) 1988-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; Encryption/Decryption functions @@ -171,11 +172,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (rcm-key key1 password) (let ((passwordmac (make-string 5 #\NUL))) (rcm key1 5 passwordmac) - (substring-move-left! header 0 hlen output-string 0) - (substring-move-left! passwordmac 0 5 output-string hlen) - (substring-move-left! input-string 0 - (string-length input-string) - output-string (fix:+ hlen 5))) + (substring-move! header 0 hlen output-string 0) + (substring-move! passwordmac 0 5 output-string hlen) + (substring-move! input-string 0 + (string-length input-string) + output-string (fix:+ hlen 5))) (let loop ((index (fix:+ hlen 5))) (if (fix:< index end-index) (begin diff --git a/v7/src/runtime/ntprm.scm b/v7/src/runtime/ntprm.scm index 127bde6c7..3885e6a0f 100644 --- a/v7/src/runtime/ntprm.scm +++ b/v7/src/runtime/ntprm.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: ntprm.scm,v 1.34 2000/04/19 01:00:17 cph Exp $ +$Id: ntprm.scm,v 1.35 2001/03/21 05:39:50 cph Exp $ -Copyright (c) 1992-2000 Massachusetts Institute of Technology +Copyright (c) 1992-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; Miscellaneous Win32 Primitives @@ -588,7 +589,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (let loop ((strings strings) (index 0)) (if (not (null? strings)) (let ((n (string-length (car strings)))) - (substring-move-left! (car strings) 0 n result index) + (substring-move! (car strings) 0 n result index) (let ((index* (fix:+ index n))) (string-set! result index* #\NUL) (loop (cdr strings) (fix:+ index* 1)))))) @@ -616,13 +617,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (map (lambda (s) (string-length s)) strings)) (fix:- (length strings) 1))))) (let ((n (string-length (car strings)))) - (substring-move-left! (car strings) 0 n result 0) + (substring-move! (car strings) 0 n result 0) (let loop ((strings (cdr strings)) (index n)) (if (not (null? strings)) (let ((n (string-length (car strings)))) (string-set! result index #\space) - (substring-move-left! (car strings) 0 n - result (fix:+ index 1)) + (substring-move! (car strings) 0 n result (fix:+ index 1)) (loop (cdr strings) (fix:+ (fix:+ index 1) n)))))) result))) diff --git a/v7/src/runtime/os2graph.scm b/v7/src/runtime/os2graph.scm index a4183a988..f0653f581 100644 --- a/v7/src/runtime/os2graph.scm +++ b/v7/src/runtime/os2graph.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: os2graph.scm,v 1.17 2000/04/10 18:32:36 cph Exp $ +$Id: os2graph.scm,v 1.18 2001/03/21 05:39:53 cph Exp $ -Copyright (c) 1995-2000 Massachusetts Institute of Technology +Copyright (c) 1995-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; OS/2 PM Graphics Interface @@ -966,7 +967,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (if (not (fix:= to 0)) (let ((from* (fix:+ from width)) (to (fix:- to row-size))) - (substring-move-right! bytes from from* copy to) + (substring-move! bytes from from* copy to) (loop from* to)))) copy))) diff --git a/v7/src/runtime/os2prm.scm b/v7/src/runtime/os2prm.scm index 124d74128..fd31058a7 100644 --- a/v7/src/runtime/os2prm.scm +++ b/v7/src/runtime/os2prm.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: os2prm.scm,v 1.45 2000/01/05 02:40:20 cph Exp $ +$Id: os2prm.scm,v 1.46 2001/03/21 05:39:56 cph Exp $ -Copyright (c) 1994-2000 Massachusetts Institute of Technology +Copyright (c) 1994-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; Miscellaneous OS/2 Primitives @@ -506,11 +507,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 0 (map (lambda (s) (fix:+ (string-length s) 1)) strings))))) (let ((n (string-length (car strings)))) - (substring-move-left! (car strings) 0 n result 0) + (substring-move! (car strings) 0 n result 0) (string-set! result n #\NUL) (let loop ((strings (cdr strings)) (index (fix:+ n 1))) (let ((n (string-length (car strings)))) - (substring-move-left! (car strings) 0 n result index) + (substring-move! (car strings) 0 n result index) (if (null? (cdr strings)) (string-set! result (fix:+ index n) #\NUL) (begin @@ -527,7 +528,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (let loop ((strings strings) (index 0)) (if (not (null? strings)) (let ((n (string-length (car strings)))) - (substring-move-left! (car strings) 0 n result index) + (substring-move! (car strings) 0 n result index) (string-set! result (fix:+ index n) #\NUL) (loop (cdr strings) (fix:+ (fix:+ index n) 1))))) result)) diff --git a/v7/src/runtime/rgxcmp.scm b/v7/src/runtime/rgxcmp.scm index 3e82d3637..3ef0917a3 100644 --- a/v7/src/runtime/rgxcmp.scm +++ b/v7/src/runtime/rgxcmp.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: rgxcmp.scm,v 1.112 2001/02/05 21:47:30 cph Exp $ +;;; $Id: rgxcmp.scm,v 1.113 2001/03/21 05:39:59 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-2001 Massachusetts Institute of Technology ;;; @@ -16,7 +16,8 @@ ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program; if not, write to the Free Software -;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. ;;;; Regular Expression Pattern Compiler ;;; Translated from GNU (thank you RMS!) @@ -196,15 +197,14 @@ ((fix:< n 256) (vector-8b-set! result p re-code:exact-n) (vector-8b-set! result (fix:1+ p) n) - (substring-move-right! string i (fix:+ i n) - result (fix:+ p 2)) + (substring-move! string i (fix:+ i n) + result (fix:+ p 2)) (make-compiled-regexp result case-fold?)) (else (vector-8b-set! result p re-code:exact-n) (vector-8b-set! result (fix:1+ p) 255) (let ((j (fix:+ i 255))) - (substring-move-right! string i j - result (fix:+ p 2)) + (substring-move! string i j result (fix:+ p 2)) (loop (fix:- n 255) j (fix:+ p 257))))))))))))) (define re-quote-string @@ -228,14 +228,14 @@ special))) (if index (begin - (substring-move-right! string start index result i) + (substring-move! string start index result i) (let ((i (+ i (- index start)))) (string-set! result i #\\) (string-set! result (1+ i) (string-ref string index)) (loop (1+ index) (+ i 2)))) - (substring-move-right! string start end result i)))) + (substring-move! string start end result i)))) result))))))) ;;;; Char-Set Compiler diff --git a/v7/src/runtime/strout.scm b/v7/src/runtime/strout.scm index ee20fbca9..c496717da 100644 --- a/v7/src/runtime/strout.scm +++ b/v7/src/runtime/strout.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: strout.scm,v 14.14 2000/05/30 03:51:59 cph Exp $ +$Id: strout.scm,v 14.15 2001/03/21 05:40:01 cph Exp $ -Copyright (c) 1988-2000 Massachusetts Institute of Technology +Copyright (c) 1988-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; String Output Ports @@ -72,8 +73,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (n* (fix:+ n (fix:- end start)))) (if (fix:> n* (string-length (accumulator-state-accumulator state))) (grow-accumulator! state n*)) - (substring-move-left! string start end - (accumulator-state-accumulator state) n) + (substring-move! string start end + (accumulator-state-accumulator state) n) (set-accumulator-state-counter! state n*))))) (define (operation/extract-output! port) @@ -100,5 +101,5 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (if (fix:>= n min-size) n (loop (fix:+ n n))))))) - (substring-move-left! old 0 n new 0) + (substring-move! old 0 n new 0) (set-accumulator-state-accumulator! state new))) \ No newline at end of file