Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 35833 invoked by uid 500); 2 Jul 2002 15:47:13 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 35817 invoked from network); 2 Jul 2002 15:47:13 -0000 Date: 2 Jul 2002 15:47:12 -0000 Message-ID: <20020702154712.36576.qmail@icarus.apache.org> From: wrowe@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/include apr_time.h X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N wrowe 2002/07/02 08:47:12 Modified: include apr_time.h Log: Solve Jeff Trawicks nsec failure, we were truncating to 32 bits before performing the modulos operation. While at it, add an apr_time_nsec helper for convenience. Revision Changes Path 1.54 +4 -2 apr/include/apr_time.h Index: apr_time.h =================================================================== RCS file: /home/cvs/apr/include/apr_time.h,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- apr_time.h 12 Jun 2002 22:23:56 -0000 1.53 +++ apr_time.h 2 Jul 2002 15:47:12 -0000 1.54 @@ -95,9 +95,11 @@ /** number of microseconds per second */ #define APR_USEC_PER_SEC APR_TIME_C(1000000) -#define apr_time_usec(time) ((apr_int32_t)(time) % APR_USEC_PER_SEC) +#define apr_time_usec(time) ((apr_int32_t)((time) % APR_USEC_PER_SEC)) -#define apr_time_sec(time) ((apr_int64_t)(time) / APR_USEC_PER_SEC) +#define apr_time_nsec(time) ((apr_int32_t)((time) % APR_USEC_PER_SEC) * (apr_int32_t)1000) + +#define apr_time_sec(time) ((apr_int64_t)((time) / APR_USEC_PER_SEC)) #define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)