notif-iter.c: fix warnings
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 2 May 2017 19:27:45 +0000 (15:27 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:42 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/ctf/common/notif-iter/notif-iter.c
plugins/ctf/common/notif-iter/notif-iter.h

index be79603e672525b5f251c203f182040aa5840675..496f95a4222ebdc2e977d0fab866733e4ae3e0b4 100644 (file)
@@ -361,7 +361,7 @@ static inline
 enum bt_ctf_notif_iter_status notif_iter_status_from_m_status(
                enum bt_ctf_notif_iter_medium_status m_status)
 {
-       return m_status;
+       return (int) m_status;
 }
 
 static inline
@@ -382,38 +382,12 @@ size_t packet_at(struct bt_ctf_notif_iter *notit)
        return notit->buf.packet_offset + notit->buf.at;
 }
 
-static inline
-size_t remaining_content_bits(struct bt_ctf_notif_iter *notit)
-{
-       if (notit->cur_content_size == -1) {
-               return -1;
-       }
-
-       return notit->cur_content_size - packet_at(notit);
-}
-
-static inline
-size_t remaining_packet_bits(struct bt_ctf_notif_iter *notit)
-{
-       if (notit->cur_packet_size == -1) {
-               return -1;
-       }
-
-       return notit->cur_packet_size - packet_at(notit);
-}
-
 static inline
 void buf_consume_bits(struct bt_ctf_notif_iter *notit, size_t incr)
 {
        notit->buf.at += incr;
 }
 
-static inline
-bool buf_has_enough_bits(struct bt_ctf_notif_iter *notit, size_t sz)
-{
-       return buf_available_bits(notit) >= sz;
-}
-
 static
 enum bt_ctf_notif_iter_status request_medium_bytes(
                struct bt_ctf_notif_iter *notit)
@@ -2211,30 +2185,6 @@ end:
        BT_PUT(event);
 }
 
-//FIXME: not used ?
-static
-void notify_eos(struct bt_ctf_notif_iter *notit,
-               struct bt_notification **notification)
-{
-       struct bt_ctf_stream *stream = NULL;
-       struct bt_notification *ret = NULL;
-
-       /* Ask the user for the stream */
-       stream = notit->medium.medops.get_stream(notit->meta.stream_class,
-                       notit->medium.data);
-       if (!stream) {
-               goto end;
-       }
-
-       ret = bt_notification_stream_end_create(stream);
-       if (!ret) {
-               goto end;
-       }
-       *notification = ret;
-end:
-       BT_PUT(stream);
-}
-
 static
 int init_clock_states(GHashTable *clock_states, struct bt_ctf_trace *trace)
 {
index 90a53bae7c841ee9fe439b0328e7011b0556beb6..476e7d7a90138639c127adaa8f5184551267eb5f 100644 (file)
@@ -68,7 +68,7 @@ enum bt_ctf_notif_iter_medium_status {
        BT_CTF_NOTIF_ITER_MEDIUM_STATUS_ERROR = -1,
 
        /** Everything okay. */
-       BT_CTF_NOTIF_ITER_MEDIUM_STATUS_OK =            0,
+       BT_CTF_NOTIF_ITER_MEDIUM_STATUS_OK =    0,
 };
 
 /**
@@ -81,7 +81,7 @@ enum bt_ctf_notif_iter_status {
         * The medium function called by the notification iterator
         * function reached the end of the file.
         */
-       BT_CTF_NOTIF_ITER_STATUS_EOF =  -4,
+       BT_CTF_NOTIF_ITER_STATUS_EOF = BT_CTF_NOTIF_ITER_MEDIUM_STATUS_EOF,
 
        /**
         * There is no data available right now, try again later.
@@ -92,13 +92,13 @@ enum bt_ctf_notif_iter_status {
         * last called notification iterator function once the situation
         * is resolved.
         */
-       BT_CTF_NOTIF_ITER_STATUS_AGAIN =        -3,
+       BT_CTF_NOTIF_ITER_STATUS_AGAIN = BT_CTF_NOTIF_ITER_MEDIUM_STATUS_AGAIN,
 
        /** Invalid argument. */
-       BT_CTF_NOTIF_ITER_STATUS_INVAL =        -2,
+       BT_CTF_NOTIF_ITER_STATUS_INVAL = BT_CTF_NOTIF_ITER_MEDIUM_STATUS_INVAL,
 
        /** General error. */
-       BT_CTF_NOTIF_ITER_STATUS_ERROR =        -1,
+       BT_CTF_NOTIF_ITER_STATUS_ERROR = BT_CTF_NOTIF_ITER_MEDIUM_STATUS_ERROR,
 
        /** Everything okay. */
        BT_CTF_NOTIF_ITER_STATUS_OK =   0,
This page took 0.029425 seconds and 4 git commands to generate.