Mercurial > hg > Members > kaito > longjump
changeset 9:3f7c32b23851
change __environment.env type and remove unnecessary casts.
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 01 Dec 2013 20:28:23 +0900 |
parents | a7c771f554e7 |
children | a4f34209ba63 |
files | struct_longjump.c |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/struct_longjump.c Sun Dec 01 20:23:27 2013 +0900 +++ b/struct_longjump.c Sun Dec 01 20:28:23 2013 +0900 @@ -3,7 +3,8 @@ int printf(const char*,...); struct CbC_env { - void *ret_p,*env; + void *ret_p; + int *env; }; __code code1(int n,__code(*__return)(int,void *),void *__environment){ @@ -14,7 +15,7 @@ __code return1 (int n,void* env){ printf("return1 : __return entry\n"); *(int*)((struct CbC_env *)(env))->ret_p = n; - longjmp((int*)(((struct CbC_env *)env)->env),1); + longjmp((((struct CbC_env *)env)->env),1); } int main1 (){ @@ -23,7 +24,7 @@ int i_buf[128]; int retval; __environment.ret_p = &retval; - __environment.env = &i_buf; + __environment.env = i_buf; printf("main1 : main1 entry\n"); if (setjmp(__environment.env)){ printf("main1 : main1 return\n");