Fix (closure) casting in closcall macros

This commit is contained in:
Justin Ethier 2016-02-18 22:30:10 -05:00
parent f47a3bb4a2
commit 41ff5a149b
2 changed files with 3 additions and 3 deletions

View file

@ -75,7 +75,7 @@ void Cyc_check_bounds(void *data, const char *label, int len, int index) {
/* END error checking */
/* These macros are hardcoded here to support functions in this module. */
#define closcall1(td,cfn,a1) if (type_of(cfn) == cons_tag || prim(cfn)) { Cyc_apply(td,0, (closure)a1, cfn); } else { ((cfn)->fn)(td,1,cfn,a1);}
#define closcall1(td,cfn,a1) if (type_of(cfn) == cons_tag || prim(cfn)) { Cyc_apply(td,0, (closure)(a1), cfn); } else { ((cfn)->fn)(td,1,cfn,a1);}
/* Return to continuation after checking for stack overflow. */
#define return_closcall1(td,cfn,a1) \
{char stack; \
@ -83,7 +83,7 @@ void Cyc_check_bounds(void *data, const char *label, int len, int index) {
object buf[1]; buf[0] = a1;\
GC(td,cfn,buf,1); return; \
} else {closcall1(td,(closure) (cfn),a1); return;}}
#define closcall2(td,cfn,a1,a2) if (type_of(cfn) == cons_tag || prim(cfn)) { Cyc_apply(td,1, (closure)a1, cfn,a2); } else { ((cfn)->fn)(td,2,cfn,a1,a2);}
#define closcall2(td,cfn,a1,a2) if (type_of(cfn) == cons_tag || prim(cfn)) { Cyc_apply(td,1, (closure)(a1), cfn,a2); } else { ((cfn)->fn)(td,2,cfn,a1,a2);}
/* Return to continuation after checking for stack overflow. */
#define return_closcall2(td,cfn,a1,a2) \
{char stack; \

View file

@ -151,7 +151,7 @@
(wrap (lambda (s) (if (> num-args 0) s ""))))
(string-append
"#define closcall" n "(td,cfn" args ") "
(wrap (string-append "if (type_of(cfn) == cons_tag || prim(cfn)) { Cyc_apply(td," n-1 ", (closure)a1, cfn" (if (> num-args 1) (substring args 3 (string-length args)) "") "); }"))
(wrap (string-append "if (type_of(cfn) == cons_tag || prim(cfn)) { Cyc_apply(td," n-1 ", (closure)(a1), cfn" (if (> num-args 1) (substring args 3 (string-length args)) "") "); }"))
(wrap " else { ")
"((cfn)->fn)(td," n ",cfn" args ")"
(wrap ";}")