change c-type-* to c-* everywhere
parent
361cc04b02
commit
0df9884ee5
|
@ -35,8 +35,8 @@ M: array stack-size drop "void*" stack-size ;
|
||||||
M: array c-type-boxer-quot
|
M: array c-type-boxer-quot
|
||||||
unclip
|
unclip
|
||||||
[ array-length ]
|
[ array-length ]
|
||||||
[ [ require-c-type-arrays ] keep ] bi*
|
[ [ require-c-arrays ] keep ] bi*
|
||||||
[ <c-type-direct-array> ] 2curry ;
|
[ <c-direct-array> ] 2curry ;
|
||||||
|
|
||||||
M: array c-type-unboxer-quot drop [ >c-ptr ] ;
|
M: array c-type-unboxer-quot drop [ >c-ptr ] ;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ USING: accessors kernel classes.struct cocoa cocoa.types alien.c-types
|
||||||
locals math sequences vectors fry libc destructors ;
|
locals math sequences vectors fry libc destructors ;
|
||||||
IN: cocoa.enumeration
|
IN: cocoa.enumeration
|
||||||
|
|
||||||
<< "id" require-c-type-arrays >>
|
<< "id" require-c-arrays >>
|
||||||
|
|
||||||
CONSTANT: NS-EACH-BUFFER-SIZE 16
|
CONSTANT: NS-EACH-BUFFER-SIZE 16
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ CONSTANT: NS-EACH-BUFFER-SIZE 16
|
||||||
:: (NSFastEnumeration-each) ( object quot: ( elt -- ) state stackbuf count -- )
|
:: (NSFastEnumeration-each) ( object quot: ( elt -- ) state stackbuf count -- )
|
||||||
object state stackbuf count -> countByEnumeratingWithState:objects:count: :> items-count
|
object state stackbuf count -> countByEnumeratingWithState:objects:count: :> items-count
|
||||||
items-count 0 = [
|
items-count 0 = [
|
||||||
state itemsPtr>> [ items-count "id" <c-type-direct-array> ] [ stackbuf ] if* :> items
|
state itemsPtr>> [ items-count "id" <c-direct-array> ] [ stackbuf ] if* :> items
|
||||||
items-count iota [ items nth quot call ] each
|
items-count iota [ items nth quot call ] each
|
||||||
object quot state stackbuf count (NSFastEnumeration-each)
|
object quot state stackbuf count (NSFastEnumeration-each)
|
||||||
] unless ; inline recursive
|
] unless ; inline recursive
|
||||||
|
|
|
@ -54,13 +54,13 @@ ERROR: bad-byte-array-length byte-array ;
|
||||||
|
|
||||||
INSTANCE: struct-array sequence
|
INSTANCE: struct-array sequence
|
||||||
|
|
||||||
M: struct-type <c-type-array> ( len c-type -- array )
|
M: struct-type <c-array> ( len c-type -- array )
|
||||||
dup c-type-array-constructor
|
dup c-array-constructor
|
||||||
[ execute( len -- array ) ]
|
[ execute( len -- array ) ]
|
||||||
[ <struct-array> ] ?if ; inline
|
[ <struct-array> ] ?if ; inline
|
||||||
|
|
||||||
M: struct-type <c-type-direct-array> ( alien len c-type -- array )
|
M: struct-type <c-direct-array> ( alien len c-type -- array )
|
||||||
dup c-type-direct-array-constructor
|
dup c-direct-array-constructor
|
||||||
[ execute( alien len -- array ) ]
|
[ execute( alien len -- array ) ]
|
||||||
[ <direct-struct-array> ] ?if ; inline
|
[ <direct-struct-array> ] ?if ; inline
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue