Mercurial > pub > dyncall > dyncall
comparison test/call_suite_aggrs/globals.c @ 492:29d09d10ecd9
- added unsigned types to call_suite_aggrs
author | Tassilo Philipp |
---|---|
date | Mon, 21 Mar 2022 10:04:10 +0100 |
parents | 0c68b3f91367 |
children | c9c546f8598b |
comparison
equal
deleted
inserted
replaced
491:e3bf15207d93 | 492:29d09d10ecd9 |
---|---|
69 #define X(CH,T) V_##CH = (T*) malloc(sizeof(T)*(G_maxargs+1)); K_##CH = (T*) malloc(sizeof(T)*(G_maxargs+1)); | 69 #define X(CH,T) V_##CH = (T*) malloc(sizeof(T)*(G_maxargs+1)); K_##CH = (T*) malloc(sizeof(T)*(G_maxargs+1)); |
70 DEF_TYPES | 70 DEF_TYPES |
71 #undef X | 71 #undef X |
72 | 72 |
73 for(i=0;i<G_maxargs+1;++i) { | 73 for(i=0;i<G_maxargs+1;++i) { |
74 K_c[i] = (char) (((rand_d()-0.5)*2) * (1<<7)); | 74 K_c[i] = (char) (((rand_d()-0.5)*2) * (1<<7)); |
75 K_s[i] = (short) (((rand_d()-0.5)*2) * (1<<(sizeof(short)*8-1))); | 75 K_s[i] = (short) (((rand_d()-0.5)*2) * (1<<(sizeof(short)*8-1))); |
76 K_i[i] = (int) (((rand_d()-0.5)*2) * (1<<(sizeof(int)*8-2))); | 76 K_i[i] = (int) (((rand_d()-0.5)*2) * (1<<(sizeof(int)*8-2))); |
77 K_j[i] = (long) (((rand_d()-0.5)*2) * (1L<<(sizeof(long)*8-2))); | 77 K_j[i] = (long) (((rand_d()-0.5)*2) * (1L<<(sizeof(long)*8-2))); |
78 K_l[i] = (long long) (((rand_d()-0.5)*2) * (1LL<<(sizeof(long long)*8-2))); | 78 K_l[i] = (long long) (((rand_d()-0.5)*2) * (1LL<<(sizeof(long long)*8-2))); |
79 K_p[i] = (void*) (long) (((rand_d()-0.5)*2) * (1LL<<(sizeof(void*)*8-1))); | 79 K_C[i] = (unsigned char) (((rand_d()-0.5)*2) * (1<<7)); |
80 K_f[i] = (float) (rand_d() * FLT_MAX); | 80 K_S[i] = (unsigned short) (((rand_d()-0.5)*2) * (1<<(sizeof(short)*8-1))); |
81 K_d[i] = (double) (((rand_d()-0.5)*2) * DBL_MAX); | 81 K_I[i] = (unsigned int) (((rand_d()-0.5)*2) * (1<<(sizeof(int)*8-2))); |
82 K_J[i] = (unsigned long) (((rand_d()-0.5)*2) * (1L<<(sizeof(long)*8-2))); | |
83 K_L[i] = (unsigned long long)(((rand_d()-0.5)*2) * (1LL<<(sizeof(long long)*8-2))); | |
84 K_p[i] = (void*)(long) (((rand_d()-0.5)*2) * (1LL<<(sizeof(void*)*8-1))); | |
85 K_f[i] = (float) (rand_d() * FLT_MAX); | |
86 K_d[i] = (double) (((rand_d()-0.5)*2) * DBL_MAX); | |
82 K_a[i] = malloc(maxaggrsize+AGGR_MISALIGN); | 87 K_a[i] = malloc(maxaggrsize+AGGR_MISALIGN); |
83 rand_mem__fp_friendly(K_a[i], maxaggrsize+AGGR_MISALIGN); | 88 rand_mem__fp_friendly(K_a[i], maxaggrsize+AGGR_MISALIGN); |
84 K_a[i] = (char*)K_a[i]+AGGR_MISALIGN; | 89 K_a[i] = (char*)K_a[i]+AGGR_MISALIGN; |
85 } | 90 } |
86 } | 91 } |