Mercurial > hg > CbC > CbC_examples
view parallel_check/c-int-double.c @ 5:90e6146d24cd
fix stack1.c
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 22 Oct 2014 19:02:57 +0900 |
parents | bacef8675607 |
children |
line wrap: on
line source
#include<stdio.h> #include<math.h> #define dprint(f, args...) \ printf("in %s env=%p: "f, __FUNCTION__, __builtin_frame_address(1), ## args) int test(int a) { return (int)pow(a, 2.0); } int callee(double a, double b, double c, int d) { dprint("a=%d,b=%d,c=%d,d=%d\n", a,b,c,d); return a+b+c+d; } int caller(int a, double b, double c, double d) { int x; double y,z,w; //x = test(a); //y = test(b); //z = test(c); //w = test(d); x=a, y=b; z=c, w=d; return callee(y,z,w,x); //return callee(b,c,d, a); } int main (int argc, char **argv) { int r; r = caller(11,22,33,44); //r = caller(11,22,33,44, 55,66,77,88); printf("r = %d\n", r); }