diff options
author | David Wragg <david@rabbitmq.com> | 2010-07-28 01:08:49 +0100 |
---|---|---|
committer | David Wragg <david@rabbitmq.com> | 2010-07-28 01:08:49 +0100 |
commit | 27235c0046dfc87b4f57c652681df4436fce3e0e (patch) | |
tree | 1f8bac3beade9b6e3907c322ea5131d703263943 /tools | |
parent | d0509667889cf799a252bb0c4e8b2d86d75645b6 (diff) | |
download | rabbitmq-c-github-ask-27235c0046dfc87b4f57c652681df4436fce3e0e.tar.gz |
Fix "const char *" to "void *" conversion warnings
Functions returning a heap-allocated string should return a "char *",
not a "const char *": Because the result is heap-allocated and becomes
the responsibility of the caller, it is certainly modifiable. And the
pointer will likely get passed to free(), triggering a conversion
warning from gcc. So remove all the relevant consts.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/common.c | 4 | ||||
-rw-r--r-- | tools/common.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tools/common.c b/tools/common.c index 2a640be..c5bda77 100644 --- a/tools/common.c +++ b/tools/common.c @@ -105,7 +105,7 @@ void die_amqp_error(int err, const char *fmt, ...) exit(1); } -const char *amqp_server_exception_string(amqp_rpc_reply_t r) +char *amqp_server_exception_string(amqp_rpc_reply_t r) { int res; char *s; @@ -140,7 +140,7 @@ const char *amqp_server_exception_string(amqp_rpc_reply_t r) return res >= 0 ? s : NULL; } -const char *amqp_rpc_reply_string(amqp_rpc_reply_t r) +char *amqp_rpc_reply_string(amqp_rpc_reply_t r) { switch (r.reply_type) { case AMQP_RESPONSE_NORMAL: diff --git a/tools/common.h b/tools/common.h index 0caee98..84889d3 100644 --- a/tools/common.h +++ b/tools/common.h @@ -55,8 +55,8 @@ #include <amqp.h> #include <amqp_framing.h> -extern const char *amqp_server_exception_string(amqp_rpc_reply_t r); -extern const char *amqp_rpc_reply_string(amqp_rpc_reply_t r); +extern char *amqp_server_exception_string(amqp_rpc_reply_t r); +extern char *amqp_rpc_reply_string(amqp_rpc_reply_t r); extern void die(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); |