basis/extra: replace "/ >integer" with "/i" in a few places.

master
John Benediktsson 2020-05-16 11:17:42 -07:00
parent 68f6eeb3ad
commit 5f89facf9e
6 changed files with 8 additions and 8 deletions

View File

@ -86,7 +86,7 @@ render-loc render-dim ;
: selection-rect ( dim line selection -- rect ) : selection-rect ( dim line selection -- rect )
[let [ start>> ] [ end>> ] [ string>> ] tri :> ( start end string ) [let [ start>> ] [ end>> ] [ string>> ] tri :> ( start end string )
start end [ 0 swap string subseq utf16n encode length 2 / >integer ] bi@ start end [ 0 swap string subseq utf16n encode length 2 /i ] bi@
] ]
[ f CTLineGetOffsetForStringIndex round ] bi-curry@ bi [ f CTLineGetOffsetForStringIndex round ] bi-curry@ bi
[ drop nip 0 ] [ swap - swap second ] 3bi <CGRect> ; [ drop nip 0 ] [ swap - swap second ] 3bi <CGRect> ;

View File

@ -195,7 +195,7 @@ IMPORT: NSAttributedString
0 utf16-index 2 * str utf16n encode subseq utf16n decode length ; 0 utf16-index 2 * str utf16n encode subseq utf16n decode length ;
:: >utf16-index ( str codepoint-index -- utf16-index ) :: >utf16-index ( str codepoint-index -- utf16-index )
0 codepoint-index str subseq utf16n encode length 2 / >integer ; 0 codepoint-index str subseq utf16n encode length 2 /i ;
:: earlier-caret/mark ( editor -- loc ) :: earlier-caret/mark ( editor -- loc )
editor editor-caret :> caret editor editor-caret :> caret

View File

@ -54,8 +54,8 @@ M:: core-text-renderer x>offset ( x font string -- n )
] if-empty ; ] if-empty ;
M:: core-text-renderer offset>x ( n font string -- x ) M:: core-text-renderer offset>x ( n font string -- x )
font string cached-line line>> font string cached-line line>>
0 n string subseq utf16n encode length 2 / >integer 0 n string subseq utf16n encode length 2 /i
f f
CTLineGetOffsetForStringIndex unscale ; CTLineGetOffsetForStringIndex unscale ;

View File

@ -20,7 +20,7 @@ CONSTANT: ssa-dwFlags flags{ SSA_GLYPHS SSA_FALLBACK SSA_TAB }
0 utf16-index 2 * str utf16n encode subseq utf16n decode length ; 0 utf16-index 2 * str utf16n encode subseq utf16n decode length ;
:: >utf16-index ( str codepoint-index -- utf16-index ) :: >utf16-index ( str codepoint-index -- utf16-index )
0 codepoint-index str subseq utf16n encode length 2 / >integer ; 0 codepoint-index str subseq utf16n encode length 2 /i ;
PRIVATE> PRIVATE>
@ -48,7 +48,7 @@ PRIVATE>
: make-ssa ( dc script-string -- ssa ) : make-ssa ( dc script-string -- ssa )
dup selection? [ string>> ] when dup selection? [ string>> ] when
utf16n encode ! pString utf16n encode ! pString
dup length 2 / >integer ! cString dup length 2 /i ! cString
dup 1.5 * 16 + >integer ! cGlyphs -- MSDN says this is "recommended size" dup 1.5 * 16 + >integer ! cGlyphs -- MSDN says this is "recommended size"
-1 ! iCharset -- Unicode -1 ! iCharset -- Unicode
ssa-dwFlags ssa-dwFlags

View File

@ -25,7 +25,7 @@ LOGIC-VARS: S E N D M O R Y A L G B T
{ delo D Digs3 Digs } { delo D Digs3 Digs }
[ [ [ D1 of ] [ D2 of ] [ C1 of ] tri + + ] S is ] [ [ [ D1 of ] [ D2 of ] [ C1 of ] tri + + ] S is ]
[ [ S of 10 mod ] D is ] [ [ S of 10 mod ] D is ]
[ [ S of 10 / >integer ] C is ] [ [ S of 10 /i ] C is ]
} rule } rule
{ delo A L L } { { nonvaro A } !! } rule { delo A L L } { { nonvaro A } !! } rule

View File

@ -147,7 +147,7 @@ C: <cfrac> cfrac
:: split ( fr -- k fr' ) :: split ( fr -- k fr' )
fr >cfrac< :> ( n a b ) fr >cfrac< :> ( n a b )
n sqrt a + b / >integer n sqrt a + b /i
dup n swap dup n swap
b * a swap - b * a swap -
b b