vm: fix longlong accessors
parent
0cde5c8fb5
commit
c2558e6a66
|
@ -104,12 +104,12 @@ void *factor_vm::alien_pointer()
|
||||||
#define DEFINE_ALIEN_ACCESSOR(name,type,from,to) \
|
#define DEFINE_ALIEN_ACCESSOR(name,type,from,to) \
|
||||||
VM_C_API void primitive_alien_##name(factor_vm *parent) \
|
VM_C_API void primitive_alien_##name(factor_vm *parent) \
|
||||||
{ \
|
{ \
|
||||||
parent->ctx->push(from(*(type*)(parent->alien_pointer()),parent)); \
|
parent->ctx->push(parent->from(*(type*)(parent->alien_pointer()))); \
|
||||||
} \
|
} \
|
||||||
VM_C_API void primitive_set_alien_##name(factor_vm *parent) \
|
VM_C_API void primitive_set_alien_##name(factor_vm *parent) \
|
||||||
{ \
|
{ \
|
||||||
type *ptr = (type *)parent->alien_pointer(); \
|
type *ptr = (type *)parent->alien_pointer(); \
|
||||||
type value = (type)to(parent->ctx->pop(),parent); \
|
type value = (type)parent->to(parent->ctx->pop()); \
|
||||||
*ptr = value; \
|
*ptr = value; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,8 +145,8 @@ namespace factor
|
||||||
_(unsigned_2,u16,from_unsigned_2,to_cell) \
|
_(unsigned_2,u16,from_unsigned_2,to_cell) \
|
||||||
_(signed_1,s8,from_signed_1,to_fixnum) \
|
_(signed_1,s8,from_signed_1,to_fixnum) \
|
||||||
_(unsigned_1,u8,from_unsigned_1,to_cell) \
|
_(unsigned_1,u8,from_unsigned_1,to_cell) \
|
||||||
_(float,float,from_float,to_float) \
|
_(float,float,allot_float,to_float) \
|
||||||
_(double,double,from_double,to_double) \
|
_(double,double,allot_float,to_double) \
|
||||||
_(cell,void *,allot_alien,pinned_alien_offset)
|
_(cell,void *,allot_alien,pinned_alien_offset)
|
||||||
|
|
||||||
#define DECLARE_PRIMITIVE(name) VM_C_API void primitive_##name(factor_vm *parent);
|
#define DECLARE_PRIMITIVE(name) VM_C_API void primitive_##name(factor_vm *parent);
|
||||||
|
|
Loading…
Reference in New Issue