annotate test/tmpa.c @ 567:790ecb8900f0

*** empty log message ***
author kono
date Wed, 11 Jan 2006 14:09:27 +0900
parents a379da780856
children 682c8ec38d45
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
477
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
1 #include <stdio.h>
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
2
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
3 struct enemy{
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
4 int charno; // image number
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
5 float x; // x location
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
6 float y; // y location
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
7 int ap; // armor point
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
8 };
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
9 void
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
10 print_param(struct enemy *e)
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
11 {
491
a379da780856 cond signed/unsigned
kono
parents: 477
diff changeset
12 printf("#0011:charno:%d x,y:%f,%f hp:%d\n",
477
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
13 e->charno,e->x,e->y,e->ap);
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
14 }
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
15
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
16 typedef struct{
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
17 char dest;
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
18 int VF01[4];
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
19 code (*ret)();
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
20 void *env;
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
21 } interface;
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
22
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
23 code a0(interface a) {
491
a379da780856 cond signed/unsigned
kono
parents: 477
diff changeset
24 printf("#0023:%d\n",a.dest);
477
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
25 goto a.ret(0),a.env;
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
26 }
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
27
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
28
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
29 int main(int argc,char *argv[])
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
30 {
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
31 struct enemy e;
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
32 #if 0
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
33 interface args = {15,{0,0,0,0},return,environment};
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
34 #else
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
35 interface args = {15,{0,0,0,0},0,0};
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
36 args.ret = return;
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
37 args.env = environment;
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
38 #endif
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
39
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
40 e.charno=5; e.x=50.0; e.y=30.0; e.ap=100;
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
41 print_param(&e);
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
42
491
a379da780856 cond signed/unsigned
kono
parents: 477
diff changeset
43 printf("#0042:%d %d\n",args.VF01[2],args.VF01[1]);
477
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
44 goto a0(args);
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
45 }
308192c08e0a *** empty log message ***
kono
parents:
diff changeset
46