diff CbC-examples/rectypeTest/instruct.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
line wrap: on
line diff
--- a/CbC-examples/rectypeTest/instruct.cbc	Wed Jun 13 17:18:58 2012 +0900
+++ b/CbC-examples/rectypeTest/instruct.cbc	Thu Jun 14 19:44:54 2012 +0900
@@ -1,26 +1,28 @@
 #include <stdlib.h>
 
+// miss
 struct interface {
-	__rectype *next;
+  __rectype *next;
 };
 
-
 __code print(struct interface p) {
-	puts("print");
-	exit(0);
+  puts("print");
+  exit(0);
 }
 
 __code csA(struct interface p) {
-	struct interface ds = { csA };
-	goto p.next(ds);
+  struct interface ds;
+  ds.next = csA;
+  goto p.next(ds);
 }
 
 void main1() {
-	struct interface ds = { print };
-	goto csA(ds);
+  struct interface ds;
+  ds.next = print;
+  goto csA(ds);
 }
 
 int main() {
-	main1();
-	return 0;
+  main1();
+  return 0;
 }