Ignore:
Timestamp:
Nov 21, 2005 1:55:47 AM (18 years ago)
Author:
bennylp
Message:

Set svn:eol-style property

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj/os.h

    r51 r65  
    867867 
    868868/** 
     869 * Add timestamp t2 to t1. 
     870 * @param t1        t1. 
     871 * @param t2        t2. 
     872 */ 
     873PJ_INLINE(void) pj_add_timestamp(pj_timestamp *t1, const pj_timestamp *t2) 
     874{ 
     875#if PJ_HAS_INT64 
     876    t1->u64 += t2->u64; 
     877#else 
     878    pj_uint32_t old = t1->u32.lo; 
     879    t1->u32.hi += t2->u32.hi; 
     880    t1->u32.lo += t2->u32.lo; 
     881    if (t1->u32.lo < old) 
     882        ++t1->u32.hi; 
     883#endif 
     884} 
     885 
     886/** 
     887 * Substract timestamp t2 from t1. 
     888 * @param t1        t1. 
     889 * @param t2        t2. 
     890 */ 
     891PJ_INLINE(void) pj_sub_timestamp(pj_timestamp *t1, const pj_timestamp *t2) 
     892{ 
     893#if PJ_HAS_INT64 
     894    t1->u64 -= t2->u64; 
     895#else 
     896    t1->u32.hi -= t2->u32.hi; 
     897    if (t1->u32.lo >= t2->u32.lo) 
     898        t1->u32.lo -= t2->u32.lo; 
     899    else { 
     900        t1->u32.lo -= t2->u32.lo; 
     901        --t1->u32.hi; 
     902    } 
     903#endif 
     904} 
     905 
     906/** 
    869907 * Calculate the elapsed time, and store it in pj_time_val. 
    870908 * This function calculates the elapsed time using highest precision 
Note: See TracChangeset for help on using the changeset viewer.