From 8c1165cac109ea20da28e3e917e0747c039a243f Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Wed, 18 Apr 2012 17:46:01 -0700 Subject: [PATCH] cleanup some lint warnings. --- basis/stack-checker/inlining/inlining.factor | 2 +- basis/ui/commands/commands.factor | 4 ++-- basis/ui/gadgets/packs/packs.factor | 2 +- basis/ui/pens/polygon/polygon.factor | 2 +- basis/ui/tools/browser/popups/popups.factor | 2 +- basis/ui/ui.factor | 2 +- core/effects/effects.factor | 2 +- core/sequences/sequences.factor | 3 +-- extra/benchmark/dispatch2/dispatch2.factor | 2 +- extra/ctags/etags/etags.factor | 7 ++----- 10 files changed, 12 insertions(+), 16 deletions(-) diff --git a/basis/stack-checker/inlining/inlining.factor b/basis/stack-checker/inlining/inlining.factor index 697e668409..100201d545 100644 --- a/basis/stack-checker/inlining/inlining.factor +++ b/basis/stack-checker/inlining/inlining.factor @@ -65,7 +65,7 @@ SYMBOL: enter-out : check-return ( word label -- ) 2dup - [ stack-effect effect-height ] + [ stack-height ] [ entry-stack-height current-stack-height swap - ] bi* = [ 2drop ] [ diff --git a/basis/ui/commands/commands.factor b/basis/ui/commands/commands.factor index fe9bc19c1e..877f4b32c7 100644 --- a/basis/ui/commands/commands.factor +++ b/basis/ui/commands/commands.factor @@ -42,7 +42,7 @@ GENERIC: command-word ( command -- word ) ] H{ } make-assoc ; : update-gestures ( class -- ) - dup command-gestures "gestures" set-word-prop ; + dup command-gestures set-gestures ; : define-command-map ( class group blurb pairs -- ) @@ -79,4 +79,4 @@ M: word invoke-command ( target command -- ) M: word command-word ; -M: f invoke-command ( target command -- ) 2drop ; \ No newline at end of file +M: f invoke-command ( target command -- ) 2drop ; diff --git a/basis/ui/gadgets/packs/packs.factor b/basis/ui/gadgets/packs/packs.factor index 09a0e222d8..b50187904b 100644 --- a/basis/ui/gadgets/packs/packs.factor +++ b/basis/ui/gadgets/packs/packs.factor @@ -39,7 +39,7 @@ TUPLE: pack < gadget : round-dims ( seq -- newseq ) [ { 0 0 } ] dip - [ swap v- dup [ ceiling ] map [ swap v- ] keep ] map + [ swap v- dup vceiling [ swap v- ] keep ] map nip ; PRIVATE> diff --git a/basis/ui/pens/polygon/polygon.factor b/basis/ui/pens/polygon/polygon.factor index 0907cb6867..2f84d77f1c 100644 --- a/basis/ui/pens/polygon/polygon.factor +++ b/basis/ui/pens/polygon/polygon.factor @@ -35,5 +35,5 @@ M: polygon draw-interior tri ; : ( color points -- gadget ) - [ ] [ { 0 0 } [ vmax ] reduce ] bi + [ ] [ max-dim ] bi [ ] 2dip [ >>interior ] [ >>dim ] bi* ; diff --git a/basis/ui/tools/browser/popups/popups.factor b/basis/ui/tools/browser/popups/popups.factor index b5ceda461e..411321bf85 100644 --- a/basis/ui/tools/browser/popups/popups.factor +++ b/basis/ui/tools/browser/popups/popups.factor @@ -44,7 +44,7 @@ SLOT: model : show-links-popup ( browser-gadget quot title -- ) [ dup model>> ] 2dip - [ hand-loc get { 0 0 } show-glass ] [ request-focus ] bi ; inline + [ hand-loc get point>rect show-glass ] [ request-focus ] bi ; inline : com-show-outgoing-links ( browser-gadget -- ) [ uses ] "Outgoing links" show-links-popup ; diff --git a/basis/ui/ui.factor b/basis/ui/ui.factor index 4917b3697b..766d128c1f 100644 --- a/basis/ui/ui.factor +++ b/basis/ui/ui.factor @@ -171,7 +171,7 @@ PRIVATE> call( -- ) notify-ui-thread start-ui-thread ; : ?attributes ( gadget title/attributes -- attributes ) - dup string? [ world-attributes new swap >>title ] [ clone ] if + dup string? [ swap >>title ] [ clone ] if swap [ [ [ 1array ] [ f ] if* ] curry unless* ] curry change-gadgets ; PRIVATE> diff --git a/core/effects/effects.factor b/core/effects/effects.factor index 785a5d21f2..650e6b79c5 100644 --- a/core/effects/effects.factor +++ b/core/effects/effects.factor @@ -99,7 +99,7 @@ M: effect clone [ in>> clone ] [ out>> clone ] bi ; : stack-height ( word -- n ) - stack-effect effect-height ; + stack-effect effect-height ; inline : shuffle-mapping ( effect -- mapping ) [ out>> ] [ in>> ] bi [ index ] curry map ; diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index b0dc63fa98..79847b0abf 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -664,8 +664,7 @@ PRIVATE> : prefix ( seq elt -- newseq ) over [ over length 1 + ] dip [ - [ 0 swap set-nth-unsafe ] keep - [ 1 swap copy ] keep + (1sequence) [ 1 swap copy ] keep ] new-like ; : suffix ( seq elt -- newseq ) diff --git a/extra/benchmark/dispatch2/dispatch2.factor b/extra/benchmark/dispatch2/dispatch2.factor index 7db583d42a..60a37e95d9 100644 --- a/extra/benchmark/dispatch2/dispatch2.factor +++ b/extra/benchmark/dispatch2/dispatch2.factor @@ -27,6 +27,6 @@ IN: benchmark.dispatch2 : dispatch-test ( -- ) 1000000 sequences - [ [ 0 swap nth don't-flush-me ] each ] curry times ; + [ [ first don't-flush-me ] each ] curry times ; MAIN: dispatch-test diff --git a/extra/ctags/etags/etags.factor b/extra/ctags/etags/etags.factor index b8177653ae..baee3c4911 100644 --- a/extra/ctags/etags/etags.factor +++ b/extra/ctags/etags/etags.factor @@ -43,9 +43,6 @@ IN: ctags.etags 1 - lines>bytes number>string % ] "" make ; -: etag-length ( vector -- n ) - 0 [ length + ] reduce ; - : (etag-header) ( n path -- str ) [ % @@ -63,8 +60,8 @@ IN: ctags.etags [ first file>lines ] [ second ] bi [ etag ] with map - dup etag-length - ] keep first + dup sum-lengths + ] keep first etag-header append ] each ;