From d23286a9efa5dab92c862e3b0967c9e589b4ce83 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Sun, 30 Aug 2009 21:14:26 +0200 Subject: [PATCH 1/3] Do not repeat sanity tests at each iteration --- basis/math/primes/primes.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/math/primes/primes.factor b/basis/math/primes/primes.factor index 27743a4a85..81193af400 100644 --- a/basis/math/primes/primes.factor +++ b/basis/math/primes/primes.factor @@ -69,7 +69,7 @@ ERROR: no-relative-prime n ; : (find-relative-prime) ( n guess -- p ) over 1 <= [ over no-relative-prime ] when dup 1 <= [ drop 3 ] when - 2dup gcd nip 1 > [ 2 + (find-relative-prime) ] [ nip ] if ; + [ 2dup coprime? ] [ 2 + ] until nip ; PRIVATE> From 91e7e1eeea2f02dbaaab2bdcdce2f685d47b8a68 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 10 Sep 2009 00:47:01 -0500 Subject: [PATCH 2/3] Fix the build --- basis/alien/structs/structs-docs.factor | 4 ++-- basis/io/files/info/unix/openbsd/openbsd.factor | 2 +- basis/io/launcher/windows/windows.factor | 3 ++- basis/sequences/complex/complex-docs.factor | 7 +++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/basis/alien/structs/structs-docs.factor b/basis/alien/structs/structs-docs.factor index c2a7d43387..62a3817fec 100644 --- a/basis/alien/structs/structs-docs.factor +++ b/basis/alien/structs/structs-docs.factor @@ -23,11 +23,11 @@ $nl } "C structure objects can be allocated by calling " { $link } " or " { $link malloc-object } "." $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" "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: } "C union objects can be allocated by calling " { $link } " or " { $link malloc-object } "." $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." ; diff --git a/basis/io/files/info/unix/openbsd/openbsd.factor b/basis/io/files/info/unix/openbsd/openbsd.factor index fe94f70fd8..ef1b55cda3 100755 --- a/basis/io/files/info/unix/openbsd/openbsd.factor +++ b/basis/io/files/info/unix/openbsd/openbsd.factor @@ -49,6 +49,6 @@ M: openbsd statvfs>file-system-info ( file-system-info statvfs -- file-system-in M: openbsd file-systems ( -- seq ) f 0 0 getfsstat dup io-error - + [ dup byte-length 0 getfsstat io-error ] [ [ f_mntonname>> utf8 alien>string file-system-info ] { } map-as ] bi ; diff --git a/basis/io/launcher/windows/windows.factor b/basis/io/launcher/windows/windows.factor index 475be5d70c..39455da578 100755 --- a/basis/io/launcher/windows/windows.factor +++ b/basis/io/launcher/windows/windows.factor @@ -6,8 +6,9 @@ io.ports windows.types math windows.kernel32 namespaces make io.launcher kernel sequences windows.errors splitting system threads init strings combinators io.backend accessors 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: void* IN: io.launcher.windows TUPLE: CreateProcess-args diff --git a/basis/sequences/complex/complex-docs.factor b/basis/sequences/complex/complex-docs.factor index 87ee32a0fc..699fd5c4d9 100644 --- a/basis/sequences/complex/complex-docs.factor +++ b/basis/sequences/complex/complex-docs.factor @@ -12,7 +12,7 @@ ABOUT: "sequences.complex" 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." } { $examples { $example <" -USING: prettyprint specialized-arrays ; +USING: prettyprint specialized-arrays sequences.complex sequences arrays ; SPECIALIZED-ARRAY: double double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } >array . @@ -22,9 +22,8 @@ HELP: { $values { "sequence" sequence } { "complex-sequence" complex-sequence } } { $description "Wraps " { $snippet "sequence" } " in a " { $link complex-sequence } "." } { $examples { $example <" -USING: prettyprint -specialized-arrays sequences.complex -sequences arrays ; +USING: prettyprint specialized-arrays +sequences.complex sequences arrays ; SPECIALIZED-ARRAY: double double-array{ 1.0 -1.0 -2.0 2.0 3.0 0.0 } second . "> "C{ -2.0 2.0 }" } } ; From 64cddef3e1c2c0bb37d00d549c2b0052b81e522b Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 10 Sep 2009 13:04:58 -0500 Subject: [PATCH 3/3] cpu.ppc: fix %single>double-float and %double>single-float --- basis/cpu/ppc/ppc.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/cpu/ppc/ppc.factor b/basis/cpu/ppc/ppc.factor index 8f2071a0dc..9c829bc390 100644 --- a/basis/cpu/ppc/ppc.factor +++ b/basis/cpu/ppc/ppc.factor @@ -299,9 +299,9 @@ M:: ppc %binary-float-function ( dst src1 src2 func -- ) dst float-function-return ; ! 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 -- ) alien-offset LWZ ;