comparison CbC-examples/too-long-argument.c @ 78:365b84b6fe04

more examples
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 20 Sep 2011 17:32:20 +0900
parents
children b0f061ae1da0
comparison
equal deleted inserted replaced
77:65b2ea5f1266 78:365b84b6fe04
1 #define __environment _CbC_environment
2 #define __return _CbC_return
3
4 #include <stdio.h>
5
6 #undef WRONGNUMBER
7
8 typedef __code
9 (*CCC)( int f1,int f2,int f3,int f4,int f5,int f6,int f7,int f8,int f9,int fa,int fb,int fc,int fd,int fe,int ff,
10 __code(*ret)(int,void *),
11 void *env);
12
13 __code
14 tcode2( int f1,int f2,int f3,int f4,int f5,int f6,int f7,int f8,int f9,int fa,int fb,int fc,int fd,int fe,int ff,
15 __code(*ret)(int,void *),
16 void *env)
17 {
18 fprintf(stdout,"#0017:tcode2: f1=%d,f2=%d,f3=%d,f4=%d,f5=%d,f6=%d,f7=%d,f8=%d,f9=%d,fa=%d,fb=%d,fc=%d,fd=%d,fe=%d,ff=%d\n",
19 f1,f2,f3,f4,f5,f6,f7,f8,f9,fa,fb,fc,fd,fe,ff);
20 goto ret(0,env);
21 }
22
23 __code
24 tcode1(f1,f2,f3,f4,f5,f6,f7,f8,f9,fa,fb,fc,fd,fe,ff,ret,env)
25 int f1,f2,f3,f4,f5,f6,f7,f8,f9,fa,fb,fc,fd,fe,ff;
26 __code(*ret)(int,void *);
27 void *env;
28 {
29 fprintf(stdout,"#0028:tcode1: f1=%d,f2=%d,f3=%d,f4=%d,f5=%d,f6=%d,f7=%d,f8=%d,f9=%d,fa=%d,fb=%d,fc=%d,fd=%d,fe=%d,ff=%d\n",
30 f1,f2,f3,f4,f5,f6,f7,f8,f9,fa,fb,fc,fd,fe,ff);
31 goto ret(0,env);
32 }
33
34 __code
35 tcode4(int x,int y,CCC junction,__code(*ret)(int),void *env)
36 {
37 #ifdef WRONGNUMBER
38 goto junction(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,ret,env);
39 #else
40 goto junction(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,ret,env);
41 #endif
42 }
43
44 __code
45 tcode0(int x,int y,__code(*junction)(int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,__code(*)(int),void *),__code(*ret)(int),void *env)
46 {
47 #ifdef WRONGNUMBER
48 goto junction(0,1,2,3,4,5,6,7,8,9,10,11,12,13,ret,env);
49 #else
50 goto junction(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,ret,env);
51 #endif
52 }
53
54 int
55 main0()
56 {
57 #ifdef WRONGNUMBER
58 goto tcode2(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
59 __return,__environment);
60 #else
61 goto tcode2(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
62 __return,__environment);
63 #endif
64 }
65
66 int
67 main1()
68 {
69 #ifdef WRONGNUMBER
70 goto tcode1(0,1,2,3,4,5,6,7,8,9,10,11,12,13,
71 __return,__environment);
72 #else
73 goto tcode1(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
74 __return,__environment);
75 #endif
76 }
77
78 int
79 main2()
80 {
81 goto tcode0(0,1,tcode1,__return,__environment);
82 }
83
84 int
85 main4()
86 {
87 goto tcode4(0,1,tcode2,__return,__environment);
88 }
89
90 int
91 main()
92 {
93 printf("#0092:main4\n");
94 main4();
95 printf("#0094:main2\n");
96 main2();
97 printf("#0096:main0\n");
98 main0();
99 printf("#0098:main1\n");
100 main1();
101 return 0;
102 }
103
104 //