diff --git a/basis/alien/data/data-docs.factor b/basis/alien/data/data-docs.factor index 7828b3896f..e860ff6889 100644 --- a/basis/alien/data/data-docs.factor +++ b/basis/alien/data/data-docs.factor @@ -1,7 +1,7 @@ USING: alien alien.c-types help.syntax help.markup libc kernel.private byte-arrays math strings hashtables alien.syntax alien.strings sequences io.encodings.string debugger destructors -vocabs.loader classes.struct quotations ; +vocabs.loader classes.struct quotations kernel ; IN: alien.data HELP: @@ -189,14 +189,14 @@ $nl "For example, if a C function returns a " { $link c-string } " but stipulates that the caller must deallocate the memory afterward, you must define the function as returning " { $snippet "char*" } " and call " { $link (free) } " yourself." ; HELP: -{ $values { "c-type" "a C type" } } +{ $values { "value" object } { "c-type" "a C type" } { "c-ptr" c-ptr } } { $description "Creates a new byte array to store a Factor object as a C value." } { $examples { $example "USING: alien.c-types alien.data prettyprint sequences ;" "123 int length ." "4" } } ; HELP: deref -{ $values { "c-type" "a C type" } } +{ $values { "c-ptr" c-ptr } { "c-type" "a C type" } { "value" object } } { $description "Loads a C value from a byte array." } { $examples { $example "USING: alien.c-types alien.data prettyprint sequences ;" "321 int int deref ." "321" } diff --git a/basis/alien/data/data-tests.factor b/basis/alien/data/data-tests.factor index 33ee26dc28..7d53c71815 100644 --- a/basis/alien/data/data-tests.factor +++ b/basis/alien/data/data-tests.factor @@ -1,31 +1,32 @@ -USING: alien alien.c-types alien.data alien.syntax +USING: alien alien.data alien.syntax classes.struct kernel sequences specialized-arrays -specialized-arrays.private tools.test compiler.units vocabs ; +specialized-arrays.private tools.test compiler.units vocabs +system ; +QUALIFIED-WITH: alien.c-types c IN: alien.data.tests - -[ -1 ] [ -1 char char deref ] unit-test -[ -1 ] [ -1 short short deref ] unit-test -[ -1 ] [ -1 int int deref ] unit-test +[ -1 ] [ -1 c:char c:char deref ] unit-test +[ -1 ] [ -1 c:short c:short deref ] unit-test +[ -1 ] [ -1 c:int c:int deref ] unit-test ! I don't care if this throws an error or works, but at least ! it should be consistent between platforms -[ -1 ] [ -1.0 int int deref ] unit-test -[ -1 ] [ -1.0 long long deref ] unit-test -[ -1 ] [ -1.0 longlong longlong deref ] unit-test -[ 1 ] [ 1.0 uint uint deref ] unit-test -[ 1 ] [ 1.0 ulong ulong deref ] unit-test -[ 1 ] [ 1.0 ulonglong ulonglong deref ] unit-test +[ -1 ] [ -1.0 c:int c:int deref ] unit-test +[ -1 ] [ -1.0 c:long c:long deref ] unit-test +[ -1 ] [ -1.0 c:longlong c:longlong deref ] unit-test +[ 1 ] [ 1.0 c:uint c:uint deref ] unit-test +[ 1 ] [ 1.0 c:ulong c:ulong deref ] unit-test +[ 1 ] [ 1.0 c:ulonglong c:ulonglong deref ] unit-test [ - 0 B{ 1 2 3 4 } void* + 0 B{ 1 2 3 4 } c:void* ] must-fail os windows? cpu x86.64? and [ - [ -2147467259 ] [ 2147500037 long long deref ] unit-test + [ -2147467259 ] [ 2147500037 c:long c:long deref ] unit-test ] when -STRUCT: foo { a int } { b void* } { c bool } ; +STRUCT: foo { a c:int } { b c:void* } { c c:bool } ; SPECIALIZED-ARRAY: foo diff --git a/basis/alien/fortran/fortran-tests.factor b/basis/alien/fortran/fortran-tests.factor index 38e0d5f27a..ad2a60ddc4 100644 --- a/basis/alien/fortran/fortran-tests.factor +++ b/basis/alien/fortran/fortran-tests.factor @@ -239,7 +239,7 @@ intel-unix-abi fortran-abi [ [ [ ! [] - [ complex-float ] 1 ndip + [ complex-float heap-size ] 1 ndip ! [fortran-args>c-args] { [ { [ ] } spread ] [ { [ drop ] } spread ] } 1 ncleave ! [fortran-invoke] diff --git a/basis/compiler/tree/cleanup/cleanup-tests.factor b/basis/compiler/tree/cleanup/cleanup-tests.factor index aedab2b40c..dfce70ae38 100644 --- a/basis/compiler/tree/cleanup/cleanup-tests.factor +++ b/basis/compiler/tree/cleanup/cleanup-tests.factor @@ -1,11 +1,11 @@ USING: tools.test kernel.private kernel arrays sequences math.private math generic words quotations alien alien.c-types -strings sbufs sequences.private slots.private combinators -definitions system layouts vectors math.partial-dispatch -math.order math.functions accessors hashtables classes assocs -io.encodings.utf8 io.encodings.ascii io.encodings fry slots -sorting.private combinators.short-circuit grouping prettyprint -generalizations +alien.data strings sbufs sequences.private slots.private +combinators definitions system layouts vectors +math.partial-dispatch math.order math.functions accessors +hashtables classes assocs io.encodings.utf8 io.encodings.ascii +io.encodings fry slots sorting.private combinators.short-circuit +grouping prettyprint generalizations compiler.tree compiler.tree.combinators compiler.tree.cleanup @@ -521,8 +521,6 @@ cell-bits 32 = [ ] cleaned-up-tree nodes>quot ] unit-test -USING: alien alien.c-types ; - [ t ] [ [ int { } cdecl [ 2 2 + ] alien-callback ] { + } inlined? diff --git a/basis/specialized-arrays/specialized-arrays-tests.factor b/basis/specialized-arrays/specialized-arrays-tests.factor index 02424a22fd..e3770220e8 100644 --- a/basis/specialized-arrays/specialized-arrays-tests.factor +++ b/basis/specialized-arrays/specialized-arrays-tests.factor @@ -6,7 +6,8 @@ multiline eval words vocabs namespaces assocs prettyprint alien.data math.vectors definitions compiler.test ; FROM: specialized-arrays.private => specialized-array-vocab ; FROM: alien.c-types => int float bool char float ulonglong ushort uint -heap-size little-endian? ; +heap-size ; +FROM: alien.data => little-endian? ; IN: specialized-arrays.tests SPECIALIZED-ARRAY: int diff --git a/core/io/encodings/utf16n/utf16n-tests.factor b/core/io/encodings/utf16n/utf16n-tests.factor index 9f3f35ff2a..96c4c29265 100644 --- a/core/io/encodings/utf16n/utf16n-tests.factor +++ b/core/io/encodings/utf16n/utf16n-tests.factor @@ -1,4 +1,4 @@ -USING: accessors alien.c-types kernel +USING: accessors alien.c-types alien.data kernel io.encodings.utf16 io.streams.byte-array tools.test ; IN: io.encodings.utf16n