Port: fix format warnings on Cygwin
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 15 May 2018 20:19:49 +0000 (16:19 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 17 May 2018 18:25:39 +0000 (14:25 -0400)
On Cygwin, be64toh() returns a "long long unsigned int" while the
format specifier PRIu64 expects a "long unsigned int". Both types
are 64bits integers, just cast the result to uint64_t to silence
the warnings.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/live.c

index 70da4a9a71b383c0d8fa70120d7941adeca78582..d6719e724aa8b15b624aef06bc059ce254f1f5f7 100644 (file)
@@ -1038,12 +1038,12 @@ int viewer_attach_session(struct relay_connection *conn)
        session = session_get_by_id(be64toh(request.session_id));
        if (!session) {
                DBG("Relay session %" PRIu64 " not found",
-                               be64toh(request.session_id));
+                               (uint64_t) be64toh(request.session_id));
                response.status = htobe32(LTTNG_VIEWER_ATTACH_UNK);
                goto send_reply;
        }
        DBG("Attach session ID %" PRIu64 " received",
-               be64toh(request.session_id));
+               (uint64_t) be64toh(request.session_id));
 
        if (session->live_timer == 0) {
                DBG("Not live session");
@@ -1297,7 +1297,7 @@ int viewer_get_next_index(struct relay_connection *conn)
        vstream = viewer_stream_get_by_id(be64toh(request_index.stream_id));
        if (!vstream) {
                DBG("Client requested index of unknown stream id %" PRIu64,
-                               be64toh(request_index.stream_id));
+                               (uint64_t) be64toh(request_index.stream_id));
                viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_ERR);
                goto send_reply;
        }
@@ -1411,7 +1411,7 @@ int viewer_get_next_index(struct relay_connection *conn)
         */
        DBG("Sending viewer index for stream %" PRIu64 " offset %" PRIu64,
                rstream->stream_handle,
-               be64toh(packet_index.offset));
+               (uint64_t) be64toh(packet_index.offset));
        viewer_index.offset = packet_index.offset;
        viewer_index.packet_size = packet_index.packet_size;
        viewer_index.content_size = packet_index.content_size;
@@ -1506,7 +1506,7 @@ int viewer_get_packet(struct relay_connection *conn)
        vstream = viewer_stream_get_by_id(be64toh(get_packet_info.stream_id));
        if (!vstream) {
                DBG("Client requested packet of unknown stream id %" PRIu64,
-                               be64toh(get_packet_info.stream_id));
+                               (uint64_t) be64toh(get_packet_info.stream_id));
                reply_header.status = htobe32(LTTNG_VIEWER_GET_PACKET_ERR);
                goto send_reply_nolock;
        } else {
@@ -1526,7 +1526,7 @@ int viewer_get_packet(struct relay_connection *conn)
                        SEEK_SET);
        if (lseek_ret < 0) {
                PERROR("lseek fd %d to offset %" PRIu64, vstream->stream_fd->fd,
-                       be64toh(get_packet_info.offset));
+                       (uint64_t) be64toh(get_packet_info.offset));
                goto error;
        }
        read_len = lttng_read(vstream->stream_fd->fd,
@@ -1535,7 +1535,7 @@ int viewer_get_packet(struct relay_connection *conn)
        if (read_len < packet_data_len) {
                PERROR("Relay reading trace file, fd: %d, offset: %" PRIu64,
                                vstream->stream_fd->fd,
-                               be64toh(get_packet_info.offset));
+                               (uint64_t) be64toh(get_packet_info.offset));
                goto error;
        }
        reply_header.status = htobe32(LTTNG_VIEWER_GET_PACKET_OK);
@@ -1569,7 +1569,7 @@ send_reply_nolock:
        }
 
        DBG("Sent %u bytes for stream %" PRIu64, reply_size,
-                       be64toh(get_packet_info.stream_id));
+                       (uint64_t) be64toh(get_packet_info.stream_id));
 
 end_free:
        free(reply);
@@ -1621,7 +1621,7 @@ int viewer_get_metadata(struct relay_connection *conn)
                 * find it.
                 */
                DBG("Client requested metadata of unknown stream id %" PRIu64,
-                               be64toh(request.stream_id));
+                               (uint64_t) be64toh(request.stream_id));
                reply.status = htobe32(LTTNG_VIEWER_METADATA_ERR);
                goto send_reply;
        }
@@ -1707,7 +1707,7 @@ send_reply:
        }
 
        DBG("Sent %" PRIu64 " bytes of metadata for stream %" PRIu64, len,
-                       be64toh(request.stream_id));
+                       (uint64_t) be64toh(request.stream_id));
 
        DBG("Metadata sent");
 
@@ -1796,7 +1796,7 @@ int viewer_detach_session(struct relay_connection *conn)
        session = session_get_by_id(be64toh(request.session_id));
        if (!session) {
                DBG("Relay session %" PRIu64 " not found",
-                               be64toh(request.session_id));
+                               (uint64_t) be64toh(request.session_id));
                response.status = htobe32(LTTNG_VIEWER_DETACH_SESSION_UNK);
                goto send_reply;
        }
This page took 0.028011 seconds and 4 git commands to generate.