]> gitweb.factorcode.org Git - factor.git/commitdiff
Cleanup some lint warnings.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 16 Oct 2011 02:19:44 +0000 (19:19 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 16 Oct 2011 02:19:44 +0000 (19:19 -0700)
29 files changed:
basis/calendar/format/format.factor
basis/classes/struct/struct-tests.factor
basis/http/server/server.factor
basis/json/reader/reader.factor
basis/math/bitwise/bitwise.factor
basis/math/combinatorics/combinatorics.factor
basis/math/polynomials/polynomials.factor
basis/math/rectangles/positioning/positioning.factor
basis/math/statistics/statistics.factor
basis/opengl/gl/extensions/extensions.factor
basis/openssl/openssl.factor
basis/peg/search/search.factor
basis/persistent/hashtables/config/config.factor
basis/regexp/nfa/nfa.factor
basis/syndication/syndication.factor
basis/tools/deploy/shaker/shaker.factor
basis/tools/deploy/windows/ico/ico.factor
basis/tools/scaffold/scaffold.factor
basis/tools/trace/trace.factor
basis/ui/gadgets/buttons/buttons.factor
basis/ui/gadgets/sliders/sliders.factor
basis/ui/tools/listener/listener.factor
basis/xmode/marker/marker.factor
core/math/floats/floats.factor
core/math/parser/parser.factor
extra/math/compare/compare.factor
extra/project-euler/044/044.factor
extra/robots/robots.factor
extra/webapps/user-admin/user-admin.factor

index ac2e902c86a82d4fc650284594ddec94bf56ac15..48c0ce6ed9af6628ec5ed7b634e1bc6ba5b7de53 100644 (file)
@@ -264,7 +264,7 @@ ERROR: invalid-timestamp-format ;
     [ (hms>timestamp) ] with-string-reader ;\r
 \r
 : (ymd>timestamp) ( -- timestamp )\r
-    read-ymd 0 0 0 instant <timestamp> ;\r
+    read-ymd <date-gmt> ;\r
 \r
 : ymd>timestamp ( str -- timestamp )\r
     [ (ymd>timestamp) ] with-string-reader ;\r
index 524875ecd0b9655f0c6d9fde289dd8b1ee41d234..4d4d553be86f524167c1465292af326068534309 100644 (file)
@@ -297,7 +297,7 @@ SPECIALIZED-ARRAY: struct-test-optimization
 
 [ t ] [ [ struct-test-optimization memory>struct y>> ] { memory>struct y>> } inlined? ] unit-test
 [ t ] [
-    [ 3 <direct-struct-test-optimization-array> third y>> ]
+    [ 3 struct-test-optimization <c-direct-array> third y>> ]
     { <tuple> <tuple-boa> memory>struct y>> } inlined?
 ] unit-test
 
index 3f67ad3d8377e26b704031981a85ff48ac5fa427..961d3d34b42317e595fefcc060544dccb27b3a8a 100644 (file)
@@ -128,7 +128,7 @@ GENERIC: write-full-response ( request response -- )
     over unparse-content-type "content-type" pick set-at
     over cookies>> [
         ensure-domain unparse-set-cookie
-        "set-cookie" swap 2array over push
+        "set-cookie" swap 2array suffix!
     ] each
     write-header ;
 
index 95b851d5f75ecb81c6a88b4eec7d5b6faba255ea..fd6e808957627db649b114dba80bb233966e01ed 100644 (file)
@@ -52,29 +52,29 @@ ERROR: json-error ;
     dup last V{ } = not [ v-over-push ] when ;
 
 : (close-array) ( accum -- accum' )
-    (close) dup pop >array over push ;
+    (close) dup pop >array suffix! ;
 
 : (close-hash) ( accum -- accum' )
-    (close) dup dup [ pop ] bi@ swap zip >hashtable over push ;
+    (close) dup dup [ pop ] bi@ swap zip >hashtable suffix! ;
 
 : scan ( accum char -- accum )
     ! 2dup 1string swap . . ! Great for debug...
     {
-        { CHAR: \" [ j-string over push ] }
-        { CHAR: [  [ V{ } clone over push ] }
+        { CHAR: \" [ j-string suffix! ] }
+        { CHAR: [  [ V{ } clone suffix! ] }
         { CHAR: ,  [ v-over-push ] }
         { CHAR: ]  [ (close-array) ] }
-        { CHAR: {  [ 2 [ V{ } clone over push ] times ] }
+        { CHAR: {  [ 2 [ V{ } clone suffix! ] times ] }
         { CHAR: :  [ v-pick-push ] }
         { CHAR: }  [ (close-hash) ] }
         { CHAR: \s [ ] }
         { CHAR: \t [ ] }
         { CHAR: \r [ ] }
         { CHAR: \n [ ] }
-        { CHAR: t  [ 3 read drop t over push ] }
-        { CHAR: f  [ 4 read drop f over push ] }
-        { CHAR: n  [ 3 read drop json-null over push ] }
-        [ value [ over push ] dip [ scan ] when*  ]
+        { CHAR: t  [ 3 read drop t suffix! ] }
+        { CHAR: f  [ 4 read drop f suffix! ] }
+        { CHAR: n  [ 3 read drop json-null suffix! ] }
+        [ value [ suffix! ] dip [ scan ] when*  ]
     } case ;
 
 PRIVATE>
index 32f683bbc6299df307519e4d077f9c82b640ea98..509d1d3ca0e651e47203e82bafde87b811b95dfa 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays assocs combinators combinators.smart fry kernel
 macros math math.bits sequences sequences.private words
-byte-arrays alien alien.c-types specialized-arrays ;
+byte-arrays alien alien.c-types alien.data specialized-arrays ;
 SPECIALIZED-ARRAY: uchar
 IN: math.bitwise
 
@@ -117,7 +117,7 @@ M: byte-array bit-count
     byte-array-bit-count ;
 
 M: object bit-count
-    binary-object <direct-uchar-array> byte-array-bit-count ;
+    binary-object uchar <c-direct-array> byte-array-bit-count ;
 
 : even-parity? ( obj -- ? ) bit-count even? ;
 
index 1cc7d1462ae5272e4135f1edb43d4d5613605b3b..17739cdac5d4bf628879449716cce6d052c583af 100644 (file)
@@ -124,7 +124,7 @@ PRIVATE>
     <combo> apply-combination ;
 
 : all-combinations ( seq k -- seq' )
-    [ ] combinations-quot map ;
+    [ ] map-combinations ;
 
 : reduce-combinations ( seq k identity quot -- result )
     [ -rot ] dip each-combination ; inline
index 966adb3db4e28d02e6b203e0a25290727c67fb07..e85d71e7a605336356289afd01f38f23f3ab369d 100644 (file)
@@ -8,8 +8,8 @@ IN: math.polynomials
 
 : 2pad-head ( p q n -- p q ) [ 0 pad-head ] curry bi@ ;
 : 2pad-tail ( p q n -- p q ) [ 0 pad-tail ] curry bi@ ;
-: pextend ( p q -- p q ) 2dup [ length ] bi@ max 2pad-tail ;
-: pextend-left ( p q -- p q ) 2dup [ length ] bi@ max 2pad-head ;
+: pextend ( p q -- p q ) 2dup max-length 2pad-tail ;
+: pextend-left ( p q -- p q ) 2dup max-length 2pad-head ;
 : unempty ( seq -- seq ) [ { 0 } ] when-empty ;
 : 2unempty ( seq seq -- seq seq ) [ unempty ] bi@ ;
 
index 6b1348ca88aef3b9aebfaf0e21d9f8acd774e084..05febe4ba8afb3230f61d9ae5024d38553e28f19 100644 (file)
@@ -17,7 +17,7 @@ IN: math.rectangles.positioning
     [ loc>> first ] 2dip swap [ first ] bi@ - min 0 max ;
 
 : preferred-y ( visible-rect -- y )
-    [ loc>> ] [ dim>> ] bi [ second ] bi@ + ;
+    rect-bounds [ second ] bi@ + ;
 
 : alternate-y ( visible-rect popup-dim -- y )
     [ loc>> ] dip [ second ] bi@ - ;
@@ -42,4 +42,4 @@ PRIVATE>
 
 : popup-rect ( visible-rect popup-dim screen-dim -- rect )
     [ adjust-visible-rect ] 2keep
-    [ popup-loc dup ] 2keep popup-dim <rect> ;
\ No newline at end of file
+    [ popup-loc dup ] 2keep popup-dim <rect> ;
index 455332dfb840b5fc0d93ed9514c78e8b2c761b80..46b24bc98b24b297f4eea37e02fd60d61b6ea5d0 100644 (file)
@@ -92,7 +92,7 @@ PRIVATE>
 
 : mode ( seq -- x )
     histogram >alist
-    [ ] [ [ [ second ] bi@ > ] 2keep ? ] map-reduce first ;
+    [ ] [ [ [ second ] bi@ > ] most ] map-reduce first ;
 
 ERROR: empty-sequence ;
 
index 2232f32891342a76cf15ecf61b41a8f4b4ece64a..f4165d7e20934d7b5bc62d4e571e2931a257da18 100644 (file)
@@ -42,7 +42,7 @@ reset-gl-function-number-counter
     '[ @  _ _ _ alien-indirect ] ;
 
 :: define-indirect ( abi return function-name function-ptr-quot types names -- )
-    function-name create-in dup reset-generic
+    function-name create-function
     function-ptr-quot return types abi indirect-quot
     names return function-effect
     define-declared ;
index 76806f9523c0151a1d0500ff17abbc6dbcb5c314..9315e43a392c5a39bc5ecdb65b6fb82cb8eaca52 100644 (file)
@@ -12,7 +12,7 @@ SINGLETON: openssl
     ERR_clear_error f ERR_error_string ;
 
 : ssl-error-string ( -- string )
-    ERR_get_error ERR_clear_error f ERR_error_string ;
+    ERR_get_error (ssl-error-string) ;
 
 : (ssl-error) ( -- * )
     ssl-error-string throw ;
index 04e4affe39496333e97443f441193cdbbf7e5bdd..3b12ef80a255920f547c6e6ccadbdf0cd1077cff 100644 (file)
@@ -16,12 +16,12 @@ MEMO: any-char-parser ( -- parser )
   [ drop t ] satisfy ;
 
 : search ( string parser -- seq )
-  any-char-parser [ drop f ] action 2array choice repeat0 
+  any-char-parser [ drop f ] action 2choice repeat0
   [ parse sift ] [ 3drop { } ] recover ;
 
 
 : (replace) ( string parser -- seq )
-  any-char-parser 2array choice repeat0 parse sift ;
+  any-char-parser 2choice repeat0 parse sift ;
 
 : replace ( string parser -- result )
  [  (replace) [ tree-write ] each ] with-string-writer ;
index 190db9e9ab88d0342c3661ee61e4f6f16d2bd527..1aeb4e0f41bc1164fc6668c76c11a142a165974f 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: layouts kernel parser math sequences ;
+USING: layouts kernel parser math math.bitwise sequences ;
 IN: persistent.hashtables.config
 
 : radix-bits ( -- n ) << cell 4 = 4 5 ? suffix! >> ; foldable
-: radix-mask ( -- n ) radix-bits 2^ 1 - ; foldable
-: full-bitmap-mask ( -- n ) radix-bits 2^ 2^ 1 - ; inline
+: radix-mask ( -- n ) radix-bits on-bits ; foldable
+: full-bitmap-mask ( -- n ) radix-bits 2^ on-bits ; inline
index fb210c5ef2040974a4e285ada7ad4242f3593d13..a28921f4a0e365803d85c5a5ec799b0ee7760ba2 100644 (file)
@@ -137,8 +137,8 @@ M: LETTER-class modify-class modify-letter-class ;
 
 : cased-range? ( range -- ? )
     [ from>> ] [ to>> ] bi {
-        [ [ letter? ] bi@ and ]
-        [ [ LETTER? ] bi@ and ]
+        [ [ letter? ] both? ]
+        [ [ LETTER? ] both? ]
     } 2|| ;
 
 M: range-class modify-class
index 88fae781ea2303e521e9fe6f0f8d84313bf9056e..0cc124c088dbb0e2dc812b531e019f7a063b23c6 100644 (file)
@@ -88,8 +88,7 @@ TUPLE: entry title url description date ;
     } cleave ;
 
 : atom1.0 ( xml -- feed )
-    feed new
-    swap
+    <feed> swap
     [ "title" tag-named children>string >>title ]
     [ "link" tag-named "href" attr >url >>url ]
     [ "entry" tags-named [ atom1.0-entry ] map set-entries ]
index 2ca94389638cd4ba6e7bc0997605b8bf6d833499..7fa68b41ff787a3a6e813ab0900c6a4b46d8a75c 100755 (executable)
@@ -415,7 +415,7 @@ IN: tools.deploy.shaker
     ! On Windows, even if deploy-io is 3, C streams are still used
     ! for the console, so don't strip it there.
     strip-io?
-    deploy-io get 3 = os windows? not and
+    native-io? os windows? not and
     or [
         "Stripping C I/O" show
         "vocab:tools/deploy/shaker/strip-c-io.factor" run-file
index 46610c487db4c2ed4f68f44ffd882882a151e60b..6f4b1d5b34fbf42fa079e50524eca0480a3fcc15 100755 (executable)
@@ -43,8 +43,8 @@ STRUCT: group-directory-entry
 :: ico-group-and-icons ( bytes -- group-bytes icon-bytes )
     bytes ico-header memory>struct :> header
 
-    ico-header heap-size bytes <displaced-alien> 
-    header ImageCount>> <direct-ico-directory-entry-array> :> directory
+    ico-header heap-size bytes <displaced-alien>
+    header ImageCount>> ioc-directory-entry <c-direct-array> :> directory
 
     directory dup length iota [ ico>group-directory-entry ] { } 2map-as
         :> group-directory
index 6b97361864ced4603b420ae5cc56508f507db602..99a4e720d5deb964dcc7cdf9fec5dc05c8ec0d5f 100644 (file)
@@ -167,7 +167,7 @@ ERROR: vocab-name-contains-dot path ;
 : $values. ( word -- )
     "declared-effect" word-prop [
         [ in>> ] [ out>> ] bi
-        2dup [ empty? ] bi@ and [
+        2dup [ empty? ] both? [
             2drop
         ] [
             [ members ] dip over diff
index f7f0ae4a695dd0b505ed1c743239945cdcccf6ca..fcc76071dc739113fc78ad609faf0cd3b11f6428 100644 (file)
@@ -15,7 +15,7 @@ exclude-vocabs { "math" "accessors" } swap set-global
 <PRIVATE
 
 : callstack-depth ( callstack -- n )
-    callstack>array length 2/ ;
+    callstack>array midpoint@ ;
 
 SYMBOL: end
 
@@ -87,4 +87,4 @@ PRIVATE>
     [ break ] [ end drop ] surround
     with-variable ;
 
-<< \ trace t "no-compile" set-word-prop >>
\ No newline at end of file
+<< \ trace t "no-compile" set-word-prop >>
index 4a68b47f15fdf14ec67bf8c2a5b6ada1a5aeafdd..44ce92ed8df302098337d5222739091db8ac728c 100644 (file)
@@ -137,7 +137,7 @@ CONSTANT: button-clicked-background COLOR: FactorDarkSlateBlue
     dup label? [ [ clone t >>bold? ] change-font ] when drop ;
 
 : border-button-theme ( gadget -- gadget )
-    dup children>> first border-button-label-theme
+    dup gadget-child border-button-label-theme
     horizontal >>orientation
     <border-button-pen> >>interior
     dup dup interior>> pen-pref-dim >>min-dim
index 867a53eb68e871adb8e2cfb8c47bc3dbb755673a..c47bafba2a48af848b707969fd92b1343a6a53cf 100644 (file)
@@ -142,12 +142,11 @@ elevator H{
     [ slider>screen elevator-padding + ] tri ;
 
 : layout-thumb-loc ( thumb slider -- )
-    [ thumb-loc ] [ orientation>> ] bi n*v
-    [ floor ] map >>loc drop ;
+    [ thumb-loc ] [ orientation>> ] bi n*v vfloor >>loc drop ;
 
 : layout-thumb-dim ( thumb slider -- )
     [ dim>> ] [ thumb-dim ] [ orientation>> ] tri [ n*v ] keep set-axis
-    [ ceiling ] map >>dim drop ;
+    vceiling >>dim drop ;
 
 : slider-enabled? ( slider -- ? )
     visible-portion 1 = not ;
index bd877e66e45d059947f7033f27acef1a8ae18afb..0a24a00c250a50486379f678d77851bc6b8ad2c7 100644 (file)
@@ -318,7 +318,7 @@ M: object accept-completion-hook 2drop ;
 
 : quot-action ( interactor -- lines )
     [ history>> history-add drop ] [ control-value ] [ select-all ] tri
-    [ parse-lines ] with-compilation-unit ;
+    parse-lines-interactive ;
 
 : <debugger-popup> ( error continuation -- popup )
     over compute-restarts [ hide-glass ] <debugger> "Error" <labeled-gadget> ;
index 73519e105c396a53ba0affaaac40012213a79d2b..4daa0599111ff1f6a89631466bd218709aef5980 100644 (file)
@@ -250,7 +250,7 @@ M: mark-previous-rule handle-rule-start
 
 : rule-set-empty? ( ruleset -- ? )
     [ rules>> ] [ keywords>> ] bi
-    [ assoc-empty? ] bi@ and ;
+    [ assoc-empty? ] both? ;
 
 : check-word-break ( -- ? )
     current-char dup blank? [
index 49e5ec30ccb3ff8cb747ff5c326f380cc8a1ca6c..9c8efbfbb101fbe4ef722d87b6926438fe319232 100644 (file)
@@ -3,7 +3,7 @@
 USING: kernel math math.private math.order ;
 IN: math.floats.private
 
-: float-unordered? ( x y -- ? ) [ fp-nan? ] bi@ or ;
+: float-unordered? ( x y -- ? ) [ fp-nan? ] either? ;
 : float-min ( x y -- z ) [ float< ] most ; foldable
 : float-max ( x y -- z ) [ float> ] most ; foldable
 
index 31ab2e7da9b544dcf542d52b543b8ebf1b9a25e0..2d8f00dac527a0cc5a6b3a6b01afc9c3c566856c 100644 (file)
@@ -351,7 +351,7 @@ M: ratio >base
 
 : float>hex-value ( mantissa -- str )
     >hex 13 CHAR: 0 pad-head [ CHAR: 0 = ] trim-tail
-    [ "0" ] [ ] if-empty "1." prepend ;
+    [ "0" ] when-empty "1." prepend ;
 
 : float>hex-expt ( mantissa -- str )
     10 >base "p" prepend ;
index b48641d723b19bce1fcb19c9b18cec54679a4c92..f7f66da37ca88d49b5c441afb62b7bde5b5bc55d 100644 (file)
@@ -4,10 +4,10 @@ USING: math math.order kernel ;
 IN: math.compare
 
 : absmin ( a b -- x )
-    [ [ abs ] bi@ < ] 2keep ? ;
+    [ [ abs ] bi@ < ] most ;
 
 : absmax ( a b -- x )
-    [ [ abs ] bi@ > ] 2keep ? ;
+    [ [ abs ] bi@ > ] most ;
 
 : posmax ( a b -- x )
     0 max max ;
index 6460fcf97097b44447933fff36f5f5097978125a..e2fce058812d4aad1fc7ecf3bf70650ec543892a 100644 (file)
@@ -32,7 +32,7 @@ IN: project-euler.044
     dup 3 * 1 - * 2 /i ; inline
 
 : sum-and-diff? ( m n -- ? )
-    [ + ] [ - ] 2bi [ pentagonal? ] bi@ and ; inline
+    [ + ] [ - ] 2bi [ pentagonal? ] both? ; inline
 
 : euler044-step ( min m n -- min' )
     [ nth-pentagonal ] bi@
index af039ef8c44792c63b3492cca3248331fe017975..1afdb3f027a9d057cbade8d0de3c289f34a8c20a 100644 (file)
@@ -40,7 +40,7 @@ visit-time request-rate crawl-delay unknowns ;
     [ first "sitemap" = ] partition [ values ] dip
     [
         {
-            [ [ first "user-agent" = ] bi@ and ]
+            [ [ first "user-agent" = ] both? ]
             [ nip first "user-agent" = not ]
         } 2|| 
     ] monotonic-split ;
index 700cf56e20535d22afb919a56a28db6fcbb95a09..2cc97fb6279f4d5d6bd307a5cb1bbb440a7b967d 100644 (file)
@@ -32,7 +32,7 @@ TUPLE: user-admin < dispatcher ;
     [ [ param empty? not ] keep set-value ] each ;
 
 : selected-capabilities ( -- seq )
-    "capabilities" value [ value ] filter [ string>word ] map ;
+    "capabilities" value [ value ] filter strings>words ;
 
 : validate-user ( -- )
     {