mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 12:35:05 +02:00
Convert make_int to obj_int2obj
This commit is contained in:
parent
05d39afd3f
commit
bcb9f3d677
2 changed files with 7 additions and 6 deletions
|
@ -919,8 +919,8 @@
|
||||||
if (obj_is_int(num)) {
|
if (obj_is_int(num)) {
|
||||||
return_closcall1(data, k, obj_int2obj( abs( obj_obj2int(num))));
|
return_closcall1(data, k, obj_int2obj( abs( obj_obj2int(num))));
|
||||||
} else if (type_of(num) == integer_tag) {
|
} else if (type_of(num) == integer_tag) {
|
||||||
make_int(i, abs(((integer_type *)num)->value));
|
object obj = obj_int2obj(abs(((integer_type *)num)->value));
|
||||||
return_closcall1(data, k, &i);
|
return_closcall1(data, k, obj);
|
||||||
} else {
|
} else {
|
||||||
make_double(d, fabs(((double_type *)num)->value));
|
make_double(d, fabs(((double_type *)num)->value));
|
||||||
return_closcall1(data, k, &d);
|
return_closcall1(data, k, &d);
|
||||||
|
@ -946,8 +946,8 @@
|
||||||
j = ((double_type *)num2)->value;
|
j = ((double_type *)num2)->value;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
make_int(result, i % j);
|
object result = obj_int2obj(i % j);
|
||||||
return_closcall1(data, k, &result);
|
return_closcall1(data, k, result);
|
||||||
}")
|
}")
|
||||||
;; From chibi scheme. Cannot use C % operator
|
;; From chibi scheme. Cannot use C % operator
|
||||||
(define (modulo a b)
|
(define (modulo a b)
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
return_closcall1(data, k, &box); ")
|
return_closcall1(data, k, &box); ")
|
||||||
(define-c jiffies-per-second
|
(define-c jiffies-per-second
|
||||||
"(void *data, int argc, closure _, object k)"
|
"(void *data, int argc, closure _, object k)"
|
||||||
" make_int(box, CLOCKS_PER_SEC);
|
" int n = CLOCKS_PER_SEC;
|
||||||
return_closcall1(data, k, &box); ")
|
object obj = obj_int2obj(n);
|
||||||
|
return_closcall1(data, k, obj); ")
|
||||||
))
|
))
|
||||||
|
|
Loading…
Add table
Reference in a new issue