From 8f0cc3ad2f5e908745c0927a7abffc9ae81a843d Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 10 Jan 2017 21:11:58 -0800 Subject: [PATCH] Replace use of port/%FOO with port/FOO. --- src/runtime/genio.scm | 16 ++++++++-------- src/runtime/output.scm | 7 +++---- src/runtime/stringio.scm | 34 +++++++++++++++++----------------- 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/runtime/genio.scm b/src/runtime/genio.scm index 7d2bd3d04..8c21cd7e0 100644 --- a/src/runtime/genio.scm +++ b/src/runtime/genio.scm @@ -96,15 +96,15 @@ USA. (list->vector extra))) (define-integrable (port-input-buffer port) - (gstate-input-buffer (port/%state port))) + (gstate-input-buffer (port/state port))) (define-integrable (port-output-buffer port) - (gstate-output-buffer (port/%state port))) + (gstate-output-buffer (port/state port))) (define (generic-i/o-port-accessor index) (guarantee-index-fixnum index 'GENERIC-I/O-PORT-ACCESSOR) (lambda (port) - (let ((extra (gstate-extra (port/%state port)))) + (let ((extra (gstate-extra (port/state port)))) (if (not (fix:< index (vector-length extra))) (error "Accessor index out of range:" index)) (vector-ref extra index)))) @@ -112,7 +112,7 @@ USA. (define (generic-i/o-port-modifier index) (guarantee-index-fixnum index 'GENERIC-I/O-PORT-MODIFIER) (lambda (port object) - (let ((extra (gstate-extra (port/%state port)))) + (let ((extra (gstate-extra (port/state port)))) (if (not (fix:< index (vector-length extra))) (error "Accessor index out of range:" index)) (vector-set! extra index object)))) @@ -417,10 +417,10 @@ USA. #t) (define (generic-io/coding port) - (gstate-coding (port/%state port))) + (gstate-coding (port/state port))) (define (generic-io/set-coding port name) - (let ((state (port/%state port))) + (let ((state (port/state port))) (let ((ib (gstate-input-buffer state))) (if ib (set-input-buffer-coding! ib name))) @@ -442,10 +442,10 @@ USA. (else '()))) (define (generic-io/line-ending port) - (gstate-line-ending (port/%state port))) + (gstate-line-ending (port/state port))) (define (generic-io/set-line-ending port name) - (let ((state (port/%state port))) + (let ((state (port/state port))) (let ((ib (gstate-input-buffer state))) (if ib (set-input-buffer-line-ending! diff --git a/src/runtime/output.scm b/src/runtime/output.scm index f44105d37..f650c43a1 100644 --- a/src/runtime/output.scm +++ b/src/runtime/output.scm @@ -27,13 +27,12 @@ USA. ;;;; Output ;;; package: (runtime output-port) -(declare (usual-integrations) - (integrate-external "port")) +(declare (usual-integrations)) ;;;; Low level (define-integrable (output-port/%write-char port char) - ((port/%operation/write-char port) port char)) + ((port/operation/write-char port) port char)) (define (output-port/write-char port char) ((port/operation/write-char port) port char)) @@ -54,7 +53,7 @@ USA. ((port/operation/flush-output port) port)) (define-integrable (output-port/%discretionary-flush port) - ((port/%operation/discretionary-flush-output port) port)) + ((port/operation/discretionary-flush-output port) port)) (define (output-port/discretionary-flush port) ((port/operation/discretionary-flush-output port) port)) diff --git a/src/runtime/stringio.scm b/src/runtime/stringio.scm index 12a3e846b..5959f3ee7 100644 --- a/src/runtime/stringio.scm +++ b/src/runtime/stringio.scm @@ -100,11 +100,11 @@ USA. (write-string " from string" output-port)) (define (internal-in/eof? port) - (let ((ss (port/%state port))) + (let ((ss (port/state port))) (not (fix:< (iistate-next ss) (iistate-end ss))))) (define (internal-in/read-substring port string start end) - (let ((ss (port/%state port))) + (let ((ss (port/state port))) (let ((n (move-chars! (iistate-string ss) (iistate-next ss) (iistate-end ss) string start end))) @@ -117,13 +117,13 @@ USA. narrow-in/unread-char)) (define (narrow-in/peek-char port) - (let ((ss (port/%state port))) + (let ((ss (port/state port))) (if (fix:< (iistate-next ss) (iistate-end ss)) (string-ref (iistate-string ss) (iistate-next ss)) (make-eof-object port)))) (define (narrow-in/read-char port) - (let ((ss (port/%state port))) + (let ((ss (port/state port))) (if (fix:< (iistate-next ss) (iistate-end ss)) (let ((char (string-ref (iistate-string ss) (iistate-next ss)))) (set-iistate-next! ss (fix:+ (iistate-next ss) 1)) @@ -131,7 +131,7 @@ USA. (make-eof-object port)))) (define (narrow-in/unread-char port char) - (let ((ss (port/%state port))) + (let ((ss (port/state port))) (if (not (fix:< (iistate-start ss) (iistate-next ss))) (error "No char to unread:" port)) (let ((prev (fix:- (iistate-next ss) 1))) @@ -145,13 +145,13 @@ USA. wide-in/unread-char)) (define (wide-in/peek-char port) - (let ((ss (port/%state port))) + (let ((ss (port/state port))) (if (fix:< (iistate-next ss) (iistate-end ss)) (wide-string-ref (iistate-string ss) (iistate-next ss)) (make-eof-object port)))) (define (wide-in/read-char port) - (let ((ss (port/%state port))) + (let ((ss (port/state port))) (if (fix:< (iistate-next ss) (iistate-end ss)) (let ((char (wide-string-ref (iistate-string ss) (iistate-next ss)))) (set-iistate-next! ss (fix:+ (iistate-next ss) 1)) @@ -159,7 +159,7 @@ USA. (make-eof-object port)))) (define (wide-in/unread-char port char) - (let ((ss (port/%state port))) + (let ((ss (port/state port))) (if (not (fix:< (iistate-start ss) (iistate-next ss))) (error "No char to unread:" port)) (let ((prev (fix:- (iistate-next ss) 1))) @@ -315,7 +315,7 @@ USA. (define (narrow-out/write-char port char) (if (not (fix:< (char->integer char) #x100)) (error:not-8-bit-char char)) - (let ((os (port/%state port))) + (let ((os (port/state port))) (maybe-grow-buffer os 1) (string-set! (ostate-buffer os) (ostate-index os) char) (set-ostate-index! os (fix:+ (ostate-index os) 1)) @@ -323,11 +323,11 @@ USA. 1)) (define (narrow-out/extract-output port) - (let ((os (port/%state port))) + (let ((os (port/state port))) (string-head (ostate-buffer os) (ostate-index os)))) (define (narrow-out/extract-output! port) - (let* ((os (port/%state port)) + (let* ((os (port/state port)) (output (string-head! (ostate-buffer os) (ostate-index os)))) (reset-buffer! os) output)) @@ -338,7 +338,7 @@ USA. wide-out/extract-output!)) (define (wide-out/write-char port char) - (let ((os (port/%state port))) + (let ((os (port/state port))) (maybe-grow-buffer os 1) (wide-string-set! (ostate-buffer os) (ostate-index os) char) (set-ostate-index! os (fix:+ (ostate-index os) 1)) @@ -346,11 +346,11 @@ USA. 1)) (define (wide-out/extract-output port) - (let ((os (port/%state port))) + (let ((os (port/state port))) (wide-substring (ostate-buffer os) 0 (ostate-index os)))) (define (wide-out/extract-output! port) - (let ((os (port/%state port))) + (let ((os (port/state port))) (let ((output (wide-substring (ostate-buffer os) 0 (ostate-index os)))) (reset-buffer! os) output))) @@ -371,17 +371,17 @@ USA. column) (define (string-out/output-column port) - (ostate-column (port/%state port))) + (ostate-column (port/state port))) (define (string-out/position port) - (ostate-index (port/%state port))) + (ostate-index (port/state port))) (define (string-out/write-self port output-port) port (write-string " to string" output-port)) (define (string-out/write-substring port string start end) - (let ((os (port/%state port)) + (let ((os (port/state port)) (n (- end start))) (maybe-grow-buffer os n) (let* ((start* (ostate-index os)) -- 2.25.1