Commit cfc2e87e by Jeff Law

Opps. Wrong file the first time.

From-SVN: r27813
parent da621fd2
#define TP_BSIZE 64 #include <stdlib.h>
char buf[2*TP_BSIZE]; struct {
char (*nextblock)[TP_BSIZE] = (char (*)[TP_BSIZE]) buf; long sqlcode;
} sqlca;
union u_test {
char dummy[TP_BSIZE];
struct s_test {
int a;
int b;
int c;
} s_test;
};
main(int argc, char **argv) struct data_record {
int dummy;
int a[100];
} *data_ptr, data_tmp;
int
num_records()
{ {
int i; return 1;
char dp[TP_BSIZE]; }
for (i = 0; i < 2*TP_BSIZE; i++) void
buf[i] = '.'; fetch()
for (i = 0; i < TP_BSIZE; i++) {
dp[i] = 'a'; static int fetch_count;
memset(&data_tmp, 0x55, sizeof(data_tmp));
sqlca.sqlcode = (++fetch_count > 1 ? 100 : 0);
}
*(union u_test *)(*(nextblock)++) = *(union u_test *)dp;
for (i = 0; i < 2*TP_BSIZE; i++) void
printf("%c%s", buf[i], (i % 64) == 63 ? "\n" : ""); load_data() {
exit(0); struct data_record *p;
int num = num_records();
data_ptr = malloc(num * sizeof(struct data_record));
memset(data_ptr, 0xaa, num * sizeof(struct data_record));
fetch();
p = data_ptr;
while (sqlca.sqlcode == 0) {
*p++ = data_tmp;
fetch();
}
}
main()
{
load_data();
if (data_ptr[0].dummy != 0x55555555)
abort ();
exit (0);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment