You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2016/06/02 15:31:09 UTC

[2/2] qpid-proton git commit: PROTON-1219: fix windows errors and signed/unsigned issues

PROTON-1219: fix windows errors and signed/unsigned issues

(cherry picked from commit 5cd3d4ee51d8ed8d22bbdc5f782eb88d6b181c06)


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/4ca0533c
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/4ca0533c
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/4ca0533c

Branch: refs/heads/0.13.x
Commit: 4ca0533c418f506c3b6fc554edefc8ecff9fdd6d
Parents: 737ffd2
Author: Ken Giusti <kg...@apache.org>
Authored: Wed Jun 1 10:22:35 2016 -0400
Committer: Ken Giusti <kg...@apache.org>
Committed: Thu Jun 2 11:17:44 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/4ca0533c/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/4ca0533c/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: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org