From 53d404a150c4fc3bafb1ef8cb095f87660e001f8 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sun, 19 May 2019 16:23:35 -0700 Subject: [PATCH] base16/32/64/85/91: declare base>ch as fixnum. --- basis/base64/base64.factor | 6 +++--- extra/base16/base16.factor | 6 +++--- extra/base32/base32.factor | 6 +++--- extra/base85/base85.factor | 6 +++--- extra/base91/base91.factor | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/basis/base64/base64.factor b/basis/base64/base64.factor index aff50fb230..98f549b4a2 100644 --- a/basis/base64/base64.factor +++ b/basis/base64/base64.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2008 Doug Coleman, Daniel Ehrenberg. ! See http://factorcode.org/license.txt for BSD license. USING: arrays assocs byte-arrays combinators fry io io.binary -io.encodings.binary io.streams.byte-array kernel literals math -namespaces sbufs sequences ; +io.encodings.binary io.streams.byte-array kernel kernel.private +literals math namespaces sbufs sequences ; IN: base64 ERROR: malformed-base64 ; @@ -26,7 +26,7 @@ CONSTANT: alphabet $[ : base64>ch ( ch -- ch ) $[ alphabet alphabet-inverse 0 CHAR: = pick set-nth ] nth - [ malformed-base64 ] unless* ; inline + [ malformed-base64 ] unless* { fixnum } declare ; inline : (write-lines) ( column byte-array -- column' ) output-stream get dup '[ diff --git a/extra/base16/base16.factor b/extra/base16/base16.factor index 2889059503..4db071d6b7 100644 --- a/extra/base16/base16.factor +++ b/extra/base16/base16.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2019 John Benediktsson. ! See http://factorcode.org/license.txt for BSD license. USING: base64.private byte-arrays combinators io -io.encodings.binary io.streams.byte-array kernel literals locals -math namespaces sequences ; +io.encodings.binary io.streams.byte-array kernel kernel.private +literals locals math namespaces sequences ; IN: base16 ERROR: malformed-base16 ; @@ -20,7 +20,7 @@ CONSTANT: alphabet $[ "0123456789ABCDEF" >byte-array ] : base16>ch ( ch -- ch ) $[ alphabet alphabet-inverse ] nth - [ malformed-base16 ] unless* ; inline + [ malformed-base16 ] unless* { fixnum } declare ; inline :: (encode-base16) ( stream -- ) stream stream-read1 [ diff --git a/extra/base32/base32.factor b/extra/base32/base32.factor index b0681488de..90c362f48f 100644 --- a/extra/base32/base32.factor +++ b/extra/base32/base32.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2019 John Benediktsson ! See http://factorcode.org/license.txt for BSD license USING: base64.private byte-arrays combinators fry io io.binary -io.encodings.binary io.streams.byte-array kernel literals math -namespaces sequences ; +io.encodings.binary io.streams.byte-array kernel kernel.private +literals math namespaces sequences ; IN: base32 ERROR: malformed-base32 ; @@ -22,7 +22,7 @@ CONSTANT: alphabet $[ "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" >byte-array ] : base32>ch ( ch -- ch ) $[ alphabet alphabet-inverse 0 CHAR: = pick set-nth ] nth - [ malformed-base32 ] unless* ; inline + [ malformed-base32 ] unless* { fixnum } declare ; inline : encode5 ( seq -- byte-array ) be> { -35 -30 -25 -20 -15 -10 -5 0 } '[ diff --git a/extra/base85/base85.factor b/extra/base85/base85.factor index 5e21d73222..bbf98e13c2 100644 --- a/extra/base85/base85.factor +++ b/extra/base85/base85.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2013 John Benediktsson. ! See http://factorcode.org/license.txt for BSD license. USING: base64.private byte-arrays combinators io io.binary -io.encodings.binary io.streams.byte-array kernel literals math -namespaces sequences ; +io.encodings.binary io.streams.byte-array kernel kernel.private +literals math namespaces sequences ; IN: base85 ERROR: malformed-base85 ; @@ -21,7 +21,7 @@ CONSTANT: alphabet $[ : base85>ch ( ch -- ch ) $[ alphabet alphabet-inverse ] nth - [ malformed-base85 ] unless* ; inline + [ malformed-base85 ] unless* { fixnum } declare ; inline : encode4 ( seq -- seq' ) be> 5 [ 85 /mod ch>base85 ] B{ } replicate-as reverse! nip ; inline diff --git a/extra/base91/base91.factor b/extra/base91/base91.factor index 05a07842fe..fba9b49f65 100644 --- a/extra/base91/base91.factor +++ b/extra/base91/base91.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2019 John Benediktsson. ! See http://factorcode.org/license.txt for BSD license. -USING: base64.private byte-arrays kernel literals locals math -sequences ; +USING: base64.private byte-arrays kernel kernel.private +literals locals math sequences ; IN: base91 ERROR: malformed-base91 ; @@ -20,7 +20,7 @@ CONSTANT: alphabet $[ : base91>ch ( ch -- ch ) $[ alphabet alphabet-inverse ] nth - [ malformed-base91 ] unless* ; inline + [ malformed-base91 ] unless* { fixnum } declare ; inline PRIVATE> -- 2.34.1