summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2016-03-13 22:05:13 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2016-04-09 20:23:07 -0700
commit5c7a48dcf52dbcd9ed6fcc0bb08b770c70e5023a (patch)
treec83b91c2c0b0e848b5e873deefb552eaa9303044 /examples
parentfac3ed2e1c26757af155fc02aa6ea2a966f3904d (diff)
downloadrabbitmq-c-5c7a48dcf52dbcd9ed6fcc0bb08b770c70e5023a.tar.gz
Fix: small warning fixes.
Diffstat (limited to 'examples')
-rw-r--r--examples/amqp_connect_timeout.c3
-rw-r--r--examples/amqp_rpc_sendstring_client.c2
-rw-r--r--examples/amqps_connect_timeout.c6
3 files changed, 5 insertions, 6 deletions
diff --git a/examples/amqp_connect_timeout.c b/examples/amqp_connect_timeout.c
index c2bd5ec..03eddc9 100644
--- a/examples/amqp_connect_timeout.c
+++ b/examples/amqp_connect_timeout.c
@@ -64,6 +64,7 @@ int main(int argc, char const *const *argv)
int port;
amqp_socket_t *socket;
amqp_connection_state_t conn;
+ struct timeval tval;
struct timeval *tv;
if (argc < 3) {
@@ -72,7 +73,7 @@ int main(int argc, char const *const *argv)
}
if (argc > 3) {
- tv = malloc(sizeof(struct timeval));
+ tv = &tval;
tv->tv_sec = atoi(argv[3]);
diff --git a/examples/amqp_rpc_sendstring_client.c b/examples/amqp_rpc_sendstring_client.c
index 5b1ebfc..fdca18a 100644
--- a/examples/amqp_rpc_sendstring_client.c
+++ b/examples/amqp_rpc_sendstring_client.c
@@ -168,7 +168,7 @@ int main(int argc, char *argv[])
break;
}
- printf("Frame type: %d channel: %d\n", frame.frame_type, frame.channel);
+ printf("Frame type: %u channel: %u\n", frame.frame_type, frame.channel);
if (frame.frame_type != AMQP_FRAME_METHOD) {
continue;
}
diff --git a/examples/amqps_connect_timeout.c b/examples/amqps_connect_timeout.c
index 81e1e91..972c2f7 100644
--- a/examples/amqps_connect_timeout.c
+++ b/examples/amqps_connect_timeout.c
@@ -68,6 +68,7 @@ int main(int argc, char const *const *argv)
int timeout;
amqp_socket_t *socket;
amqp_connection_state_t conn;
+ struct timeval tval;
struct timeval *tv;
if (argc < 3) {
@@ -83,10 +84,7 @@ int main(int argc, char const *const *argv)
timeout = atoi(argv[3]);
if (timeout > 0) {
- tv = malloc(sizeof(struct timeval));
- if (tv == NULL) {
- die("failed to malloc struct timeval");
- }
+ tv = &tval;
tv->tv_sec = timeout;
tv->tv_usec = 0;