You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by cl...@apache.org on 2017/10/01 00:48:30 UTC

qpid-proton git commit: PROTON-1604: replace C++ newlines with std::endl in output strings

Repository: qpid-proton
Updated Branches:
  refs/heads/master 51e9881ab -> 0bed4109e


PROTON-1604: replace C++ newlines with std::endl in output strings


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

Branch: refs/heads/master
Commit: 0bed4109e73a0b664a65b09eced98f1ce8d00354
Parents: 51e9881
Author: Clifford Jansen <cl...@apache.org>
Authored: Sat Sep 30 17:48:25 2017 -0700
Committer: Clifford Jansen <cl...@apache.org>
Committed: Sat Sep 30 17:48:25 2017 -0700

----------------------------------------------------------------------
 examples/cpp/broker.cpp                         | 24 ++++++++++----------
 examples/cpp/multithreaded_client.cpp           |  8 +++----
 .../cpp/multithreaded_client_flow_control.cpp   | 10 ++++----
 examples/cpp/reconnect_client.cpp               | 10 ++++----
 .../cpp/src/proactor_container_impl.cpp         |  2 +-
 tools/check_abi/expand_types.cpp                |  2 +-
 6 files changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/0bed4109/examples/cpp/broker.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/broker.cpp b/examples/cpp/broker.cpp
index 60b5a05..e98f80f 100644
--- a/examples/cpp/broker.cpp
+++ b/examples/cpp/broker.cpp
@@ -113,11 +113,11 @@ public:
 
     void boundQueue(Queue* q, std::string qn);
     void sendMsg(proton::message m) {
-        DOUT(std::cerr << "Sender:   " << this << " sending\n";);
+        DOUT(std::cerr << "Sender:   " << this << " sending" << std::endl;);
         sender_.send(m);
     }
     void unsubscribed() {
-        DOUT(std::cerr << "Sender:   " << this << " deleting\n";);
+        DOUT(std::cerr << "Sender:   " << this << " deleting" << std::endl;);
         delete this;
     }
 };
@@ -154,7 +154,7 @@ class Queue {
                 ++outOfCredit;
             }
         }
-        DOUT(std::cerr << "\n";);
+        DOUT(std::cerr << std::endl;);
     }
 
 public:
