rtpulpfec: don't use non-portable notation for 64-bit int constants
authorTim-Philipp Müller <tim@centricular.com>
Sat, 17 Mar 2018 13:04:47 +0000 (13:04 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 17 Mar 2018 13:04:47 +0000 (13:04 +0000)
Use GLib macro instead, even if it's a bit unwieldy.

gst/rtp/gstrtpulpfecdec.c
gst/rtp/gstrtpulpfecenc.c
gst/rtp/rtpulpfeccommon.c

index 9c362bd..7b13451 100644 (file)
@@ -336,7 +336,7 @@ gst_rtp_ulpfec_dec_recover (GstRtpUlpFecDec * self, guint32 ssrc, gint media_pt,
 
       /* Is it the only 1 in the mask? Checking if we lacking single packet in
        * that case FEC packet can be used for recovery */
-      if (missing_packets_mask == (1ULL << trailing_zeros)) {
+      if (missing_packets_mask == (G_GUINT64_CONSTANT (1) << trailing_zeros)) {
         GstBuffer *ret;
 
         *dst_seq =
index c9e6850..c06b423 100644 (file)
@@ -224,7 +224,7 @@ gst_rtp_ulpfec_enc_stream_ctx_protect (GstRtpUlpFecEncStreamCtx * ctx,
     }
   }
 
-  g_assert (tmp_mask == 0ULL);
+  g_assert (tmp_mask == 0);
   ret =
       rtp_ulpfec_bitstring_to_fec_rtp_buffer (ctx->scratch_buf, seq_base,
       fec_mask_long, fec_mask, FALSE, pt, seq, timestamp, ssrc);
index 44d2a6e..326b5ff 100644 (file)
@@ -161,14 +161,17 @@ rtp_ulpfec_get_headers_len (gboolean fec_mask_long)
   return sizeof (RtpUlpFecHeader) + fec_level_hdr_get_size (fec_mask_long);
 }
 
+#define ONE_64BIT G_GUINT64_CONSTANT(1)
+
 guint64
 rtp_ulpfec_packet_mask_from_seqnum (guint16 seq,
     guint16 fec_seq_base, gboolean fec_mask_long)
 {
   gint seq_delta = gst_rtp_buffer_compare_seqnum (fec_seq_base, seq);
   if (seq_delta >= 0
-      && seq_delta <= RTP_ULPFEC_SEQ_BASE_OFFSET_MAX (fec_mask_long))
-    return 1ULL << (RTP_ULPFEC_SEQ_BASE_OFFSET_MAX (TRUE) - seq_delta);
+      && seq_delta <= RTP_ULPFEC_SEQ_BASE_OFFSET_MAX (fec_mask_long)) {
+    return ONE_64BIT << (RTP_ULPFEC_SEQ_BASE_OFFSET_MAX (TRUE) - seq_delta);
+  }
   return 0;
 }