From 6a4062bf3875e749ca9ac08acb9500be0148a6fd Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 14 Jan 2008 15:06:12 -1000 Subject: [PATCH] minor cleanups --- extra/crypto/sha1/sha1.factor | 2 +- extra/io/sniffer/bsd/bsd.factor | 2 +- extra/io/sniffer/filter/bsd/bsd.factor | 2 +- extra/math/polynomials/polynomials.factor | 4 ++-- extra/ori/ori.factor | 9 +-------- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/extra/crypto/sha1/sha1.factor b/extra/crypto/sha1/sha1.factor index 6906ce2b9a..94a51288bb 100644 --- a/extra/crypto/sha1/sha1.factor +++ b/extra/crypto/sha1/sha1.factor @@ -78,7 +78,7 @@ SYMBOL: K K get nth , A get 5 bitroll-32 , E get , - ] { } make sum 4294967295 bitand ; inline + ] { } make sum >32-bit ; inline : set-vars ( temp -- ) ! E = D; D = C; C = S^30(B); B = A; A = TEMP; diff --git a/extra/io/sniffer/bsd/bsd.factor b/extra/io/sniffer/bsd/bsd.factor index 6a0d092807..5c32bd78d2 100644 --- a/extra/io/sniffer/bsd/bsd.factor +++ b/extra/io/sniffer/bsd/bsd.factor @@ -17,7 +17,7 @@ TUPLE: sniffer-spec path ifname ; C: sniffer-spec : IOCPARM_MASK HEX: 1fff ; inline -: IOCPARM_MAX IOCPARM_MASK 1 + ; inline +: IOCPARM_MAX IOCPARM_MASK 1+ ; inline : IOC_VOID HEX: 20000000 ; inline : IOC_OUT HEX: 40000000 ; inline : IOC_IN HEX: 80000000 ; inline diff --git a/extra/io/sniffer/filter/bsd/bsd.factor b/extra/io/sniffer/filter/bsd/bsd.factor index c18cae41e5..4f6d8b2420 100644 --- a/extra/io/sniffer/filter/bsd/bsd.factor +++ b/extra/io/sniffer/filter/bsd/bsd.factor @@ -9,7 +9,7 @@ IN: io.sniffer.filter.bsd : bpf-align ( n -- n' ) #! Align to next higher word size - "long" heap-size 1- [ + ] keep bitnot bitand ; + "long" heap-size align ; M: unix-io packet. ( string -- ) 18 cut swap >byte-array bpfh. diff --git a/extra/math/polynomials/polynomials.factor b/extra/math/polynomials/polynomials.factor index f805df8249..000d97f2a6 100644 --- a/extra/math/polynomials/polynomials.factor +++ b/extra/math/polynomials/polynomials.factor @@ -1,5 +1,5 @@ USING: arrays kernel sequences vectors math math.vectors namespaces -shuffle splitting ; +shuffle splitting sequences.lib ; IN: math.polynomials ! Polynomials are vectors with the highest powers on the right: @@ -22,7 +22,7 @@ PRIVATE> : p= ( p p -- ? ) pextend = ; : ptrim ( p -- p ) - dup length 1 = [ [ zero? ] right-trim ] unless ; + dup singleton? [ [ zero? ] right-trim ] unless ; : 2ptrim ( p p -- p p ) [ ptrim ] 2apply ; : p+ ( p p -- p ) pextend v+ ; diff --git a/extra/ori/ori.factor b/extra/ori/ori.factor index 3ada07b53f..db60f95183 100644 --- a/extra/ori/ori.factor +++ b/extra/ori/ori.factor @@ -1,7 +1,7 @@ USING: kernel namespaces math math.constants math.functions math.matrices math.vectors - sequences splitting self ; + sequences splitting self math.trig ; IN: ori @@ -11,13 +11,6 @@ C: ori ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! Temporarily defined here until math-contrib gets moved to extra/ - -: deg>rad pi * 180 / ; inline -: rad>deg 180 * pi / ; inline - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - : ori> ( -- val ) self> ori-val ; : >ori ( val -- ) self> set-ori-val ;