ccrtp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ccrtp-devel] timevalIntervalTo65536 function


From: Takegami, Takashi
Subject: [Ccrtp-devel] timevalIntervalTo65536 function
Date: Mon, 25 Apr 2005 21:53:26 +0900
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Hello,

  I have a question in timevalIntervalTo65536 function (rtcppkt.cpp).
  Doesn't it output wrong value?  t.tv_usec has the value of minus,
after "t.tv_usec << 12".

  For example,
    t.tv_usec = 900000(10) = 00000000000011011011101110100000(2)
    "t.tv_usec << 12" then, 1101101110111010000000...(2)
    In this case, t.tv_usec has the value of minus, because t.tv_usec is
not uint32.
    So that, timevalIntervalTo65536 function outputs more smaller value
than the right value.


  - result += (t.tv_usec << 12) / 125000 * 2;
  + result += ((unsigned int)(t.tv_usec << 12)) / 125000 * 2;


Hope this helps.
-- 
TAKEGAMI




reply via email to

[Prev in Thread] Current Thread [Next in Thread]