diff options
-rw-r--r-- | tools/consume.c | 20 | ||||
-rw-r--r-- | tools/declare_queue.c | 4 | ||||
-rw-r--r-- | tools/delete_queue.c | 6 | ||||
-rw-r--r-- | tools/get.c | 2 | ||||
-rw-r--r-- | tools/publish.c | 16 |
5 files changed, 24 insertions, 24 deletions
diff --git a/tools/consume.c b/tools/consume.c index 4a0c75d..ab0b0f9 100644 --- a/tools/consume.c +++ b/tools/consume.c @@ -176,6 +176,7 @@ static void do_consume(amqp_connection_state_t conn, amqp_bytes_t queue, amqp_frame_t frame; struct pipeline pl; uint64_t delivery_tag; + amqp_basic_deliver_t *deliver; int res = amqp_simple_wait_frame(conn, &frame); die_amqp_error(res, "waiting for header frame"); @@ -184,8 +185,7 @@ static void do_consume(amqp_connection_state_t conn, amqp_bytes_t queue, continue; } - amqp_basic_deliver_t *deliver - = (amqp_basic_deliver_t *)frame.payload.method.decoded; + deliver = (amqp_basic_deliver_t *)frame.payload.method.decoded; delivery_tag = deliver->delivery_tag; pipeline(argv, &pl); @@ -205,14 +205,14 @@ int main(int argc, const char **argv) poptContext opts; amqp_connection_state_t conn; const char *const *cmd_argv; - char *queue = NULL; - char *exchange = NULL; - char *routing_key = NULL; - int declare = 0; - int exclusive = 0; - int no_ack = 0; - int count = -1; - int prefetch_count = -1; + static char *queue = NULL; + static char *exchange = NULL; + static char *routing_key = NULL; + static int declare = 0; + static int exclusive = 0; + static int no_ack = 0; + static int count = -1; + static int prefetch_count = -1; amqp_bytes_t queue_bytes; struct poptOption options[] = { diff --git a/tools/declare_queue.c b/tools/declare_queue.c index 57ba0a3..38e25b2 100644 --- a/tools/declare_queue.c +++ b/tools/declare_queue.c @@ -48,8 +48,8 @@ int main(int argc, const char **argv) { amqp_connection_state_t conn; - char *queue = NULL; - int durable = 0; + static char *queue = NULL; + static int durable = 0; struct poptOption options[] = { INCLUDE_OPTIONS(connect_options), diff --git a/tools/delete_queue.c b/tools/delete_queue.c index 4df0992..e038ee4 100644 --- a/tools/delete_queue.c +++ b/tools/delete_queue.c @@ -48,9 +48,9 @@ int main(int argc, const char **argv) { amqp_connection_state_t conn; - char *queue = NULL; - int if_unused = 0; - int if_empty = 0; + static char *queue = NULL; + static int if_unused = 0; + static int if_empty = 0; struct poptOption options[] = { INCLUDE_OPTIONS(connect_options), diff --git a/tools/get.c b/tools/get.c index 357e66a..7f1feed 100644 --- a/tools/get.c +++ b/tools/get.c @@ -59,7 +59,7 @@ static int do_get(amqp_connection_state_t conn, char *queue) int main(int argc, const char **argv) { amqp_connection_state_t conn; - char *queue = NULL; + static char *queue = NULL; int got_something; struct poptOption options[] = { diff --git a/tools/publish.c b/tools/publish.c index 552d8d0..c65bdf6 100644 --- a/tools/publish.c +++ b/tools/publish.c @@ -60,16 +60,16 @@ static void do_publish(amqp_connection_state_t conn, int main(int argc, const char **argv) { amqp_connection_state_t conn; - char *exchange = NULL; - char *routing_key = NULL; - char *content_type = NULL; - char *content_encoding = NULL; - char *reply_to = NULL; - char *body = NULL; + static char *exchange = NULL; + static char *routing_key = NULL; + static char *content_type = NULL; + static char *content_encoding = NULL; + static char *reply_to = NULL; + static char *body = NULL; amqp_basic_properties_t props; amqp_bytes_t body_bytes; - int delivery = 1; /* non-persistent by default */ - int line_buffered = 0; + static int delivery = 1; /* non-persistent by default */ + static int line_buffered = 0; struct poptOption options[] = { INCLUDE_OPTIONS(connect_options), |