annotate CbC-examples/rectypeTest/typedef.cbc @ 107:a3a2f64cf8f4

modify implementation of rectype
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Thu, 14 Jun 2012 19:44:54 +0900
parents 85047c4f1ca4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
107
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
1 typedef __code (CS)(__rectype*); // CS *p
106
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
107
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
3 //typedef __code (*CS)(__code(*p)());
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
4 //typedef __code (CS)(__code(*p)()); // CS *p
106
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
107
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
6 #include <stdio.h>
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
7 __code cs_end(CS *p)
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
8 {
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
9 printf("end\n");
106
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 }
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
107
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
12 __code cs(CS *p)
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
13 {
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
14 CS *b;
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
15 goto p(b);
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
16 // goto p("aaa"); //note: expected ‘void (*)’ but argument is of type ‘char
106
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 }
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 int main() {
107
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
20 CS *p;
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
21 p = cs_end;
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
22 goto cs(p);
a3a2f64cf8f4 modify implementation of rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 106
diff changeset
23 return 0;
106
85047c4f1ca4 add CbC-examples/rectypeTest
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 }