55#define TEST_PATTERN 1.3333
56#ifdef HAVE_LONG_LONG_INT
57#define OFF_T_TEST 0x0102030405060708LL
59#define OFF_T_TEST 0x01020304
61#define LONG_TEST 0x01020304
62#define INT_TEST 0x01020304
63#define SHORT_TEST 0x0102
74static union type_conv u;
77static unsigned char dbl_cmpr[] = {0x3f, 0xf5, 0x55, 0x32,
78 0x61, 0x7c, 0x1b, 0xda};
80static unsigned char flt_cmpr[] = {0x3f, 0xaa, 0xa9, 0x93};
81static unsigned char off_t_cmpr[] = {0x01, 0x02, 0x03, 0x04,
82 0x05, 0x06, 0x07, 0x08};
83static unsigned char lng_cmpr[] = {0x01, 0x02, 0x03, 0x04};
84static unsigned char int_cmpr[] = {0x01, 0x02, 0x03, 0x04};
85static unsigned char shrt_cmpr[] = {0x01, 0x02};
97static int find_offset(
unsigned char *,
unsigned char,
int);
98static int dumpflags(
void);
108 printf(
"\n/* Native machine sizes */\n");
109 printf(
"#define NATIVE_DOUBLE %d\n", (
nat_dbl =
sizeof(
double)));
110 printf(
"#define NATIVE_FLOAT %d\n", (
nat_flt =
sizeof(
float)));
112 printf(
"#define NATIVE_LONG %d\n", (
nat_lng =
sizeof(
long)));
115 printf(
"#define NATIVE_CHAR %d\n", (nat_char =
sizeof(
char)));
178 tmp = find_offset(u.c, flt_cmpr[i],
PORT_FLOAT);
206 tmp = find_offset(u.c, off_t_cmpr[i],
nat_off_t);
231 tmp = find_offset(u.c, lng_cmpr[i],
nat_lng);
256 tmp = find_offset(u.c, int_cmpr[i],
nat_int);
258 fprintf(
stderr,
"ERROR, could not find '%x' in int\n", int_cmpr[i]);
280 tmp = find_offset(u.c, shrt_cmpr[i],
nat_shrt);
302 printf(
"\n/* Native machine byte orders */\n");
310 printf(
"\n\n/* Translation matrices from big endian to native */\n");
325 for (i = 0; i < size; i++)
332static int dumpflags(
void)
336 fprintf(
stdout,
"\n/* Double format: */\nstatic int dbl_cnvrt[] = {");
338 while (i < nat_dbl) {
345 fprintf(
stdout,
"/* Float format : */\nstatic int flt_cnvrt[] = {");
347 while (i < nat_flt) {
354 fprintf(
stdout,
"/* off_t format : */\nstatic int off_t_cnvrt[] = {");
356 while (i < nat_off_t) {
363 fprintf(
stdout,
"/* Long format : */\nstatic int lng_cnvrt[] = {");
365 while (i < nat_lng) {
372 fprintf(
stdout,
"/* Int format : */\nstatic int int_cnvrt[] = {");
374 while (i < nat_int) {
381 fprintf(
stdout,
"/* Short format : */\nstatic int shrt_cnvrt[] = {");
383 while (i < nat_shrt) {
#define PORT_DOUBLE
Sizes of types used in portable format (different names used in Vlib/ and diglib/ for the same thing)
#define ENDIAN_LITTLE
Endian check.
unsigned char flt_cnvrt[sizeof(float)]
unsigned char dbl_cnvrt[sizeof(double)]
unsigned char lng_cnvrt[sizeof(long)]
unsigned char off_t_cnvrt[sizeof(off_t)]
unsigned char shrt_cnvrt[sizeof(short)]
unsigned char int_cnvrt[sizeof(int)]
SYMBOL * err(FILE *fp, SYMBOL *s, char *msg)