#include #include /* * Structures slightly larger than an unsigned long long */ struct t { long long int a, b, c; }; unsigned long long int xt[4] = { 41, 42, 43, 44 }; unsigned long long int f7(int index) { unsigned long long int offsets[4] = { 1, 2, 3, 4 }; unsigned long int o[4] = { 11, 12, 13, 14 }; /* somewhat larger struct */ struct t st[4] = { { 0, 31, 0 }, { 0, 32, 0 }, { 0, 33, 0 }, { 0, 34, 0 } }; unsigned long long int last_limit; unsigned long int l; last_limit = st[index].b + o[index] + offsets[index] + xt[index] ; return last_limit; } int main(int argc, char *argv[]) { int i; for (i = 0; i < 4; ++i) printf("i = %d, f7(%d) = %llu\n", i, i, f7(i)); /* assertions */ assert( f7(0) == (unsigned long long int)( 1 + 11 + 31 + 41) ); assert( f7(1) == (unsigned long long int)( 2 + 12 + 32 + 42) ); assert( f7(2) == (unsigned long long int)( 3 + 13 + 33 + 43) ); assert( f7(3) == (unsigned long long int)( 4 + 14 + 34 + 44) ); return 0; }