Repository: qpid-proton Updated Branches: refs/heads/master 7615e78e6 -> 5cd3d4ee5
PROTON-1219: fix windows errors and signed/unsigned issues Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/5cd3d4ee Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/5cd3d4ee Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/5cd3d4ee Branch: refs/heads/master Commit: 5cd3d4ee51d8ed8d22bbdc5f782eb88d6b181c06 Parents: 7615e78 Author: Ken Giusti <[email protected]> Authored: Wed Jun 1 10:22:35 2016 -0400 Committer: Ken Giusti <[email protected]> Committed: Wed Jun 1 21:35:14 2016 -0400 ---------------------------------------------------------------------- examples/c/reactor/receiver.c | 18 ++++++++++-------- examples/c/reactor/sender.c | 25 +++++++++++++------------ 2 files changed, 23 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5cd3d4ee/examples/c/reactor/receiver.c ---------------------------------------------------------------------- diff --git a/examples/c/reactor/receiver.c b/examples/c/reactor/receiver.c index 524c78c..35c5a70 100644 --- a/examples/c/reactor/receiver.c +++ b/examples/c/reactor/receiver.c @@ -47,8 +47,8 @@ static const int CAPACITY = 100; // typedef struct { int count; // # of messages to receive before exiting - char *source; // name of the source node to receive from - pn_message_t *message; // holds the received message + const char *source; // name of the source node to receive from + pn_message_t *message; // holds the received message } app_data_t; // helper to pull pointer to app_data_t instance out of the pn_handler_t @@ -104,7 +104,7 @@ static void event_handler(pn_handler_t *handler, // A full message has arrived if (!quiet) { static char buffer[MAX_SIZE]; - size_t len; + ssize_t len; pn_bytes_t bytes; bool found = false; @@ -197,8 +197,8 @@ static void usage(void) int main(int argc, char** argv) { - char *address = "localhost"; - char *container = "ReceiveExample"; + const char *address = "localhost"; + const char *container = "ReceiveExample"; int c; pn_reactor_t *reactor = NULL; pn_url_t *url = NULL; @@ -223,9 +223,11 @@ int main(int argc, char** argv) /* Attach the pn_handshaker() handler. This handler deals with endpoint * events from the peer so we don't have to. */ - pn_handler_t *handshaker = pn_handshaker(); - pn_handler_add(handler, handshaker); - pn_decref(handshaker); + { + pn_handler_t *handshaker = pn_handshaker(); + pn_handler_add(handler, handshaker); + pn_decref(handshaker); + } /* command line options */ opterr = 0; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5cd3d4ee/examples/c/reactor/sender.c ---------------------------------------------------------------------- diff --git a/examples/c/reactor/sender.c b/examples/c/reactor/sender.c index 850b16f..6c3cdb3 100644 --- a/examples/c/reactor/sender.c +++ b/examples/c/reactor/sender.c @@ -43,11 +43,11 @@ static int quiet = 0; // holds configuration and state information. // typedef struct { - int count; // # messages to send - int anon; // use anonymous link if true - char *target; // name of destination target - char *msg_data; // pre-encoded outbound message - int msg_len; // bytes in msg_data + int count; // # messages to send + int anon; // use anonymous link if true + const char *target; // name of destination target + char *msg_data; // pre-encoded outbound message + size_t msg_len; // bytes in msg_data } app_data_t; // helper to pull pointer to app_data_t instance out of the pn_handler_t @@ -201,10 +201,9 @@ static void usage(void) int main(int argc, char** argv) { - char *address = "localhost"; - char *msgtext = "Hello World!"; - char *container = "SendExample"; - int anon = 0; + const char *address = "localhost"; + const char *msgtext = "Hello World!"; + const char *container = "SendExample"; int c; pn_message_t *message = NULL; pn_data_t *body = NULL; @@ -230,9 +229,11 @@ int main(int argc, char** argv) /* Attach the pn_handshaker() handler. This handler deals with endpoint * events from the peer so we don't have to. */ - pn_handler_t *handshaker = pn_handshaker(); - pn_handler_add(handler, handshaker); - pn_decref(handshaker); + { + pn_handler_t *handshaker = pn_handshaker(); + pn_handler_add(handler, handshaker); + pn_decref(handshaker); + } /* command line options */ opterr = 0; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
