From: David Goulet Date: Thu, 31 May 2012 16:21:27 +0000 (-0400) Subject: Fix: clang llvm warnings X-Git-Tag: v2.0.2~4 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9fbaebcf83861abd543c148b4ab0042aa374a0e1;p=lttng-tools.git Fix: clang llvm warnings Mostly fix unsigned expression and implicit conversion. URCU still shows warnings but irrelevant. Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/event.c b/src/bin/lttng-sessiond/event.c index 5a6825e6e..c9c2f17f4 100644 --- a/src/bin/lttng-sessiond/event.c +++ b/src/bin/lttng-sessiond/event.c @@ -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; diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 7327c3cb2..03fbff633 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -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) { diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 1d48002d0..ed635f960 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -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) { diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 7dbea5c18..43caabf93 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -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++; diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c index afeaa0628..38708fce1 100644 --- a/src/bin/lttng/commands/add_context.c +++ b/src/bin/lttng/commands/add_context.c @@ -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; diff --git a/src/common/runas.c b/src/common/runas.c index 2c2015aa2..3a89cc9ab 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -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