changeset 10:a4f34209ba63

remove __CbC_env from struct_longjmp.c
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Sun, 08 Dec 2013 16:08:05 +0900
parents 3f7c32b23851
children 635eb6d562f0
files struct_longjump.c
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/struct_longjump.c	Sun Dec 01 20:28:23 2013 +0900
+++ b/struct_longjump.c	Sun Dec 08 16:08:05 2013 +0900
@@ -2,11 +2,6 @@
 int longjmp(int*,int);
 int printf(const char*,...);
 
-struct CbC_env {
-  void *ret_p;
-  int *env;
-};
-
 __code code1(int n,__code(*__return)(int,void *),void *__environment){
   printf("code1 : code entry1\n");
   goto __return(n,__environment);
@@ -14,13 +9,13 @@
 
 __code return1 (int n,void* env){
   printf("return1 : __return entry\n");
-  *(int*)((struct CbC_env *)(env))->ret_p = n;
-  longjmp((((struct CbC_env *)env)->env),1);
+  *(int*)((struct __CbC_env *)(env))->ret_p = n;
+  longjmp((((struct __CbC_env *)env)->env),1);
 }
 
 int main1 (){
   __code (*__return)();
-  struct CbC_env __environment;
+  struct __CbC_env __environment;
   int i_buf[128];
   int retval;
   __environment.ret_p = &retval;