trawick 01/06/22 10:45:23
Modified: test testtime.c
Log:
use 64-bit int for conversion of gmt offset to microseconds...
this was broken on Solaris Intel w/ gcc previously
This change also gets rid of a warning due to the mismatch of
apr_int32_t and APR_TIME_T_FMT.
Revision Changes Path
1.20 +4 -3 apr/test/testtime.c
Index: testtime.c
===================================================================
RCS file: /home/cvs/apr/test/testtime.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- testtime.c 2001/06/06 19:19:43 1.19
+++ testtime.c 2001/06/22 17:45:23 1.20
@@ -73,6 +73,7 @@
char *str, *str2;
apr_size_t sz;
apr_int32_t hr_off = -5 * 3600; /* 5 hours in seconds */
+ apr_int64_t hr_off_64;
fprintf(stdout, "Testing Time functions.\n");
@@ -177,11 +178,11 @@
printf("\tChecking imploded time after offset.............");
apr_implode_time(&imp, &xt2);
- hr_off *= APR_USEC_PER_SEC; /* microseconds */
- if (imp != now + hr_off){
+ hr_off_64 = (apr_int64_t)hr_off * APR_USEC_PER_SEC; /* microseconds */
+ if (imp != now + hr_off_64){
printf("Failed! :(\n");
printf("Difference is %" APR_TIME_T_FMT " (should be %"
- APR_TIME_T_FMT ")\n", imp - now, hr_off);
+ APR_INT64_T_FMT ")\n", imp - now, hr_off_64);
exit(-1);
}
printf("OK\n");