On 2/18/07, Andrzej Ciarkowski <[EMAIL PROTECTED]> wrote: > > The problem was caused by the fact that define doesn't behave as we > > would expect > > > > #define RTP_HALF_SEQ (2^15) ///< Half of posible RTP sequence > numbers > > > > unsigned short foo = RTP_HALF_SEQ; > > > > foo has a value of 13 instead of 32768 on my pc. This causes compare > > function to fail and drop correct packets in decoder. > > > > If I change it to > > > > #define RTP_HALF_SEQ (32768) > > > > Then unhold works. Use of ^ in #defines should be avoided. Use number > > and put ^ in comment. > > Actually, it behaves exactly as you would expect, but nevertheless > completely wrong :) > It seems someone mistaken C's bitwise XOR operator (^) with "power" > operator, which doesn't exist in C/C++. In fact 2 xor 15 IS 13 no matter > whether it is a define or not. > Hum.. really. Suggested patch applied, thank you two.
-- Regards, Alexander Chemeris. SIPez LLC. SIP VoIP, IM and Presence Consulting http://www.SIPez.com tel: +1 (617) 273-4000 _______________________________________________ sipxtapi-dev mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/
