Fix: clang llvm warnings
authorDavid Goulet <dgoulet@efficios.com>
Thu, 31 May 2012 16:21:27 +0000 (12:21 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 31 May 2012 16:29:12 +0000 (12:29 -0400)
Mostly fix unsigned expression and implicit conversion.

URCU still shows warnings but irrelevant.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/event.c
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/trace-ust.c
src/bin/lttng-sessiond/ust-app.c
src/bin/lttng/commands/add_context.c
src/common/runas.c

index 5a6825e6ef8a7412ec679bbb9f0c67cb95b12e7b..c9c2f17f4a24450d561e7d4d607f95c5744de2a5 100644 (file)
@@ -279,8 +279,7 @@ end:
 int event_ust_enable_all_tracepoints(struct ltt_ust_session *usess, int domain,
                struct ltt_ust_channel *uchan)
 {
-       int ret, i;
-       size_t size;
+       int ret, i, size;
        struct lttng_ht_iter iter;
        struct ltt_ust_event *uevent = NULL;
        struct lttng_event *events = NULL;
@@ -521,8 +520,7 @@ error:
 int event_ust_disable_all_tracepoints(struct ltt_ust_session *usess, int domain,
                struct ltt_ust_channel *uchan)
 {
-       int ret, i;
-       size_t size;
+       int ret, i, size;
        struct lttng_ht_iter iter;
        struct ltt_ust_event *uevent = NULL;
        struct lttng_event *events = NULL;
index 7327c3cb2262ddf4337b46c08f2d02160f1136e7..03fbff63324b38fc31c34d8c75e126b77a9835dc 100644 (file)
@@ -3668,7 +3668,7 @@ skip_domain:
        }
        case LTTNG_LIST_CHANNELS:
        {
-               size_t nb_chan;
+               int nb_chan;
                struct lttng_channel *channels;
 
                nb_chan = cmd_list_channels(cmd_ctx->lsm->domain.type,
@@ -4198,13 +4198,15 @@ static int set_permissions(char *rundir)
        int ret;
        gid_t gid;
 
-       gid = allowed_group();
-       if (gid < 0) {
+       ret = allowed_group();
+       if (ret < 0) {
                WARN("No tracing group detected");
                ret = 0;
                goto end;
        }
 
+       gid = ret;
+
        /* Set lttng run dir */
        ret = chown(rundir, 0, gid);
        if (ret < 0) {
index 1d48002d07297dad4ff88f8903c3d9ab422416b6..ed635f960501b672b047ffd245436cbf46b2c533 100644 (file)
@@ -152,7 +152,7 @@ struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *chan,
        luc->attr.num_subbuf = chan->attr.num_subbuf;
        luc->attr.switch_timer_interval = chan->attr.switch_timer_interval;
        luc->attr.read_timer_interval = chan->attr.read_timer_interval;
-       luc->attr.output = chan->attr.output;
+       luc->attr.output = (enum lttng_ust_output) chan->attr.output;
 
        /* Translate to UST output enum */
        switch (luc->attr.output) {
index 7dbea5c182ca4c6e1a54a89c74a3f0f2c737fe23..43caabf933f7ae747b96051ef11efe31f748dd8b 100644 (file)
@@ -1479,7 +1479,7 @@ int ust_app_list_events(struct lttng_event **events)
                        }
                        memcpy(tmp[count].name, uiter.name, LTTNG_UST_SYM_NAME_LEN);
                        tmp[count].loglevel = uiter.loglevel;
-                       tmp[count].type = LTTNG_UST_TRACEPOINT;
+                       tmp[count].type = (enum lttng_event_type) LTTNG_UST_TRACEPOINT;
                        tmp[count].pid = app->pid;
                        tmp[count].enabled = -1;
                        count++;
index afeaa0628c130f53e2596a35f80d1aa57f210a93..38708fce15dd784a2e0ae97700d7041793fd885d 100644 (file)
@@ -390,7 +390,7 @@ static int add_context(char *session_name)
 
        /* Iterate over all the context types given */
        cds_list_for_each_entry(type, &ctx_type_list.head, list) {
-               context.ctx = type->opt->ctx_type;
+               context.ctx = (enum lttng_event_context_type) type->opt->ctx_type;
                if (context.ctx == LTTNG_EVENT_CONTEXT_PERF_COUNTER) {
                        context.u.perf_counter.type = type->opt->u.perf.type;
                        context.u.perf_counter.config = type->opt->u.perf.config;
index 2c2015aa2d5b8206bca9052320553f8da78d431d..3a89cc9ab8d1f73795ca2d9f963fd34423911cbb 100644 (file)
@@ -153,13 +153,14 @@ int _open(void *_data)
 static
 int child_run_as(void *_data)
 {
+       int ret;
        struct run_as_data *data = _data;
-       size_t writelen, writeleft, index;
+       ssize_t writelen;
+       size_t writeleft, index;
        union {
                int i;
                char c[sizeof(int)];
        } sendret;
-       int ret;
 
        /*
         * Child: it is safe to drop egid and euid while sharing the
This page took 0.032333 seconds and 4 git commands to generate.