Joe Groff 2009-09-10 16:11:04 -05:00
commit dc22fec73f
6 changed files with 11 additions and 11 deletions

View File

@ -23,11 +23,11 @@ $nl
} }
"C structure objects can be allocated by calling " { $link <c-object> } " or " { $link malloc-object } "." "C structure objects can be allocated by calling " { $link <c-object> } " or " { $link malloc-object } "."
$nl $nl
"Arrays of C structures can be created with the " { $vocab-link "struct-arrays" } " vocabulary." ; "Arrays of C structures can be created with the " { $vocab-link "specialized-arrays" } " vocabulary." ;
ARTICLE: "c-unions" "C unions" ARTICLE: "c-unions" "C unions"
"A " { $snippet "union" } " in C defines a type large enough to hold its largest member. This is usually used to allocate a block of memory which can hold one of several types of values." "A " { $snippet "union" } " in C defines a type large enough to hold its largest member. This is usually used to allocate a block of memory which can hold one of several types of values."
{ $subsection POSTPONE: C-UNION: } { $subsection POSTPONE: C-UNION: }
"C union objects can be allocated by calling " { $link <c-object> } " or " { $link malloc-object } "." "C union objects can be allocated by calling " { $link <c-object> } " or " { $link malloc-object } "."
$nl $nl
"Arrays of C unions can be created with the " { $vocab-link "struct-arrays" } " vocabulary." ; "Arrays of C unions can be created with the " { $vocab-link "specialized-arrays" } " vocabulary." ;

View File

@ -299,9 +299,9 @@ M:: ppc %binary-float-function ( dst src1 src2 func -- )
dst float-function-return ; dst float-function-return ;
! Internal format is always double-precision on PowerPC ! Internal format is always double-precision on PowerPC
M: ppc %single>double-float 2drop ; M: ppc %single>double-float FMR ;
M: ppc %double>single-float 2drop ; M: ppc %double>single-float FMR ;
M: ppc %unbox-alien ( dst src -- ) M: ppc %unbox-alien ( dst src -- )
alien-offset LWZ ; alien-offset LWZ ;

View File

@ -49,6 +49,6 @@ M: openbsd statvfs>file-system-info ( file-system-info statvfs -- file-system-in
M: openbsd file-systems ( -- seq ) M: openbsd file-systems ( -- seq )
f 0 0 getfsstat dup io-error f 0 0 getfsstat dup io-error
<statfs-array> <statvfs-array>
[ dup byte-length 0 getfsstat io-error ] [ dup byte-length 0 getfsstat io-error ]
[ [ f_mntonname>> utf8 alien>string file-system-info ] { } map-as ] bi ; [ [ f_mntonname>> utf8 alien>string file-system-info ] { } map-as ] bi ;

View File

@ -6,8 +6,9 @@ io.ports windows.types math windows.kernel32 namespaces make
io.launcher kernel sequences windows.errors splitting system io.launcher kernel sequences windows.errors splitting system
threads init strings combinators io.backend accessors threads init strings combinators io.backend accessors
concurrency.flags io.files assocs io.files.private windows concurrency.flags io.files assocs io.files.private windows
destructors specialized-arrays.alien classes classes.struct ; destructors classes classes.struct specialized-arrays ;
SPECIALIZED-ARRAY: ushort SPECIALIZED-ARRAY: ushort
SPECIALIZED-ARRAY: void*
IN: io.launcher.windows IN: io.launcher.windows
TUPLE: CreateProcess-args TUPLE: CreateProcess-args

View File

@ -69,7 +69,7 @@ ERROR: no-relative-prime n ;
: (find-relative-prime) ( n guess -- p ) : (find-relative-prime) ( n guess -- p )
over 1 <= [ over no-relative-prime ] when over 1 <= [ over no-relative-prime ] when
dup 1 <= [ drop 3 ] when dup 1 <= [ drop 3 ] when
2dup gcd nip 1 > [ 2 + (find-relative-prime) ] [ nip ] if ; [ 2dup coprime? ] [ 2 + ] until nip ;
PRIVATE> PRIVATE>

View File

@ -12,7 +12,7 @@ ABOUT: "sequences.complex"
HELP: complex-sequence HELP: complex-sequence
{ $class-description "Sequence wrapper class that transforms a sequence of " { $link real } " number values into a sequence of " { $link complex } " values, treating the underlying sequence as pairs of alternating real and imaginary values." } { $class-description "Sequence wrapper class that transforms a sequence of " { $link real } " number values into a sequence of " { $link complex } " values, treating the underlying sequence as pairs of alternating real and imaginary values." }
{ $examples { $example <" { $examples { $example <"
USING: prettyprint specialized-arrays ; USING: prettyprint specialized-arrays
sequences.complex sequences arrays ; sequences.complex sequences arrays ;
SPECIALIZED-ARRAY: double SPECIALIZED-ARRAY: double
double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } <complex-sequence> >array . double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } <complex-sequence> >array .
@ -22,9 +22,8 @@ HELP: <complex-sequence>
{ $values { "sequence" sequence } { "complex-sequence" complex-sequence } } { $values { "sequence" sequence } { "complex-sequence" complex-sequence } }
{ $description "Wraps " { $snippet "sequence" } " in a " { $link complex-sequence } "." } { $description "Wraps " { $snippet "sequence" } " in a " { $link complex-sequence } "." }
{ $examples { $example <" { $examples { $example <"
USING: prettyprint USING: prettyprint specialized-arrays
specialized-arrays sequences.complex sequences.complex sequences arrays ;
sequences arrays ;
SPECIALIZED-ARRAY: double SPECIALIZED-ARRAY: double
double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } <complex-sequence> second . double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } <complex-sequence> second .
"> "C{ -2.0 2.0 }" } } ; "> "C{ -2.0 2.0 }" } } ;