Mercurial > hg > CbC > old > device
view test/goto.c @ 193:ce0c38b6c85e
try long long
author | kono |
---|---|
date | Sun, 14 Dec 2003 16:53:42 +0900 |
parents | 096559f07a70 |
children | 0c256ea2a97e |
line wrap: on
line source
code (*conv)(int,code (*)()); code a2(int i,code conv()); code a3(int i,code conv()); code a4(int i,code conv()); code a5(int i,code conv()); char* print_conv(code conv()) { if(conv==a2) return "a2"; if(conv==a3) return "a3"; if(conv==a4) return "a4"; if(conv==a5) return "a5"; if(conv==a6) return "a6"; if(conv==a7) return "a7"; if(conv==a8) return "a8"; if(conv==a9) return "a9"; else return "xx"; } code (*exit0)(int); void *env; code a2(int i,code conv()) { printf("a2 %d %s\n",i,print_conv(conv)); goto conv(i+1,a4); } code a3(int i,code (*conv)()) { printf("a3 %d %s\n",i,print_conv(conv)); goto conv(i+1,a5); } code a4(int i,code conv()) { printf("a4 %d %s\n",i,print_conv(conv)); goto (*conv)(i+1,a6); } code a5(int i,code (*conv)()) { printf("a5 %d %s\n",i,print_conv(conv)); goto (*conv)(i+1,i+2,i+3,a7); } code a6(int i,int j,int k,code conv()) { printf("a6 %d %s\n",i,print_conv(conv)); goto conv(i+1,j,k,a8); } code a7(int i,,int j,int k,code (*conv)()) { printf("a7 %d %s\n",i,print_conv(conv)); goto conv(i+1,j,k,a9); } code a8(int i,int j,int k,code conv()) { printf("a8 %d %s\n",i,print_conv(conv)); goto (*conv)(i+1,j,k,exit0); } code a9(int i,int j,int k,code (*conv)()) { printf("a9 %d %s\n",i,print_conv(conv)); goto (*conv)(0),env; } main(int ac,char *av[]) { exit0 = return; env = environment; conv = a2; goto conv(1,a3); }