Commit ce3dedb5 authored by Ghislain MARY's avatar Ghislain MARY

Really fix casts.

parent b05a8e71
......@@ -129,15 +129,15 @@ static ORTP_INLINE uint32_t report_block_get_fraction_lost(const report_block_t
return (ntohl(rb->fl_cnpl)>>24);
}
static ORTP_INLINE int32_t report_block_get_cum_packet_lost(const report_block_t * rb){
int cum_loss = (int)ntohl(rb->fl_cnpl);
uint32_t cum_loss = (uint32_t)ntohl(rb->fl_cnpl);
if (((cum_loss>>23)&1)==0)
return (int32_t) (0x00FFFFFF & cum_loss);
else
return (int32_t)0xFF000000 | cum_loss-0xFFFFFF-1;
return (int32_t)(0xFF000000 | (cum_loss-0xFFFFFF-1));
}
static ORTP_INLINE void report_block_set_fraction_lost(report_block_t * rb, int fl){
rb->fl_cnpl = htonl( (ntohl(rb->fl_cnpl) & 0xFFFFFF) | (uint32_t) (fl&0xFF)<<24);
rb->fl_cnpl = (uint32_t)htonl( ((uint32_t)ntohl(rb->fl_cnpl) & 0xFFFFFF) | ((uint32_t)fl&0xFF)<<24);
}
static ORTP_INLINE void report_block_set_cum_packet_lost(report_block_t * rb, int64_t cpl) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment