> 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. Regards, Andrzej Ciarkowski _______________________________________________ sipxtapi-dev mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/
