diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2021-01-03 10:52:54 +0100 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2021-01-03 10:53:14 +0100 |
commit | 680adf20dca7b3a3387e666748428c41cbccc0ce (patch) | |
tree | a9b0c5034d738159294c1fc1629c84e8daf0fee5 /pict | |
parent | a14995b78f7b49da0b9ab664920a4dc5aee24ab8 (diff) |
base64: Avoid override warnings.
Diffstat (limited to 'pict')
-rw-r--r-- | pict/base64.scm | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/pict/base64.scm b/pict/base64.scm index 21c0d26..1d3d024 100644 --- a/pict/base64.scm +++ b/pict/base64.scm @@ -55,7 +55,12 @@ base64url-alphabet get-delimited-base64 put-delimited-base64) - #:use-module (rnrs) + #:use-module ((rnrs) + #:renamer (lambda (binding) + (if (eq? binding 'error) + (symbol-append 'rnrs: binding) + binding)) + #:hide (display)) #:use-module ((srfi srfi-13) #:select (string-index string-prefix? string-suffix? @@ -154,8 +159,8 @@ (base64-decode str alphabet #f)) ((str alphabet port) (unless (zero? (mod (string-length str) 4)) - (error 'base64-decode - "input string must be a multiple of four characters")) + (rnrs:error 'base64-decode + "input string must be a multiple of four characters")) (let-values (((p extract) (if port (values port (lambda () (values))) (open-bytevector-output-port)))) @@ -192,8 +197,8 @@ (fxarithmetic-shift-left i2 12)))) (put-u8 p (fxbit-field x 16 24)))) (else - (error 'base64-decode "invalid input" - (list c1 c2 c3 c4))))))))))) + (rnrs:error 'base64-decode "invalid input" + (list c1 c2 c3 c4))))))))))) (define (get-line-comp f port) (if (port-eof? port) @@ -230,12 +235,12 @@ (let-values (((outp extract) (open-bytevector-output-port))) (let lp ((line (get-first-data-line port))) (cond ((eof-object? line) - (error 'get-delimited-base64 - "unexpected end of file")) + (rnrs:error 'get-delimited-base64 + "unexpected end of file")) ((string-prefix? "-" line) (unless (string=? line endline) - (error 'get-delimited-base64 - "bad end delimiter" type line)) + (rnrs:error 'get-delimited-base64 + "bad end delimiter" type line)) (values type (extract))) (else (unless (and (= (string-length line) 5) |