summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-06-04 12:28:28 -0700
committerGary E. Miller <gem@rellim.com>2015-06-04 12:28:28 -0700
commit09200839cc0c8c8418adae9a5347b0a1fd5eacdc (patch)
treeb6eadce5f9cc91b61c82c36937f83f66bf1bb4f6
parentebb1d9da881c31db7ef2db6ae017daa1238134fa (diff)
downloadgpsd-09200839cc0c8c8418adae9a5347b0a1fd5eacdc.tar.gz
Fix test_timespec for 32 bit compilers.
-rw-r--r--test_timespec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test_timespec.c b/test_timespec.c
index 8623cf75..56fc64ba 100644
--- a/test_timespec.c
+++ b/test_timespec.c
@@ -202,7 +202,7 @@ static int ex_subtract_float( void )
struct subtract_test *p = subtract_tests;
int fail_count = 0;
- printf( "\n\nsubtract test examples using doubles/floats:\n"
+ printf( "\n\nsubtract test examples using doubles,floats,longs:\n"
" TS: TS_SUB()\n"
" l: timespec_to_ns() math\n"
" l32: timespec_to_ns() math with 32 bit long\n"
@@ -218,7 +218,7 @@ static int ex_subtract_float( void )
struct timespec ts_r;
float f_a, f_b, f_r;
double d_a, d_b, d_r;
- long l;
+ long long l;
int32_t l32; /* simulate a 32 bit long */
/* timespec math */
@@ -244,8 +244,8 @@ static int ex_subtract_float( void )
timespec_str( &ts_r, buf_r, sizeof(buf_r) );
printf(" TS; %21s - %21s = %21s\n", buf_a, buf_b, buf_r);
- printf(" l; %21s - %21s = %21ld\n", buf_a, buf_b, l);
- printf(" l32; %21s - %21s = %21ld\n", buf_a, buf_b, (long)l32);
+ printf(" l; %21s - %21s = %21lld\n", buf_a, buf_b, l);
+ printf(" l32; %21s - %21s = %21lld\n", buf_a, buf_b, (long long)l32);
printf(" d; %21.9f - %21.9f = %21.9f\n", d_a, d_b, d_r);
printf(" f; %21.9f - %21.9f = %21.9f\n", f_a, f_b, f_r);
puts("\n");