comparison tests/fptest.c @ 2390:88be5cf55caf

Use correct format specifier DM_PRIu_SIZE_T instead of DM_PRId64.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 09 Jan 2020 20:37:54 +0200
parents 186cf6a7d634
children
comparison
equal deleted inserted replaced
2389:647671a9a0b8 2390:88be5cf55caf
4 4
5 #define FP_DW_SIZE 8 5 #define FP_DW_SIZE 8
6 #define FP_W0_SIZE 4 6 #define FP_W0_SIZE 4
7 7
8 static int test_number = 0; 8 static int test_number = 0;
9
9 10
10 void check(const char *str, DMFixedPoint v, Sint64 dw) 11 void check(const char *str, DMFixedPoint v, Sint64 dw)
11 { 12 {
12 DMFixedPoint *q = (DMFixedPoint *) &dw; 13 DMFixedPoint *q = (DMFixedPoint *) &dw;
13 14
25 { 26 {
26 test_number++; 27 test_number++;
27 printf("\nTEST #%d: %s\n", test_number, msg); 28 printf("\nTEST #%d: %s\n", test_number, msg);
28 } 29 }
29 30
31
30 int main(int argc, char *argv[]) 32 int main(int argc, char *argv[])
31 { 33 {
34 DMFixedPoint a, b, delta;
32 int i; 35 int i;
33 DMFixedPoint a, b, delta;
34 char *s; 36 char *s;
35 37
36 (void) argc; 38 (void) argc;
37 (void) argv; 39 (void) argv;
38 40
46 48
47 printf( 49 printf(
48 "SDL byte order = %s (%d)\n\n", s, SDL_BYTEORDER); 50 "SDL byte order = %s (%d)\n\n", s, SDL_BYTEORDER);
49 51
50 printf( 52 printf(
51 "sizeof(DMFixedPoint) = %" DM_PRId64 " bytes\n" 53 "sizeof(DMFixedPoint) = %" DM_PRIu_SIZE_T " bytes\n"
52 "sizeof(DMFixedPoint.dw) = %" DM_PRId64 " bytes (should be %d)\n" 54 "sizeof(DMFixedPoint.dw) = %" DM_PRIu_SIZE_T " bytes (should be %d)\n"
53 "sizeof(DMFixedPoint.w[0]) = %" DM_PRId64 " bytes (should be %d)\n", 55 "sizeof(DMFixedPoint.w[0]) = %" DM_PRIu_SIZE_T " bytes (should be %d)\n",
54 sizeof(a), sizeof(a.dw), FP_DW_SIZE, 56 sizeof(a), sizeof(a.dw), FP_DW_SIZE,
55 sizeof(a.w[0]), FP_W0_SIZE); 57 sizeof(a.w[0]), FP_W0_SIZE);
56 58
57 if (sizeof(a.dw) != FP_DW_SIZE || sizeof(a.w[0]) != FP_W0_SIZE) 59 if (sizeof(a.dw) != FP_DW_SIZE || sizeof(a.w[0]) != FP_W0_SIZE)
58 { 60 {