mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Cleanup
This commit is contained in:
parent
e5d63a61d5
commit
4b8d143627
3 changed files with 17 additions and 3 deletions
|
@ -275,7 +275,7 @@ object Cyc_io_read_line(void *data, object cont, object port);
|
|||
*/
|
||||
/**@{*/
|
||||
|
||||
#define unboxed_inexact_double_op(data, ptr, OP, z) \
|
||||
#define return_inexact_double_op_no_cps(data, ptr, OP, z) \
|
||||
double unboxed; \
|
||||
Cyc_check_num(data, z); \
|
||||
if (obj_is_int(z)) { \
|
||||
|
@ -318,6 +318,20 @@ object Cyc_io_read_line(void *data, object cont, object port);
|
|||
} \
|
||||
return_closcall1(data, cont, obj_int2obj(i))
|
||||
|
||||
#define return_exact_double_op_no_cps(data, ptr, OP, z) \
|
||||
int i = 0; \
|
||||
Cyc_check_num(data, z); \
|
||||
if (obj_is_int(z)) { \
|
||||
i = obj_obj2int(z); \
|
||||
} else if (type_of(z) == integer_tag) { \
|
||||
i = (int)OP(((integer_type *)z)->value); \
|
||||
} else if (type_of(z) == bignum_tag) { \
|
||||
return z; \
|
||||
} else { \
|
||||
i = (int)OP(((double_type *)z)->value); \
|
||||
} \
|
||||
return obj_int2obj(i);
|
||||
|
||||
#define unbox_number(n) \
|
||||
((obj_is_int(n) ? obj_obj2int(n) : \
|
||||
((type_of(n) == integer_tag) ? \
|
||||
|
|
|
@ -1073,7 +1073,7 @@
|
|||
"(void *data, int argc, closure _, object k, object z)"
|
||||
" return_exact_double_op(data, k, (int), z); "
|
||||
"(void *data, object ptr, object z)"
|
||||
" unboxed_inexact_double_op(data, ptr, (int), z);")
|
||||
" return_exact_double_op_no_cps(data, ptr, (int), z);")
|
||||
(define-c round
|
||||
"(void *data, int argc, closure _, object k, object z)"
|
||||
" return_exact_double_op(data, k, round, z); ")
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
"(void *data, int argc, closure _, object k, object z)"
|
||||
" return_inexact_double_op(data, k, log, z);"
|
||||
"(void *data, object ptr, object z)"
|
||||
" unboxed_inexact_double_op(data, ptr, log, z);"
|
||||
" return_inexact_double_op_no_cps(data, ptr, log, z);"
|
||||
)
|
||||
(define-c sin
|
||||
"(void *data, int argc, closure _, object k, object z)"
|
||||
|
|
Loading…
Add table
Reference in a new issue