# HG changeset patch # User Shinji KONO # Date 1590187907 -32400 # Node ID 26042f4007d5487fc1026877098e2bcfc8092e36 # Parent ff10c3399912544fc12603ae181ef1388b3997e1 fix examples diff -r ff10c3399912 -r 26042f4007d5 CbC-examples/arg.c --- a/CbC-examples/arg.c Sat Mar 21 09:14:44 2020 +0900 +++ b/CbC-examples/arg.c Sat May 23 07:51:47 2020 +0900 @@ -13,13 +13,13 @@ void *exit_env; __code (*exit___code)(); -#ifndef __llvm__ +// #ifndef __llvm__ __code carg2(int arg0,int arg1,int arg2,int arg3,int arg4,__code(*exit1)(int, void*),void *env); __code cargs(struct arg args0,__code exit1(int, void*),void *env); __code carg4(struct arg args0,struct arg args1,int i, int j,int k,int l); __code carg5(struct arg args0,struct arg args1,int i, int j,int k,int l); __code carg6(int i, int j,int k,int l,struct arg args0); -#endif +// #endif __code carg1(int arg0,int arg1,int arg2,int arg3,int arg4,__code(*exit1)(int, void*),void *env) { diff -r ff10c3399912 -r 26042f4007d5 CbC-examples/stack1.c --- a/CbC-examples/stack1.c Sat Mar 21 09:14:44 2020 +0900 +++ b/CbC-examples/stack1.c Sat May 23 07:51:47 2020 +0900 @@ -3,7 +3,9 @@ */ #include -#define NULL 0 +#include + +// #define NULL 0 extern int printf(const char*, ...); extern void *malloc(size_t); @@ -30,7 +32,7 @@ goto (* ((struct cont_save *)sp)->ret)(i+4,sp); } -__code __attribute__ ((fastcall)) f_g1(int j,void *sp) { /* Continuation */ +__code f_g1(int j,void *sp) { /* Continuation */ int k; struct f_g0_save *c; @@ -98,6 +100,8 @@ goto print(i,j,exit2,exit2env); } +int main0( int ac, char *av[]); + int main(int ac, char*av[]){ main0(ac,av); } diff -r ff10c3399912 -r 26042f4007d5 CbC-examples/test05.c --- a/CbC-examples/test05.c Sat Mar 21 09:14:44 2020 +0900 +++ b/CbC-examples/test05.c Sat May 23 07:51:47 2020 +0900 @@ -1,4 +1,6 @@ //#include +#include + extern int printf(const char*, ...); #define dprint(f, args...) \ printf("in %s: "f, __FUNCTION__, ## args) diff -r ff10c3399912 -r 26042f4007d5 CbC-examples/test_cs.c --- a/CbC-examples/test_cs.c Sat Mar 21 09:14:44 2020 +0900 +++ b/CbC-examples/test_cs.c Sat May 23 07:51:47 2020 +0900 @@ -2,6 +2,7 @@ //#include extern int printf(const char*, ...); +extern void exit(int status); __code cs_exit(int , double , char ); __code cs1(int, int, int, int); diff -r ff10c3399912 -r 26042f4007d5 CbC-examples/test_para3.c --- a/CbC-examples/test_para3.c Sat Mar 21 09:14:44 2020 +0900 +++ b/CbC-examples/test_para3.c Sat May 23 07:51:47 2020 +0900 @@ -49,9 +49,9 @@ int function(){ struct abc A; struct def B; - A.a = 10, A.b = 20.02, A.c = '\0', A.d = 0xad; - B.d = 30, B.f = 0xbf; - B.e.a = 50, B.e.b = 60.06, B.e.c = '\1', B.e.d = 0xed; + A.a = 10, A.b = 20.02, A.c = '\0', A.d = (void*)0xad; + B.d = 30, B.f = (void*)0xbf; + B.e.a = 50, B.e.b = 60.06, B.e.c = '\1', B.e.d = (void*)0xed; printf("function :\n"); print_abc(A); @@ -65,9 +65,9 @@ struct abc A; struct def B; //int a=10, b=20, c=30, d=40, e=50, f=60, g=70; - A.a = 10, A.b = 20.02, A.c = '\0', A.d = 0xad; - B.d = 30, B.f = 0xbf; - B.e.a = 50, B.e.b = 60.06, B.e.c = '\1', B.e.d = 0xed; + A.a = 10, A.b = 20.02, A.c = '\0', A.d = (void*)0xad; + B.d = 30, B.f = (void*)0xbf; + B.e.a = 50, B.e.b = 60.06, B.e.c = '\1', B.e.d = (void*)0xed; /* printf("main :\n"); diff -r ff10c3399912 -r 26042f4007d5 CbC-examples/test_para4.c --- a/CbC-examples/test_para4.c Sat Mar 21 09:14:44 2020 +0900 +++ b/CbC-examples/test_para4.c Sat May 23 07:51:47 2020 +0900 @@ -2,6 +2,7 @@ //#include extern int printf(const char*, ...); +extern void exit(int status); #define DPRINT 1 #define NOINLINE __attribute__((noinline)) diff -r ff10c3399912 -r 26042f4007d5 CbC-examples/test_tree.c --- a/CbC-examples/test_tree.c Sat Mar 21 09:14:44 2020 +0900 +++ b/CbC-examples/test_tree.c Sat May 23 07:51:47 2020 +0900 @@ -5,6 +5,8 @@ __code cs(int , double , char ); void testvoid(double a); int testint(double a); +void test_goto(int a, int b, double c); +__code test_goto1(int a, int b, double c); __code cs(int a, double b, char c){ printf("__code cs was called.\n");