Convert make_int to obj_int2obj

This commit is contained in:
Justin Ethier 2016-03-20 22:16:45 -04:00
parent 05d39afd3f
commit bcb9f3d677
2 changed files with 7 additions and 6 deletions

View file

@ -919,8 +919,8 @@
if (obj_is_int(num)) {
return_closcall1(data, k, obj_int2obj( abs( obj_obj2int(num))));
} else if (type_of(num) == integer_tag) {
make_int(i, abs(((integer_type *)num)->value));
return_closcall1(data, k, &i);
object obj = obj_int2obj(abs(((integer_type *)num)->value));
return_closcall1(data, k, obj);
} else {
make_double(d, fabs(((double_type *)num)->value));
return_closcall1(data, k, &d);
@ -946,8 +946,8 @@
j = ((double_type *)num2)->value;
}
{
make_int(result, i % j);
return_closcall1(data, k, &result);
object result = obj_int2obj(i % j);
return_closcall1(data, k, result);
}")
;; From chibi scheme. Cannot use C % operator
(define (modulo a b)

View file

@ -30,6 +30,7 @@
return_closcall1(data, k, &box); ")
(define-c jiffies-per-second
"(void *data, int argc, closure _, object k)"
" make_int(box, CLOCKS_PER_SEC);
return_closcall1(data, k, &box); ")
" int n = CLOCKS_PER_SEC;
object obj = obj_int2obj(n);
return_closcall1(data, k, obj); ")
))