diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 762d1d70ab..8ae7c828b0 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,6 +1,8 @@ + 0.80: - need something like uncons but for arbitrary sequences +- on win64: to_cell will break +- .h .b .o for ratios and floats is broken word help sections: - synopsis diff --git a/library/compiler/assembler.factor b/library/compiler/assembler.factor index 9d5297ddc5..fe35695e43 100644 --- a/library/compiler/assembler.factor +++ b/library/compiler/assembler.factor @@ -15,9 +15,8 @@ math memory namespaces ; compiled-offset 8 align set-compiled-offset ; inline : add-literal ( obj -- lit# ) - address - literal-top set-compiled-cell - literal-top dup cell + set-literal-top ; + address literal-top [ set-compiled-cell ] keep + dup cell + set-literal-top ; : assemble-1 ( n -- ) compiled-offset set-compiled-1 diff --git a/library/test/alien.factor b/library/test/alien.factor index 01ea7b1020..6d162f7e0c 100644 --- a/library/test/alien.factor +++ b/library/test/alien.factor @@ -32,3 +32,17 @@ USING: arrays alien kernel kernel-internals namespaces test ; -1 "dump" get 0 set-alien-signed-8 "dump" get 0 alien-signed-8 ] unit-test + +cell 8 = [ + [ HEX: 123412341234 ] [ + 8 + HEX: 123412341234 over 0 set-alien-signed-8 + 0 alien-signed-8 + ] unit-test + + [ HEX: 123412341234 ] [ + 8 + HEX: 123412341234 over 0 set-alien-signed-cell + 0 alien-signed-cell + ] unit-test +] when diff --git a/native/alien.c b/native/alien.c index 1eaa9249cb..95c747e68d 100644 --- a/native/alien.c +++ b/native/alien.c @@ -117,7 +117,7 @@ void primitive_set_alien_##name (void) \ *ptr = value; \ } -DEF_ALIEN_SLOT(signed_cell,int,signed_cell) +DEF_ALIEN_SLOT(signed_cell,F_FIXNUM,signed_cell) DEF_ALIEN_SLOT(unsigned_cell,CELL,unsigned_cell) DEF_ALIEN_SLOT(signed_8,s64,signed_8) DEF_ALIEN_SLOT(unsigned_8,u64,unsigned_8)