From: David Goulet Date: Fri, 11 Feb 2011 21:16:11 +0000 (-0500) Subject: UST-wide warning fixes X-Git-Tag: v1.9.1~479 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e2b465757cadd72353b3ce4ae2b9402d66750e3b;p=lttng-ust.git UST-wide warning fixes Signed-off-by: David Goulet Signed-off-by: Mathieu Desnoyers --- diff --git a/libust/buffers.c b/libust/buffers.c index 2e6a1618..4e8004c6 100644 --- a/libust/buffers.c +++ b/libust/buffers.c @@ -1243,6 +1243,10 @@ size_t ltt_write_event_header_slow(struct ust_channel *channel, case LTT_RFLAG_ID: header.id_time = 31 << LTT_TSC_BITS; break; + default: + WARN_ON_ONCE(1); + header.id_time = 0; + break; } header.id_time |= (u32)tsc & LTT_TSC_MASK; diff --git a/libust/trace_event.c b/libust/trace_event.c index 76628c55..b54d361f 100644 --- a/libust/trace_event.c +++ b/libust/trace_event.c @@ -89,7 +89,7 @@ static void trace_event_get_iter(struct trace_event_iter *iter) int found = 0; found = lib_get_iter_trace_events(iter); -end: + if (!found) trace_event_iter_reset(iter); } diff --git a/libust/tracectl.c b/libust/tracectl.c index 25fa4d57..25f84ccd 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -828,7 +828,7 @@ static void process_marker_cmd(int sock, int command, { struct ustcomm_header _reply_header; struct ustcomm_header *reply_header = &_reply_header; - int result; + int result = 0; memset(reply_header, 0, sizeof(*reply_header)); diff --git a/libustconsumer/libustconsumer.c b/libustconsumer/libustconsumer.c index 739a2223..25c84ce0 100644 --- a/libustconsumer/libustconsumer.c +++ b/libustconsumer/libustconsumer.c @@ -445,7 +445,8 @@ static void destroy_buffer(struct ustconsumer_callbacks *callbacks, int consumer_loop(struct ustconsumer_instance *instance, struct buffer_info *buf) { - int result, read_result; + int result = 0; + int read_result; char read_buf; pthread_cleanup_push(decrement_active_buffers, instance); diff --git a/snprintf/vfprintf.c b/snprintf/vfprintf.c index d4953be2..1b8fba67 100644 --- a/snprintf/vfprintf.c +++ b/snprintf/vfprintf.c @@ -239,7 +239,7 @@ int ust_safe_vfprintf(LFILE *fp, const char *fmt0, va_list ap) int dprec; /* a copy of prec if %[diouxX], 0 otherwise */ int realsz; /* field size expanded by dprec */ int size; /* size of converted field or string */ - const char *xdigs; /* digits for %[xX] conversion */ + const char *xdigs = NULL; /* digits for %[xX] conversion */ #define NIOV 8 struct __suio uio; /* output information: summary */ struct __siov iov[NIOV];/* ... and individual io vectors */ diff --git a/tests/register_test/register_test.c b/tests/register_test/register_test.c index b593185e..d5cd352a 100644 --- a/tests/register_test/register_test.c +++ b/tests/register_test/register_test.c @@ -55,7 +55,7 @@ void tptest_probe(void *data, int anint) static void * register_thread_main(void *data) { - int ret, i, j = 0; + int i, j = 0; struct hello_trace_struct hello[HELLO_LENGTH]; diff --git a/tests/tap.c b/tests/tap.c index bd7f81cc..a54fd178 100644 --- a/tests/tap.c +++ b/tests/tap.c @@ -37,7 +37,7 @@ static void *_tap_comment_stdout(void *_unused) if (strncmp(line, "_TAP", 4)) { fprintf(normal_stdout, "# %s", line); } else { - fprintf(normal_stdout, &line[4]); + fprintf(normal_stdout, "# %s", &line[4]); } } pthread_exit(0);