At 10:23 AM 7/2/2002, Brian Pane wrote:
Do you get a correct tv_nsec if you remove the cast to 32-bit int in the apr_time_usec macro?
Yes and no... it isn't the cast (usec or nsec, for that matter, fit in a signed 32 bit integer.) It was the order of evaluation;
-#define apr_time_usec(time) ((apr_int32_t)(time) % APR_USEC_PER_SEC) +#define apr_time_usec(time) ((time) % APR_USEC_PER_SEC)
This isn't the right solution, IMHO. I just committed this;
#define apr_time_usec(time) ((apr_int32_t)((time) % APR_USEC_PER_SEC))
which will take the big number's modulos before truncating to 32 bits.