Right, those values of tv_usec higher than 524288 :) would be wrongly
interpreted as negative values. It's also fixed in CVS. Thanks!

On Mon, Apr 25, 2005 at 09:53:26PM +0900, Takegami, Takashi wrote:
> 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
> 
> 
> _______________________________________________
> Ccrtp-devel mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/ccrtp-devel


_______________________________________________
Ccrtp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/ccrtp-devel

Reply via email to