From 162fc19f4d896c3db862f1da303823dcbe9780ec Mon Sep 17 00:00:00 2001 From: Michael Steinert Date: Wed, 16 May 2012 10:42:44 -0600 Subject: Fix compiler warnings (checked clang & gcc) Signed-off-by: Michael Steinert --- tools/common.c | 9 +++++---- tools/consume.c | 2 +- tools/declare_queue.c | 2 +- tools/delete_queue.c | 2 +- tools/get.c | 2 +- tools/publish.c | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/common.c b/tools/common.c index 71ae07d..2c248b9 100644 --- a/tools/common.c +++ b/tools/common.c @@ -30,7 +30,7 @@ * ***** END LICENSE BLOCK ***** */ -#ifndef HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -181,7 +181,7 @@ struct poptOption connect_options[] = { "the username to login with", "username"}, {"password", 0, POPT_ARG_STRING, &amqp_password, 0, "the password to login with", "password"}, - { NULL, 0, 0, NULL, 0 } + { NULL, '\0', 0, NULL, 0, NULL, NULL } }; static void init_connection_info(struct amqp_connection_info *ci) @@ -331,7 +331,8 @@ amqp_bytes_t read_all(int fd) bytes.len = 0; for (;;) { - ssize_t res = read(fd, bytes.bytes+bytes.len, space-bytes.len); + ssize_t res = read(fd, (char *)bytes.bytes + bytes.len, + space-bytes.len); if (res == 0) break; @@ -360,7 +361,7 @@ void write_all(int fd, amqp_bytes_t data) die_errno(errno, "write"); data.len -= res; - data.bytes += res; + data.bytes = (char *)data.bytes + res; } } diff --git a/tools/consume.c b/tools/consume.c index 9c53606..4f79889 100644 --- a/tools/consume.c +++ b/tools/consume.c @@ -182,7 +182,7 @@ int main(int argc, const char **argv) "stop consuming after this many messages are consumed", "limit"}, POPT_AUTOHELP - { NULL, 0, 0, NULL, 0 } + { NULL, '\0', 0, NULL, 0, NULL, NULL } }; opts = process_options(argc, argv, options, diff --git a/tools/declare_queue.c b/tools/declare_queue.c index 5c6a2bd..fc9524c 100644 --- a/tools/declare_queue.c +++ b/tools/declare_queue.c @@ -54,7 +54,7 @@ int main(int argc, const char **argv) {"durable", 'd', POPT_ARG_VAL, &durable, 1, "declare a durable queue", NULL}, POPT_AUTOHELP - { NULL, 0, 0, NULL, 0 } + { NULL, '\0', 0, NULL, 0, NULL, NULL } }; process_all_options(argc, argv, options); diff --git a/tools/delete_queue.c b/tools/delete_queue.c index d9594e9..4577d74 100644 --- a/tools/delete_queue.c +++ b/tools/delete_queue.c @@ -57,7 +57,7 @@ int main(int argc, const char **argv) {"if-empty", 'e', POPT_ARG_VAL, &if_empty, 1, "do not delete unless queue is empty", NULL}, POPT_AUTOHELP - { NULL, 0, 0, NULL, 0 } + { NULL, '\0', 0, NULL, 0, NULL, NULL } }; process_all_options(argc, argv, options); diff --git a/tools/get.c b/tools/get.c index b3e0e81..3e536c7 100644 --- a/tools/get.c +++ b/tools/get.c @@ -62,7 +62,7 @@ int main(int argc, const char **argv) {"queue", 'q', POPT_ARG_STRING, &queue, 0, "the queue to consume from", "queue"}, POPT_AUTOHELP - { NULL, 0, 0, NULL, 0 } + { NULL, '\0', 0, NULL, 0, NULL, NULL } }; process_all_options(argc, argv, options); diff --git a/tools/publish.c b/tools/publish.c index 08ae18a..f7e7e77 100644 --- a/tools/publish.c +++ b/tools/publish.c @@ -79,7 +79,7 @@ int main(int argc, const char **argv) {"body", 'b', POPT_ARG_STRING, &body, 0, "specify the message body", "body"}, POPT_AUTOHELP - { NULL, 0, 0, NULL, 0 } + { NULL, '\0', 0, NULL, 0, NULL, NULL } }; process_all_options(argc, argv, options); -- cgit v1.2.1