diff --git a/vm/ffi_test.c b/vm/ffi_test.c index 5dcff831df..b2cbf9b6b5 100755 --- a/vm/ffi_test.c +++ b/vm/ffi_test.c @@ -251,10 +251,18 @@ double ffi_test_36(struct test_struct_12 x) return x.x; } +static int global_var; + +void ffi_test_36_point_5(void) +{ + printf("int_ffi_test_36_point_5\n"); + global_var = 0; +} + int ffi_test_37(int (*f)(int, int, int)) { - static int global_var = 0; printf("ffi_test_37\n"); + printf("global_var is %d\n",global_var); global_var = f(global_var,global_var * 2,global_var * 3); printf("global_var is %d\n",global_var); fflush(stdout); diff --git a/vm/ffi_test.h b/vm/ffi_test.h index 9a3f4dded2..d455d999b1 100755 --- a/vm/ffi_test.h +++ b/vm/ffi_test.h @@ -62,6 +62,8 @@ struct test_struct_12 { int a; double x; }; DLLEXPORT double ffi_test_36(struct test_struct_12 x); +DLLEXPORT void int_ffi_test_36_point_5(void); + DLLEXPORT int ffi_test_37(int (*f)(int, int, int)); DLLEXPORT unsigned long long ffi_test_38(unsigned long long x, unsigned long long y); diff --git a/vm/primitives.c b/vm/primitives.c index 2906a154a2..da04870ecd 100755 --- a/vm/primitives.c +++ b/vm/primitives.c @@ -139,10 +139,6 @@ void *primitives[] = { primitive_set_alien_double, primitive_alien_cell, primitive_set_alien_cell, - primitive_alien_to_char_string, - primitive_string_to_char_alien, - primitive_alien_to_u16_string, - primitive_string_to_u16_alien, primitive_throw, primitive_alien_address, primitive_slot, diff --git a/vm/types.c b/vm/types.c index d9fd152c97..b4e5269f4e 100755 --- a/vm/types.c +++ b/vm/types.c @@ -608,10 +608,6 @@ DEFINE_PRIMITIVE(resize_string) void box_##type##_string(const type *str) \ { \ dpush(str ? tag_object(from_##type##_string(str)) : F); \ - } \ - DEFINE_PRIMITIVE(alien_to_##type##_string) \ - { \ - drepl(tag_object(from_##type##_string(alien_offset(dpeek())))); \ } MEMORY_TO_STRING(char,u8) @@ -671,14 +667,6 @@ F_BYTE_ARRAY *allot_c_string(CELL capacity, CELL size) type *unbox_##type##_string(void) \ { \ return to_##type##_string(untag_string(dpop()),true); \ - } \ - DEFINE_PRIMITIVE(string_to_##type##_alien) \ - { \ - CELL string, t; \ - string = dpeek(); \ - t = type_of(string); \ - if(t != ALIEN_TYPE && t != BYTE_ARRAY_TYPE && t != F_TYPE) \ - drepl(tag_object(string_to_##type##_alien(untag_string(string),true))); \ } STRING_TO_MEMORY(char); diff --git a/vm/types.h b/vm/types.h index 03ac84d5a5..3ce1838b8b 100755 --- a/vm/types.h +++ b/vm/types.h @@ -160,24 +160,20 @@ DECLARE_PRIMITIVE(resize_string); F_STRING *memory_to_char_string(const char *string, CELL length); F_STRING *from_char_string(const char *c_string); DLLEXPORT void box_char_string(const char *c_string); -DECLARE_PRIMITIVE(alien_to_char_string); F_STRING *memory_to_u16_string(const u16 *string, CELL length); F_STRING *from_u16_string(const u16 *c_string); DLLEXPORT void box_u16_string(const u16 *c_string); -DECLARE_PRIMITIVE(alien_to_u16_string); void char_string_to_memory(F_STRING *s, char *string); F_BYTE_ARRAY *string_to_char_alien(F_STRING *s, bool check); char* to_char_string(F_STRING *s, bool check); DLLEXPORT char *unbox_char_string(void); -DECLARE_PRIMITIVE(string_to_char_alien); void u16_string_to_memory(F_STRING *s, u16 *string); F_BYTE_ARRAY *string_to_u16_alien(F_STRING *s, bool check); u16* to_u16_string(F_STRING *s, bool check); DLLEXPORT u16 *unbox_u16_string(void); -DECLARE_PRIMITIVE(string_to_u16_alien); /* String getters and setters */ CELL string_nth(F_STRING* string, CELL index);