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/02 23:30:56 UTC
qpid-proton git commit: PROTON-1604: undo most of 0bed410 if
readability or performance impacted, as per sage advice from astitcher
Repository: qpid-proton
Updated Branches:
refs/heads/master ec5c71a61 -> 95ee34e99
PROTON-1604: undo most of 0bed410 if readability or performance impacted, as per sage advice from astitcher
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/95ee34e9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/95ee34e9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/95ee34e9
Branch: refs/heads/master
Commit: 95ee34e99993873d90c5c9cf774452d2b10ea81f
Parents: ec5c71a
Author: Clifford Jansen <cl...@apache.org>
Authored: Mon Oct 2 16:31:09 2017 -0700
Committer: Clifford Jansen <cl...@apache.org>
Committed: Mon Oct 2 16:31:09 2017 -0700
----------------------------------------------------------------------
examples/cpp/broker.cpp | 25 ++++++++++----------
examples/cpp/multithreaded_client.cpp | 8 +++----
.../cpp/multithreaded_client_flow_control.cpp | 10 ++++----
examples/cpp/reconnect_client.cpp | 10 ++++----
tools/check_abi/expand_types.cpp | 2 +-
5 files changed, 28 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/95ee34e9/examples/cpp/broker.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/broker.cpp b/examples/cpp/broker.cpp
index e98f80f..5cf0c85 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" << std::endl;);
+ DOUT(std::cerr << "Sender: " << this << " sending\n";);
sender_.send(m);
}
void unsubscribed() {
- DOUT(std::cerr << "Sender: " << this << " deleting" << std::endl;);
+ DOUT(std::cerr << "Sender: " << this << " deleting\n";);
delete this;
}
};
@@ -154,7 +154,7 @@ class Queue {
++outOfCredit;
}
}
- DOUT(std::cerr << std::endl;);
+ DOUT(std::cerr << "\n";);
}
public:
@@ -167,21 +167,21 @@ public:
}
void queueMsg(proton::message m) {
- DOUT(std::cerr << "Queue: " << this << "(" << name_ << ") queueMsg" << std::endl;);
+ DOUT(std::cerr << "Queue: " << this << "(" << name_ << ") queueMsg\n";);
messages_.push_back(m);
tryToSend();
}
void flow(Sender* s, int c) {
- DOUT(std::cerr << "Queue: " << this << "(" << name_ << ") flow: " << c << " to " << s << std::endl;);
+ DOUT(std::cerr << "Queue: " << this << "(" << name_ << ") flow: " << c << " to " << s << "\n";);
subscriptions_[s] = c;
tryToSend();
}
void subscribe(Sender* s) {
- DOUT(std::cerr << "Queue: " << this << "(" << name_ << ") subscribe Sender: " << s << std::endl;);
+ DOUT(std::cerr << "Queue: " << this << "(" << name_ << ") subscribe Sender: " << s << "\n";);
subscriptions_[s] = 0;
}
void unsubscribe(Sender* s) {
- DOUT(std::cerr << "Queue: " << this << "(" << name_ << ") unsubscribe Sender: " << s << std::endl;);
+ DOUT(std::cerr << "Queue: " << this << "(" << name_ << ") unsubscribe Sender: " << s << "\n";);
// 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 << ")" << std::endl;);
+ DOUT(std::cerr << "Sender: " << this << " bound to Queue: " << q <<"(" << qn << ")\n";);
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_ << std::endl;);
+ DOUT(std::cerr << "Receiver: " << this << " queueing " << messages_.size() << " msgs to: " << queue_ << "\n";);
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 << ")" << std::endl;);
+ DOUT(std::cerr << "Receiver: " << this << " bound to Queue: " << q << "(" << qn << ")\n";);
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" << std::endl;);
+ DOUT(std::cerr << "ODD - trying to attach to a empty address\n";);
}
Receiver* r = new Receiver(receiver);
proton::schedule_work(&queue_manager_, &QueueManager::findQueueReceiver, &queue_manager_, r, qname);
@@ -395,7 +395,8 @@ class broker {
void run() {
#if PN_CPP_SUPPORTS_THREADS
- std::cout << "starting " << std::thread::hardware_concurrency() << " listening threads" << std::endl;
+ std::cout << "starting " << std::thread::hardware_concurrency() << " listening threads\n";
+ std::cout.flush();
container_.run(std::thread::hardware_concurrency());
#else
container_.run();
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/95ee34e9/examples/cpp/multithreaded_client.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/multithreaded_client.cpp b/examples/cpp/multithreaded_client.cpp
index c9be3b7..c9e6607 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" << 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;
+ "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";
return 1;
}
const char *url = argv[1];
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/95ee34e9/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 9243d35..3f7e2b4 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" << 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;
+ "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";
return 1;
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/95ee34e9/examples/cpp/reconnect_client.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/reconnect_client.cpp b/examples/cpp/reconnect_client.cpp
index 91ac05b..6075f03 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..." << 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;
+ "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";
return 1;
}
const char *url = argv[1];
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/95ee34e9/tools/check_abi/expand_types.cpp
----------------------------------------------------------------------
diff --git a/tools/check_abi/expand_types.cpp b/tools/check_abi/expand_types.cpp
index 782420d..220548b 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" << std::endl;
+ std::cout << "s/" << type << "/" << demangled_type << "/g\n";
}
::free(demangled_type);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org