Skip to contentSkip to conversation

Fix: warnings on Solaris10

PATCH Jérémie Galarneau 1 participant 1 message May 5, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Jérémie Galarneau

author Applied
#1 lore raw

Merged, thanks!

Jérémie

Quoted 93 lines · Michael Jeanson

Cast values to uint64_t before passing them to htobe64() because the implementation on Solaris10 uses bitshifts and will complain when passed 32bits values.

This fixes multiple warnings like:

lttng-live-comm.c:169:2: warning: left shift count >= width of type
cmd.data_size = htobe64(sizeof(connect));

---
 formats/lttng-live/lttng-live-comm.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
formats/lttng-live/lttng-live-comm.c +8 -9
index bfcef69..1912b57 100644
@@ -166,7 +166,7 @@ int lttng_live_establish_connection(struct lttng_live_ctx *ctx)
        }
 
        cmd.cmd = htobe32(LTTNG_VIEWER_CONNECT);
-       cmd.data_size = htobe64(sizeof(connect));
+       cmd.data_size = htobe64((uint64_t) sizeof(connect));
        cmd.cmd_version = htobe32(0);
 
        connect.viewer_session_id = -1ULL;      /* will be set on recv */
@@ -307,7 +307,7 @@ int lttng_live_list_sessions(struct lttng_live_ctx *ctx, const char *path)
        }
 
        cmd.cmd = htobe32(LTTNG_VIEWER_LIST_SESSIONS);
-       cmd.data_size = htobe64(0);
+       cmd.data_size = htobe64((uint64_t) 0);
        cmd.cmd_version = htobe32(0);
 
        ret_len = lttng_live_send(ctx->control_sock, &cmd, sizeof(cmd));
@@ -432,7 +432,7 @@ int lttng_live_attach_session(struct lttng_live_ctx *ctx, uint64_t id)
        }
 
        cmd.cmd = htobe32(LTTNG_VIEWER_ATTACH_SESSION);
-       cmd.data_size = htobe64(sizeof(rq));
+       cmd.data_size = htobe64((uint64_t) sizeof(rq));
        cmd.cmd_version = htobe32(0);
 
        memset(&rq, 0, sizeof(rq));
@@ -662,7 +662,7 @@ retry:
        }
 
        cmd.cmd = htobe32(LTTNG_VIEWER_GET_PACKET);
-       cmd.data_size = htobe64(sizeof(rq));
+       cmd.data_size = htobe64((uint64_t) sizeof(rq));
        cmd.cmd_version = htobe32(0);
 
        memset(&rq, 0, sizeof(rq));
@@ -814,7 +814,7 @@ int get_one_metadata_packet(struct lttng_live_ctx *ctx,
 
        rq.stream_id = htobe64(metadata_stream->id);
        cmd.cmd = htobe32(LTTNG_VIEWER_GET_METADATA);
-       cmd.data_size = htobe64(sizeof(rq));
+       cmd.data_size = htobe64((uint64_t) sizeof(rq));
        cmd.cmd_version = htobe32(0);
 
        ret_len = lttng_live_send(ctx->control_sock, &cmd, sizeof(cmd));
@@ -989,7 +989,7 @@ int get_next_index(struct lttng_live_ctx *ctx,
        struct lttng_viewer_index *rp = &viewer_stream->current_index;
 
        cmd.cmd = htobe32(LTTNG_VIEWER_GET_NEXT_INDEX);
-       cmd.data_size = htobe64(sizeof(rq));
+       cmd.data_size = htobe64((uint64_t) sizeof(rq));
        cmd.cmd_version = htobe32(0);
 
        memset(&rq, 0, sizeof(rq));
@@ -1332,7 +1332,7 @@ int lttng_live_create_viewer_session(struct lttng_live_ctx *ctx)
        }
 
        cmd.cmd = htobe32(LTTNG_VIEWER_CREATE_SESSION);
-       cmd.data_size = htobe64(0);
+       cmd.data_size = htobe64((uint64_t) 0);
        cmd.cmd_version = htobe32(0);
 
        ret_len = lttng_live_send(ctx->control_sock, &cmd, sizeof(cmd));
@@ -1522,7 +1522,7 @@ int lttng_live_get_new_streams(struct lttng_live_ctx *ctx, uint64_t id)
        }
 
        cmd.cmd = htobe32(LTTNG_VIEWER_GET_NEW_STREAMS);
-       cmd.data_size = htobe64(sizeof(rq));
+       cmd.data_size = htobe64((uint64_t) sizeof(rq));
        cmd.cmd_version = htobe32(0);
 
        memset(&rq, 0, sizeof(rq));
--

2.7.4

Signature · 7 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev