summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael Steinert <mike.steinert@gmail.com>2012-05-16 10:42:44 -0600
committerMichael Steinert <mike.steinert@gmail.com>2012-05-17 11:44:45 -0600
commit162fc19f4d896c3db862f1da303823dcbe9780ec (patch)
tree36656320e462ca62575afa30931a7301162732f8 /tools
parenta4881f40d2862f193cc38f9759564370004215c4 (diff)
downloadrabbitmq-c-github-ask-162fc19f4d896c3db862f1da303823dcbe9780ec.tar.gz
Fix compiler warnings (checked clang & gcc)
Signed-off-by: Michael Steinert <mike.steinert@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/common.c9
-rw-r--r--tools/consume.c2
-rw-r--r--tools/declare_queue.c2
-rw-r--r--tools/delete_queue.c2
-rw-r--r--tools/get.c2
-rw-r--r--tools/publish.c2
6 files changed, 10 insertions, 9 deletions
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);