@@ -167,21 +167,21 @@ public:
     }
 
     void queueMsg(proton::message m) {
-        DOUT(std::cerr << "Queue:    " << this << "(" << name_ << ") queueMsg\n";);
+        DOUT(std::cerr << "Queue:    " << this << "(" << name_ << ") queueMsg" << std::endl;);
         messages_.push_back(m);
         tryToSend();
     }
     void flow(Sender* s, int c) {
-        DOUT(std::cerr << "Queue:    " << this << "(" << name_ << ") flow: " << c << " to " << s << "\n";);
+        DOUT(std::cerr << "Queue:    " << this << "(" << name_ << ") flow: " << c << " to " << s << std::endl;);
         subscriptions_[s] = c;
         tryToSend();
     }
     void subscribe(Sender* s) {
-        DOUT(std::cerr << "Queue:    " << this << "(" << name_ << ") subscribe Sender: " << s << "\n";);
+        DOUT(std::cerr << "Queue:    " << this << "(" << name_ << ") subscribe Sender: " << s << std::endl;);
         subscriptions_[s] = 0;
     }
     void unsubscribe(Sender* s) {
-        DOUT(std::cerr << "Queue:    " << this << "(" << name_ << ") unsubscribe Sender: " << s << "\n";);
+        DOUT(std::cerr << "Queue:    " << this << "(" << name_ << ") unsubscribe Sender: " << s << std::endl;);
         // If we're about to erase the current subscription move on
         if (current_ != subscriptions_.end() && current_->first==s) ++current_;
         subscriptions_.erase(s);
@@ -210,7 +210,7 @@ void Sender::on_sender_close(proton::sender &sender) {
 }
 
 void Sender::boundQueue(Queue* q, std::string qn) {
-    DOUT(std::cerr << "Sender:   " << this << " bound to Queue: " << q <<"(" << qn << ")\n";);
+    DOUT(std::cerr << "Sender:   " << this << " bound to Queue: " << q <<"(" << qn << ")" << std::endl;);
     queue_ = q;
     queue_name_ = qn;
 
@@ -242,7 +242,7 @@ class Receiver : public proton::messaging_handler {
     }
 
     void queueMsgs() {
-        DOUT(std::cerr << "Receiver: " << this << " queueing " << messages_.size() << " msgs to: " << queue_ << "\n";);
+        DOUT(std::cerr << "Receiver: " << this << " queueing " << messages_.size() << " msgs to: " << queue_ << std::endl;);
         while (!messages_.empty()) {
             proton::schedule_work(queue_, &Queue::queueMsg, queue_, messages_.front());
             messages_.pop_front();
@@ -259,7 +259,7 @@ public:
     }
 
     void boundQueue(Queue* q, std::string qn) {
-        DOUT(std::cerr << "Receiver: " << this << " bound to Queue: " << q << "(" << qn << ")\n";);
+        DOUT(std::cerr << "Receiver: " << this << " bound to Queue: " << q << "(" << qn << ")" << std::endl;);
         queue_ = q;
         receiver_.open(proton::receiver_options()
             .source((proton::source_options().address(qn)))
@@ -345,7 +345,7 @@ public:
                 proton::error_condition("shutdown", "stop broker"));
         } else {
             if (qname.empty()) {
-                DOUT(std::cerr << "ODD - trying to attach to a empty address\n";);
+                DOUT(std::cerr << "ODD - trying to attach to a empty address" << std::endl;);
             }
             Receiver* r = new Receiver(receiver);
             proton::schedule_work(&queue_manager_, &QueueManager::findQueueReceiver, &queue_manager_, r, qname);
@@ -395,7 +395,7 @@ class broker {
 
     void run() {
 #if PN_CPP_SUPPORTS_THREADS
-        std::cout << "starting " << std::thread::hardware_concurrency() << " listening threads\n";
+        std::cout << "starting " << std::thread::hardware_concurrency() << " listening threads" << std::endl;
         container_.run(std::thread::hardware_concurrency());
 #else
         container_.run();

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/0bed4109/examples/cpp/multithreaded_client.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/multithreaded_client.cpp b/examples/cpp/multithreaded_client.cpp
index c9e6607..c9be3b7 100644
--- a/examples/cpp/multithreaded_client.cpp
+++ b/examples/cpp/multithreaded_client.cpp
@@ -139,10 +139,10 @@ int main(int argc, const char** argv) {
     try {
         if (argc != 4) {
             std ::cerr <<
-                "Usage: " << argv[0] << " CONNECTION-URL AMQP-ADDRESS MESSAGE-COUNT\n"
-                "CONNECTION-URL: connection address, e.g.'amqp://127.0.0.1'\n"
-                "AMQP-ADDRESS: AMQP node address, e.g. 'examples'\n"
-                "MESSAGE-COUNT: number of messages to send\n";
+                "Usage: " << argv[0] << " CONNECTION-URL AMQP-ADDRESS MESSAGE-COUNT" << std::endl <<
+                "CONNECTION-URL: connection address, e.g.'amqp://127.0.0.1'" << std::endl <<
+                "AMQP-ADDRESS: AMQP node address, e.g. 'examples'" << std::endl <<
+                "MESSAGE-COUNT: number of messages to send" << std::endl;
             return 1;
         }
         const char *url = argv[1];

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/0bed4109/examples/cpp/multithreaded_client_flow_control.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/multithreaded_client_flow_control.cpp b/examples/cpp/multithreaded_client_flow_control.cpp
index 3f7e2b4..9243d35 100644
--- a/examples/cpp/multithreaded_client_flow_control.cpp
+++ b/examples/cpp/multithreaded_client_flow_control.cpp
@@ -246,11 +246,11 @@ int main(int argc, const char **argv) {
     try {
         if (argc != 5) {
             std::cerr <<
-                "Usage: " << argv[0] << " MESSAGE-COUNT THREAD-COUNT URL\n"
-                "CONNECTION-URL: connection address, e.g.'amqp://127.0.0.1'\n"
-                "AMQP-ADDRESS: AMQP node address, e.g. 'examples'\n"
-                "MESSAGE-COUNT: number of messages to send\n"
-                "THREAD-COUNT: number of sender/receiver thread pairs\n";
+                "Usage: " << argv[0] << " MESSAGE-COUNT THREAD-COUNT URL" << std::endl <<
+                "CONNECTION-URL: connection address, e.g.'amqp://127.0.0.1'" << std::endl <<
+                "AMQP-ADDRESS: AMQP node address, e.g. 'examples'" << std::endl <<
+                "MESSAGE-COUNT: number of messages to send" << std::endl <<
+                "THREAD-COUNT: number of sender/receiver thread pairs" << std::endl;
             return 1;
         }
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/0bed4109/examples/cpp/reconnect_client.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/reconnect_client.cpp b/examples/cpp/reconnect_client.cpp
index 6075f03..91ac05b 100644
--- a/examples/cpp/reconnect_client.cpp
+++ b/examples/cpp/reconnect_client.cpp
@@ -120,11 +120,11 @@ int main(int argc, const char** argv) {
     try {
         if (argc < 4) {
             std ::cerr <<
-                "Usage: " << argv[0] << " CONNECTION-URL AMQP-ADDRESS MESSAGE-COUNT FAILOVER-URL...\n"
-                "CONNECTION-URL: connection address, e.g.'amqp://127.0.0.1'\n"
-                "AMQP-ADDRESS: AMQP node address, e.g. 'examples'\n"
-                "MESSAGE-COUNT: number of messages to receive\n"
-                "FAILOVER_URL...: zero or more failover urls\n";
+                "Usage: " << argv[0] << " CONNECTION-URL AMQP-ADDRESS MESSAGE-COUNT FAILOVER-URL..." << std::endl <<
+                "CONNECTION-URL: connection address, e.g.'amqp://127.0.0.1'" << std::endl <<
+                "AMQP-ADDRESS: AMQP node address, e.g. 'examples'" << std::endl <<
+                "MESSAGE-COUNT: number of messages to receive" << std::endl <<
+                "FAILOVER_URL...: zero or more failover urls" << std::endl;
             return 1;
         }
         const char *url = argv[1];

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/0bed4109/proton-c/bindings/cpp/src/proactor_container_impl.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/proactor_container_impl.cpp b/proton-c/bindings/cpp/src/proactor_container_impl.cpp
index e037fd4..cd0fc79 100644
--- a/proton-c/bindings/cpp/src/proactor_container_impl.cpp
+++ b/proton-c/bindings/cpp/src/proactor_container_impl.cpp
@@ -224,7 +224,7 @@ void container::impl::reconnect(pn_connection_t* pnc) {
     const proton::url url(rc.current_url_==-1 ? cc.connected_address_ : roi.failover_urls[rc.current_url_]);
 
     // XXXX Debug:
-    //std::cout << "Retries: " << rc.retries_ << " Delay: " << rc.delay_ << " Trying: " << url << "\n";
+    //std::cout << "Retries: " << rc.retries_ << " Delay: " << rc.delay_ << " Trying: " << url << std::endl;
 
     setup_connection_lh(url, pnc);
     make_wrapper(pnc).open(*cc.connection_options_);

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/0bed4109/tools/check_abi/expand_types.cpp
----------------------------------------------------------------------
diff --git a/tools/check_abi/expand_types.cpp b/tools/check_abi/expand_types.cpp
index 220548b..782420d 100644
--- a/tools/check_abi/expand_types.cpp
+++ b/tools/check_abi/expand_types.cpp
@@ -32,7 +32,7 @@ void print_type(const char* type, const char* mangled_type)
   char* demangled_type =
     abi::__cxa_demangle(mangled_type, 0, 0, &status);
   if (demangled_type) {
-    std::cout << "s/" << type << "/" << demangled_type << "/g\n";
+    std::cout << "s/" << type << "/" << demangled_type << "/g" << std::endl;
   } 
   ::free(demangled_type);
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org