mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-06 20:56:36 +02:00
Replacing __sum macro with Cyc_sum
This commit is contained in:
parent
5be68ec60c
commit
04c11eabfb
2 changed files with 5 additions and 4 deletions
3
cgen.scm
3
cgen.scm
|
@ -400,7 +400,7 @@
|
|||
((eq? p 'Cyc-set-cvar!) "Cyc_set_cvar")
|
||||
((eq? p 'Cyc-cvar?) "Cyc_is_cvar")
|
||||
((eq? p 'Cyc-has-cycle?) "Cyc_has_cycle")
|
||||
((eq? p '+) "__sum")
|
||||
((eq? p '+) "Cyc_sum")
|
||||
((eq? p '-) "__sub")
|
||||
((eq? p '*) "__mul")
|
||||
((eq? p '/) "__div")
|
||||
|
@ -554,6 +554,7 @@
|
|||
((eq? p 'open-input-file) "port_type")
|
||||
((eq? p 'length) "integer_type")
|
||||
((eq? p 'char->integer) "integer_type")
|
||||
((eq? p '+) "common_type")
|
||||
((eq? p 'string->number) "common_type")
|
||||
((eq? p 'list->string) "string_type")
|
||||
; ((eq? p 'string->list) "object")
|
||||
|
|
|
@ -94,6 +94,7 @@ static object Cyc_is_char(object o);
|
|||
static object Cyc_is_procedure(object o);
|
||||
static object Cyc_is_eof_object(object o);
|
||||
static object Cyc_is_cvar(object o);
|
||||
static common_type Cyc_sum(object x, object y);
|
||||
static int equal(object,object);
|
||||
static list assq(object,list);
|
||||
static object get(object,object);
|
||||
|
@ -782,7 +783,6 @@ static object __halt(object obj) {
|
|||
return nil;
|
||||
}
|
||||
|
||||
#define __sum(c,x,y) integer_type c; c.tag = integer_tag; c.value = (((integer_type *)(x))->value + ((integer_type *)(y))->value);
|
||||
#define __mul(c,x,y) integer_type c; c.tag = integer_tag; c.value = (((integer_type *)(x))->value * ((integer_type *)(y))->value);
|
||||
#define __sub(c,x,y) integer_type c; c.tag = integer_tag; c.value = (((integer_type *)(x))->value - ((integer_type *)(y))->value);
|
||||
#define __div(c,x,y) integer_type c; c.tag = integer_tag; c.value = (((integer_type *)(x))->value / ((integer_type *)(y))->value);
|
||||
|
@ -939,8 +939,8 @@ static void _set_91cdr_67(object cont, object args) {
|
|||
static void _Cyc_91has_91cycle_127(object cont, object args) {
|
||||
return_funcall1(cont, Cyc_has_cycle(car(args))); }
|
||||
static void __87(object cont, object args) {
|
||||
__sum(i, car(args), cadr(args));
|
||||
return_funcall1(cont, &i); }
|
||||
common_type n = Cyc_sum(car(args), cadr(args));
|
||||
return_funcall1(cont, &n); }
|
||||
static void __91(object cont, object args) {
|
||||
__sub(i, car(args), cadr(args));
|
||||
return_funcall1(cont, &i); }
|
||||
|
|
Loading…
Add table
Reference in a new issue