diff options
author | Alan Conway <aconway@apache.org> | 2006-10-11 15:50:15 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2006-10-11 15:50:15 +0000 |
commit | 2bcadbb42a6fb2f096c1fc0a4b957d64a5024ef6 (patch) | |
tree | 886eb0659c6f28c2f1d26de7d5fd29fff0072dc5 /cpp/broker | |
parent | 9fc2b6c5f0848d65f1bf20e62279c055d12a1d40 (diff) | |
download | qpid-python-2bcadbb42a6fb2f096c1fc0a4b957d64a5024ef6.tar.gz |
Turned up gcc warnings, fixed warnings in code, enabled -Werror.
Note: #include "qpid_test_plugin.h" instead of <cppunit/TestPlugin.h>
Works around warning from a cppunit macro.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@462834 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/broker')
-rw-r--r-- | cpp/broker/inc/Channel.h | 4 | ||||
-rw-r--r-- | cpp/broker/inc/Exchange.h | 2 | ||||
-rw-r--r-- | cpp/broker/inc/TopicExchange.h | 2 | ||||
-rw-r--r-- | cpp/broker/src/Broker.cpp | 2 | ||||
-rw-r--r-- | cpp/broker/src/Channel.cpp | 29 | ||||
-rw-r--r-- | cpp/broker/src/Configuration.cpp | 3 | ||||
-rw-r--r-- | cpp/broker/src/DirectExchange.cpp | 6 | ||||
-rw-r--r-- | cpp/broker/src/FanOutExchange.cpp | 6 | ||||
-rw-r--r-- | cpp/broker/src/HeadersExchange.cpp | 41 | ||||
-rw-r--r-- | cpp/broker/src/Message.cpp | 4 | ||||
-rw-r--r-- | cpp/broker/src/Queue.cpp | 21 | ||||
-rw-r--r-- | cpp/broker/src/SessionHandlerImpl.cpp | 93 | ||||
-rw-r--r-- | cpp/broker/src/TopicExchange.cpp | 7 | ||||
-rw-r--r-- | cpp/broker/test/ChannelTest.cpp | 5 | ||||
-rw-r--r-- | cpp/broker/test/HeadersExchangeTest.cpp | 5 | ||||
-rw-r--r-- | cpp/broker/test/QueueRegistryTest.cpp | 5 | ||||
-rw-r--r-- | cpp/broker/test/QueueTest.cpp | 5 | ||||
-rw-r--r-- | cpp/broker/test/RouterTest.cpp | 19 | ||||
-rw-r--r-- | cpp/broker/test/TopicExchangeTest.cpp | 6 | ||||
-rw-r--r-- | cpp/broker/test/ValueTest.cpp | 5 | ||||
-rw-r--r-- | cpp/broker/test/exchange_test.cpp | 5 | ||||
-rw-r--r-- | cpp/broker/test/message_test.cpp | 5 |
22 files changed, 129 insertions, 151 deletions
diff --git a/cpp/broker/inc/Channel.h b/cpp/broker/inc/Channel.h index a5a54aea1f..862d249ce1 100644 --- a/cpp/broker/inc/Channel.h +++ b/cpp/broker/inc/Channel.h @@ -146,8 +146,8 @@ namespace qpid { ~Channel(); inline void setDefaultQueue(Queue::shared_ptr queue){ defaultQueue = queue; } inline Queue::shared_ptr getDefaultQueue(){ return defaultQueue; } - inline u_int32_t setPrefetchSize(u_int32_t size){ prefetchSize = size; } - inline u_int16_t setPrefetchCount(u_int16_t count){ prefetchCount = count; } + inline u_int32_t setPrefetchSize(u_int32_t size){ return prefetchSize = size; } + inline u_int16_t setPrefetchCount(u_int16_t count){ return prefetchCount = count; } bool exists(const string& consumerTag); void consume(string& tag, Queue::shared_ptr queue, bool acks, bool exclusive, ConnectionToken* const connection = 0); void cancel(const string& tag); diff --git a/cpp/broker/inc/Exchange.h b/cpp/broker/inc/Exchange.h index 4066f5ac20..1fdc00fae5 100644 --- a/cpp/broker/inc/Exchange.h +++ b/cpp/broker/inc/Exchange.h @@ -27,7 +27,7 @@ namespace broker { class Exchange{ const std::string name; public: - explicit Exchange(const std::string& name) : name(name) {} + explicit Exchange(const std::string& _name) : name(_name) {} virtual ~Exchange(){} std::string getName() { return name; } virtual void bind(Queue::shared_ptr queue, const string& routingKey, qpid::framing::FieldTable* args) = 0; diff --git a/cpp/broker/inc/TopicExchange.h b/cpp/broker/inc/TopicExchange.h index 68a4026ee7..227280103f 100644 --- a/cpp/broker/inc/TopicExchange.h +++ b/cpp/broker/inc/TopicExchange.h @@ -57,7 +57,7 @@ class TopicPattern : public Tokens TopicPattern(const Tokens& tokens) { operator=(tokens); } TopicPattern(const std::string& str) { operator=(str); } TopicPattern& operator=(const Tokens&); - TopicPattern& operator=(const std::string& str) { operator=(Tokens(str)); } + TopicPattern& operator=(const std::string& str) { return operator=(Tokens(str)); } /** Match a topic */ bool match(const std::string& topic) { return match(Tokens(topic)); } diff --git a/cpp/broker/src/Broker.cpp b/cpp/broker/src/Broker.cpp index 5d59b63622..99cf8d6ce4 100644 --- a/cpp/broker/src/Broker.cpp +++ b/cpp/broker/src/Broker.cpp @@ -87,6 +87,6 @@ Acceptor* createAcceptor(Configuration& config){ throw Configuration::ParseException("Unrecognised acceptor: " + type); } -void handle_signal(int signal){ +void handle_signal(int /*signal*/){ std::cout << "Shutting down..." << std::endl; } diff --git a/cpp/broker/src/Channel.cpp b/cpp/broker/src/Channel.cpp index ed1125ee76..7bc6d599e9 100644 --- a/cpp/broker/src/Channel.cpp +++ b/cpp/broker/src/Channel.cpp @@ -26,16 +26,17 @@ using namespace qpid::framing; using namespace qpid::concurrent; -Channel::Channel(OutputHandler* _out, int _id, u_int32_t _framesize) : out(_out), - id(_id), - prefetchCount(0), - prefetchSize(0), - outstandingSize(0), - outstandingCount(0), - framesize(_framesize), - transactional(false), - deliveryTag(1), - tagGenerator("sgen"){} +Channel::Channel(OutputHandler* _out, int _id, u_int32_t _framesize) : + id(_id), + out(_out), + deliveryTag(1), + transactional(false), + prefetchSize(0), + prefetchCount(0), + outstandingSize(0), + outstandingCount(0), + framesize(_framesize), + tagGenerator("sgen"){} Channel::~Channel(){ } @@ -156,10 +157,10 @@ void Channel::handlePublish(Message* msg){ message = Message::shared_ptr(msg); } -void Channel::ack(u_int64_t deliveryTag, bool multiple){ +void Channel::ack(u_int64_t _deliveryTag, bool multiple){ Locker locker(deliveryLock);//need to synchronize with possible concurrent delivery - ack_iterator i = find_if(unacknowledged.begin(), unacknowledged.end(), MatchAck(deliveryTag)); + ack_iterator i = find_if(unacknowledged.begin(), unacknowledged.end(), MatchAck(_deliveryTag)); if(i == unacknowledged.end()){ throw InvalidAckException(); }else if(multiple){ @@ -178,8 +179,8 @@ void Channel::ack(u_int64_t deliveryTag, bool multiple){ //if the prefetch limit had previously been reached, there may //be messages that can be now be delivered - for(consumer_iterator i = consumers.begin(); i != consumers.end(); i++){ - i->second->requestDispatch(); + for(consumer_iterator j = consumers.begin(); j != consumers.end(); j++){ + j->second->requestDispatch(); } } diff --git a/cpp/broker/src/Configuration.cpp b/cpp/broker/src/Configuration.cpp index aceb35bc87..11c2d374fe 100644 --- a/cpp/broker/src/Configuration.cpp +++ b/cpp/broker/src/Configuration.cpp @@ -16,6 +16,7 @@ * */ #include "Configuration.h" +#include <string.h> using namespace qpid::broker; using namespace std; @@ -191,5 +192,5 @@ bool Configuration::BoolOption::needsValue() const { } void Configuration::BoolOption::setValue(const std::string& _value){ - value = true; + value = strcasecmp(_value.c_str(), "true") == 0; } diff --git a/cpp/broker/src/DirectExchange.cpp b/cpp/broker/src/DirectExchange.cpp index ca29225bee..94cfbc766d 100644 --- a/cpp/broker/src/DirectExchange.cpp +++ b/cpp/broker/src/DirectExchange.cpp @@ -22,7 +22,7 @@ using namespace qpid::broker; using namespace qpid::framing; -DirectExchange::DirectExchange(const string& name) : Exchange(name) { +DirectExchange::DirectExchange(const string& _name) : Exchange(_name) { } @@ -37,7 +37,7 @@ void DirectExchange::bind(Queue::shared_ptr queue, const string& routingKey, Fie lock.release(); } -void DirectExchange::unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ +void DirectExchange::unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* /*args*/){ lock.acquire(); std::vector<Queue::shared_ptr>& queues(bindings[routingKey]); @@ -51,7 +51,7 @@ void DirectExchange::unbind(Queue::shared_ptr queue, const string& routingKey, F lock.release(); } -void DirectExchange::route(Message::shared_ptr& msg, const string& routingKey, FieldTable* args){ +void DirectExchange::route(Message::shared_ptr& msg, const string& routingKey, FieldTable* /*args*/){ lock.acquire(); std::vector<Queue::shared_ptr>& queues(bindings[routingKey]); int count(0); diff --git a/cpp/broker/src/FanOutExchange.cpp b/cpp/broker/src/FanOutExchange.cpp index 4eb75cb920..e8cb8f6315 100644 --- a/cpp/broker/src/FanOutExchange.cpp +++ b/cpp/broker/src/FanOutExchange.cpp @@ -23,7 +23,7 @@ using namespace qpid::broker; using namespace qpid::framing; using namespace qpid::concurrent; -FanOutExchange::FanOutExchange(const std::string& name) : Exchange(name) {} +FanOutExchange::FanOutExchange(const std::string& _name) : Exchange(_name) {} void FanOutExchange::bind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ Locker locker(lock); @@ -35,7 +35,7 @@ void FanOutExchange::bind(Queue::shared_ptr queue, const string& routingKey, Fie } } -void FanOutExchange::unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ +void FanOutExchange::unbind(Queue::shared_ptr queue, const string& /*routingKey*/, FieldTable* /*args*/){ Locker locker(lock); Queue::vector::iterator i = std::find(bindings.begin(), bindings.end(), queue); if (i != bindings.end()) { @@ -44,7 +44,7 @@ void FanOutExchange::unbind(Queue::shared_ptr queue, const string& routingKey, F } } -void FanOutExchange::route(Message::shared_ptr& msg, const string& routingKey, FieldTable* args){ +void FanOutExchange::route(Message::shared_ptr& msg, const string& /*routingKey*/, FieldTable* /*args*/){ Locker locker(lock); for(Queue::vector::iterator i = bindings.begin(); i != bindings.end(); ++i){ (*i)->deliver(msg); diff --git a/cpp/broker/src/HeadersExchange.cpp b/cpp/broker/src/HeadersExchange.cpp index 03a029ea4d..65204cdb85 100644 --- a/cpp/broker/src/HeadersExchange.cpp +++ b/cpp/broker/src/HeadersExchange.cpp @@ -18,8 +18,10 @@ #include "HeadersExchange.h" #include "ExchangeBinding.h" #include "Value.h" +#include "QpidError.h" #include <algorithm> + using namespace qpid::broker; using namespace qpid::framing; using namespace qpid::concurrent; @@ -28,38 +30,36 @@ using namespace qpid::concurrent; // The current search algorithm really sucks. // Fieldtables are heavy, maybe use shared_ptr to do handle-body. -namespace qpid { -namespace broker { +using namespace qpid::broker; namespace { -const std::string all("all"); -const std::string any("any"); -const std::string x_match("x-match"); + const std::string all("all"); + const std::string any("any"); + const std::string x_match("x-match"); } -HeadersExchange::HeadersExchange(const string& name) : Exchange(name) { } +HeadersExchange::HeadersExchange(const string& _name) : Exchange(_name) { } void HeadersExchange::bind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ std::cout << "HeadersExchange::bind" << std::endl; Locker locker(lock); std::string what = args->getString("x-match"); - // TODO aconway 2006-09-26: throw an exception for invalid bindings. - if (what != all && what != any) return; // Invalid. + if (what != all && what != any) { + THROW_QPID_ERROR(PROTOCOL_ERROR, "Invalid x-match value binding to headers exchange."); + } bindings.push_back(Binding(*args, queue)); queue->bound(new ExchangeBinding(this, queue, routingKey, args)); } -void HeadersExchange::unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ - Locker locker(lock);; - for (Bindings::iterator i = bindings.begin(); i != bindings.end(); ++i) { - if (i->first == *args) { - bindings.erase(i); - } - } +void HeadersExchange::unbind(Queue::shared_ptr queue, const string& /*routingKey*/, FieldTable* args){ + Locker locker(lock); + Bindings::iterator i = + std::find(bindings.begin(),bindings.end(), Binding(*args, queue)); + if (i != bindings.end()) bindings.erase(i); } -void HeadersExchange::route(Message::shared_ptr& msg, const string& routingKey, FieldTable* args){ +void HeadersExchange::route(Message::shared_ptr& msg, const string& /*routingKey*/, FieldTable* args){ std::cout << "route: " << *args << std::endl; Locker locker(lock);; for (Bindings::iterator i = bindings.begin(); i != bindings.end(); ++i) { @@ -70,12 +70,13 @@ void HeadersExchange::route(Message::shared_ptr& msg, const string& routingKey, HeadersExchange::~HeadersExchange() {} const std::string HeadersExchange::typeName("headers"); + namespace { -bool match_values(const Value& bind, const Value& msg) { - return dynamic_cast<const EmptyValue*>(&bind) || bind == msg; -} + bool match_values(const Value& bind, const Value& msg) { + return dynamic_cast<const EmptyValue*>(&bind) || bind == msg; + } } @@ -115,5 +116,5 @@ bool HeadersExchange::match(const FieldTable& bind, const FieldTable& msg) { } } -}} + diff --git a/cpp/broker/src/Message.cpp b/cpp/broker/src/Message.cpp index b0e5d16b77..0a8a5f7a4d 100644 --- a/cpp/broker/src/Message.cpp +++ b/cpp/broker/src/Message.cpp @@ -41,8 +41,8 @@ Message::Message(const ConnectionToken* const _publisher, Message::~Message(){ } -void Message::setHeader(AMQHeaderBody::shared_ptr header){ - this->header = header; +void Message::setHeader(AMQHeaderBody::shared_ptr _header){ + this->header = _header; } void Message::addContent(AMQContentBody::shared_ptr data){ diff --git a/cpp/broker/src/Queue.cpp b/cpp/broker/src/Queue.cpp index 1db4454235..eaaa3ffa31 100644 --- a/cpp/broker/src/Queue.cpp +++ b/cpp/broker/src/Queue.cpp @@ -22,16 +22,17 @@ using namespace qpid::broker; using namespace qpid::concurrent; -Queue::Queue(const string& _name, bool _durable, u_int32_t _autodelete, const ConnectionToken* const _owner) : name(_name), - durable(_durable), - autodelete(_autodelete), - owner(_owner), - queueing(false), - dispatching(false), - next(0), - lastUsed(0), - exclusive(0){ - +Queue::Queue(const string& _name, bool _durable, u_int32_t _autodelete, const ConnectionToken* const _owner) : + name(_name), + autodelete(_autodelete), + durable(_durable), + owner(_owner), + queueing(false), + dispatching(false), + next(0), + lastUsed(0), + exclusive(0) +{ if(autodelete) lastUsed = apr_time_as_msec(apr_time_now()); } diff --git a/cpp/broker/src/SessionHandlerImpl.cpp b/cpp/broker/src/SessionHandlerImpl.cpp index ad73c1b23b..0d8539332c 100644 --- a/cpp/broker/src/SessionHandlerImpl.cpp +++ b/cpp/broker/src/SessionHandlerImpl.cpp @@ -33,21 +33,20 @@ SessionHandlerImpl::SessionHandlerImpl(SessionContext* _context, QueueRegistry* _queues, ExchangeRegistry* _exchanges, AutoDelete* _cleaner, - const u_int32_t _timeout) : context(_context), - queues(_queues), - exchanges(_exchanges), - cleaner(_cleaner), - timeout(_timeout), - channelHandler(new ChannelHandlerImpl(this)), - connectionHandler(new ConnectionHandlerImpl(this)), - basicHandler(new BasicHandlerImpl(this)), - exchangeHandler(new ExchangeHandlerImpl(this)), - queueHandler(new QueueHandlerImpl(this)), - client(context), - framemax(65536), - heartbeat(0){ - -} + const u_int32_t _timeout) : + context(_context), + client(context), + queues(_queues), + exchanges(_exchanges), + cleaner(_cleaner), + timeout(_timeout), + connectionHandler(new ConnectionHandlerImpl(this)), + channelHandler(new ChannelHandlerImpl(this)), + basicHandler(new BasicHandlerImpl(this)), + exchangeHandler(new ExchangeHandlerImpl(this)), + queueHandler(new QueueHandlerImpl(this)), + framemax(65536), + heartbeat(0) {} SessionHandlerImpl::~SessionHandlerImpl(){ // TODO aconway 2006-09-07: Should be auto_ptr or plain members. @@ -123,7 +122,7 @@ void SessionHandlerImpl::received(qpid::framing::AMQFrame* frame){ } } -void SessionHandlerImpl::initiated(qpid::framing::ProtocolInitiation* header){ +void SessionHandlerImpl::initiated(qpid::framing::ProtocolInitiation* /*header*/){ //send connection start FieldTable properties; string mechanisms("PLAIN"); @@ -161,51 +160,53 @@ void SessionHandlerImpl::handleContent(u_int16_t channel, AMQContentBody::shared getChannel(channel)->handleContent(body, Router(*exchanges)); } -void SessionHandlerImpl::handleHeartbeat(AMQHeartbeatBody::shared_ptr body){ +void SessionHandlerImpl::handleHeartbeat(AMQHeartbeatBody::shared_ptr /*body*/){ std::cout << "SessionHandlerImpl::handleHeartbeat()" << std::endl; } -void SessionHandlerImpl::ConnectionHandlerImpl::startOk(u_int16_t channel, FieldTable& clientProperties, string& mechanism, - string& response, string& locale){ +void SessionHandlerImpl::ConnectionHandlerImpl::startOk( + u_int16_t /*channel*/, FieldTable& /*clientProperties*/, string& /*mechanism*/, + string& /*response*/, string& /*locale*/){ parent->client.getConnection().tune(0, 100, parent->framemax, parent->heartbeat); } -void SessionHandlerImpl::ConnectionHandlerImpl::secureOk(u_int16_t channel, string& response){} +void SessionHandlerImpl::ConnectionHandlerImpl::secureOk(u_int16_t /*channel*/, string& /*response*/){} -void SessionHandlerImpl::ConnectionHandlerImpl::tuneOk(u_int16_t channel, u_int16_t channelmax, u_int32_t framemax, u_int16_t heartbeat){ +void SessionHandlerImpl::ConnectionHandlerImpl::tuneOk(u_int16_t /*channel*/, u_int16_t /*channelmax*/, u_int32_t framemax, u_int16_t heartbeat){ parent->framemax = framemax; parent->heartbeat = heartbeat; } -void SessionHandlerImpl::ConnectionHandlerImpl::open(u_int16_t channel, string& virtualHost, string& capabilities, bool insist){ +void SessionHandlerImpl::ConnectionHandlerImpl::open(u_int16_t /*channel*/, string& /*virtualHost*/, string& /*capabilities*/, bool /*insist*/){ string knownhosts; parent->client.getConnection().openOk(0, knownhosts); } -void SessionHandlerImpl::ConnectionHandlerImpl::close(u_int16_t channel, u_int16_t replyCode, string& replyText, - u_int16_t classId, u_int16_t methodId){ - +void SessionHandlerImpl::ConnectionHandlerImpl::close( + u_int16_t /*channel*/, u_int16_t /*replyCode*/, string& /*replyText*/, + u_int16_t /*classId*/, u_int16_t /*methodId*/) +{ parent->client.getConnection().closeOk(0); parent->context->close(); } -void SessionHandlerImpl::ConnectionHandlerImpl::closeOk(u_int16_t channel){ +void SessionHandlerImpl::ConnectionHandlerImpl::closeOk(u_int16_t /*channel*/){ parent->context->close(); } -void SessionHandlerImpl::ChannelHandlerImpl::open(u_int16_t channel, string& outOfBand){ +void SessionHandlerImpl::ChannelHandlerImpl::open(u_int16_t channel, string& /*outOfBand*/){ parent->channels[channel] = new Channel(parent->context, channel, parent->framemax); parent->client.getChannel().openOk(channel); } -void SessionHandlerImpl::ChannelHandlerImpl::flow(u_int16_t channel, bool active){} -void SessionHandlerImpl::ChannelHandlerImpl::flowOk(u_int16_t channel, bool active){} +void SessionHandlerImpl::ChannelHandlerImpl::flow(u_int16_t /*channel*/, bool /*active*/){} +void SessionHandlerImpl::ChannelHandlerImpl::flowOk(u_int16_t /*channel*/, bool /*active*/){} -void SessionHandlerImpl::ChannelHandlerImpl::close(u_int16_t channel, u_int16_t replyCode, string& replyText, - u_int16_t classId, u_int16_t methodId){ +void SessionHandlerImpl::ChannelHandlerImpl::close(u_int16_t channel, u_int16_t /*replyCode*/, string& /*replyText*/, + u_int16_t /*classId*/, u_int16_t /*methodId*/){ Channel* c = parent->getChannel(channel); if(c){ parent->channels.erase(channel); @@ -215,13 +216,13 @@ void SessionHandlerImpl::ChannelHandlerImpl::close(u_int16_t channel, u_int16_t } } -void SessionHandlerImpl::ChannelHandlerImpl::closeOk(u_int16_t channel){} +void SessionHandlerImpl::ChannelHandlerImpl::closeOk(u_int16_t /*channel*/){} -void SessionHandlerImpl::ExchangeHandlerImpl::declare(u_int16_t channel, u_int16_t ticket, string& exchange, string& type, - bool passive, bool durable, bool autoDelete, bool internal, bool nowait, - FieldTable& arguments){ +void SessionHandlerImpl::ExchangeHandlerImpl::declare(u_int16_t channel, u_int16_t /*ticket*/, string& exchange, string& type, + bool passive, bool /*durable*/, bool /*autoDelete*/, bool /*internal*/, bool nowait, + FieldTable& /*arguments*/){ if(!passive && ( type != TopicExchange::typeName && @@ -252,7 +253,7 @@ void SessionHandlerImpl::ExchangeHandlerImpl::declare(u_int16_t channel, u_int16 } } -void SessionHandlerImpl::ExchangeHandlerImpl::delete_(u_int16_t channel, u_int16_t ticket, string& exchange, bool ifUnused, bool nowait){ +void SessionHandlerImpl::ExchangeHandlerImpl::delete_(u_int16_t channel, u_int16_t /*ticket*/, string& exchange, bool /*ifUnused*/, bool nowait){ //TODO: implement unused parent->exchanges->getLock()->acquire(); parent->exchanges->destroy(exchange); @@ -260,9 +261,9 @@ void SessionHandlerImpl::ExchangeHandlerImpl::delete_(u_int16_t channel, u_int16 if(!nowait) parent->client.getExchange().deleteOk(channel); } -void SessionHandlerImpl::QueueHandlerImpl::declare(u_int16_t channel, u_int16_t ticket, string& name, +void SessionHandlerImpl::QueueHandlerImpl::declare(u_int16_t channel, u_int16_t /*ticket*/, string& name, bool passive, bool durable, bool exclusive, - bool autoDelete, bool nowait, FieldTable& arguments){ + bool autoDelete, bool nowait, FieldTable& /*arguments*/){ Queue::shared_ptr queue; if (passive && !name.empty()) { queue = parent->getQueue(name, channel); @@ -290,7 +291,7 @@ void SessionHandlerImpl::QueueHandlerImpl::declare(u_int16_t channel, u_int16_t } } -void SessionHandlerImpl::QueueHandlerImpl::bind(u_int16_t channel, u_int16_t ticket, string& queueName, +void SessionHandlerImpl::QueueHandlerImpl::bind(u_int16_t channel, u_int16_t /*ticket*/, string& queueName, string& exchangeName, string& routingKey, bool nowait, FieldTable& arguments){ @@ -305,14 +306,14 @@ void SessionHandlerImpl::QueueHandlerImpl::bind(u_int16_t channel, u_int16_t tic } } -void SessionHandlerImpl::QueueHandlerImpl::purge(u_int16_t channel, u_int16_t ticket, string& queueName, bool nowait){ +void SessionHandlerImpl::QueueHandlerImpl::purge(u_int16_t channel, u_int16_t /*ticket*/, string& queueName, bool nowait){ Queue::shared_ptr queue = parent->getQueue(queueName, channel); int count = queue->purge(); if(!nowait) parent->client.getQueue().purgeOk(channel, count); } -void SessionHandlerImpl::QueueHandlerImpl::delete_(u_int16_t channel, u_int16_t ticket, string& queue, +void SessionHandlerImpl::QueueHandlerImpl::delete_(u_int16_t channel, u_int16_t /*ticket*/, string& queue, bool ifUnused, bool ifEmpty, bool nowait){ ChannelException error(0, ""); int count(0); @@ -336,14 +337,14 @@ void SessionHandlerImpl::QueueHandlerImpl::delete_(u_int16_t channel, u_int16_t -void SessionHandlerImpl::BasicHandlerImpl::qos(u_int16_t channel, u_int32_t prefetchSize, u_int16_t prefetchCount, bool global){ +void SessionHandlerImpl::BasicHandlerImpl::qos(u_int16_t channel, u_int32_t prefetchSize, u_int16_t prefetchCount, bool /*global*/){ //TODO: handle global parent->getChannel(channel)->setPrefetchSize(prefetchSize); parent->getChannel(channel)->setPrefetchCount(prefetchCount); parent->client.getBasic().qosOk(channel); } -void SessionHandlerImpl::BasicHandlerImpl::consume(u_int16_t channelId, u_int16_t ticket, +void SessionHandlerImpl::BasicHandlerImpl::consume(u_int16_t channelId, u_int16_t /*ticket*/, string& queueName, string& consumerTag, bool noLocal, bool noAck, bool exclusive, bool nowait){ @@ -372,7 +373,7 @@ void SessionHandlerImpl::BasicHandlerImpl::cancel(u_int16_t channel, string& con if(!nowait) parent->client.getBasic().cancelOk(channel, consumerTag); } -void SessionHandlerImpl::BasicHandlerImpl::publish(u_int16_t channel, u_int16_t ticket, +void SessionHandlerImpl::BasicHandlerImpl::publish(u_int16_t channel, u_int16_t /*ticket*/, string& exchange, string& routingKey, bool mandatory, bool immediate){ @@ -380,7 +381,7 @@ void SessionHandlerImpl::BasicHandlerImpl::publish(u_int16_t channel, u_int16_t parent->getChannel(channel)->handlePublish(msg); } -void SessionHandlerImpl::BasicHandlerImpl::get(u_int16_t channelId, u_int16_t ticket, string& queueName, bool noAck){ +void SessionHandlerImpl::BasicHandlerImpl::get(u_int16_t channelId, u_int16_t /*ticket*/, string& queueName, bool noAck){ Queue::shared_ptr queue = parent->getQueue(queueName, channelId); if(!parent->getChannel(channelId)->get(queue, !noAck)){ string clusterId;//not used, part of an imatix hack @@ -396,7 +397,7 @@ void SessionHandlerImpl::BasicHandlerImpl::ack(u_int16_t channel, u_int64_t deli } } -void SessionHandlerImpl::BasicHandlerImpl::reject(u_int16_t channel, u_int64_t deliveryTag, bool requeue){} +void SessionHandlerImpl::BasicHandlerImpl::reject(u_int16_t /*channel*/, u_int64_t /*deliveryTag*/, bool /*requeue*/){} void SessionHandlerImpl::BasicHandlerImpl::recover(u_int16_t channel, bool requeue){ parent->getChannel(channel)->recover(requeue); diff --git a/cpp/broker/src/TopicExchange.cpp b/cpp/broker/src/TopicExchange.cpp index 287502bc88..53977747c4 100644 --- a/cpp/broker/src/TopicExchange.cpp +++ b/cpp/broker/src/TopicExchange.cpp @@ -47,6 +47,7 @@ size_t Tokens::Hash::operator()(const Tokens& p) const { for (Tokens::const_iterator i = p.begin(); i != p.end(); ++i) { hash += std::tr1::hash<std::string>()(*i); } + return hash; } TopicPattern& TopicPattern::operator=(const Tokens& tokens) { @@ -119,7 +120,7 @@ bool TopicPattern::match(const Tokens& target) const return do_match(begin(), end(), target.begin(), target.end()); } -TopicExchange::TopicExchange(const string& name) : Exchange(name) { } +TopicExchange::TopicExchange(const string& _name) : Exchange(_name) { } void TopicExchange::bind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ lock.acquire(); @@ -129,7 +130,7 @@ void TopicExchange::bind(Queue::shared_ptr queue, const string& routingKey, Fiel lock.release(); } -void TopicExchange::unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ +void TopicExchange::unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* /*args*/){ lock.acquire(); BindingMap::iterator bi = bindings.find(TopicPattern(routingKey)); Queue::vector& qv(bi->second); @@ -142,7 +143,7 @@ void TopicExchange::unbind(Queue::shared_ptr queue, const string& routingKey, Fi } -void TopicExchange::route(Message::shared_ptr& msg, const string& routingKey, FieldTable* args){ +void TopicExchange::route(Message::shared_ptr& msg, const string& routingKey, FieldTable* /*args*/){ lock.acquire(); for (BindingMap::iterator i = bindings.begin(); i != bindings.end(); ++i) { if (i->first.match(routingKey)) { diff --git a/cpp/broker/test/ChannelTest.cpp b/cpp/broker/test/ChannelTest.cpp index c96d17379e..45498989f2 100644 --- a/cpp/broker/test/ChannelTest.cpp +++ b/cpp/broker/test/ChannelTest.cpp @@ -17,10 +17,7 @@ */ #include "Channel.h" #include "Message.h" -#include <cppunit/TestCase.h> -#include <cppunit/TextTestRunner.h> -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/plugin/TestPlugIn.h> +#include <qpid_test_plugin.h> #include <iostream> #include <memory> diff --git a/cpp/broker/test/HeadersExchangeTest.cpp b/cpp/broker/test/HeadersExchangeTest.cpp index 82d3a292a8..d56e00543d 100644 --- a/cpp/broker/test/HeadersExchangeTest.cpp +++ b/cpp/broker/test/HeadersExchangeTest.cpp @@ -19,10 +19,7 @@ #include "HeadersExchange.h" #include "FieldTable.h" #include "Value.h" -#include <cppunit/TestCase.h> -#include <cppunit/TextTestRunner.h> -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/plugin/TestPlugIn.h> +#include <qpid_test_plugin.h> using namespace qpid::broker; using namespace qpid::framing; diff --git a/cpp/broker/test/QueueRegistryTest.cpp b/cpp/broker/test/QueueRegistryTest.cpp index c4ad40b5cd..bd739aaad5 100644 --- a/cpp/broker/test/QueueRegistryTest.cpp +++ b/cpp/broker/test/QueueRegistryTest.cpp @@ -1,8 +1,5 @@ #include "QueueRegistry.h" -#include <cppunit/TestCase.h> -#include <cppunit/TextTestRunner.h> -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/plugin/TestPlugIn.h> +#include <qpid_test_plugin.h> #include <string> using namespace qpid::broker; diff --git a/cpp/broker/test/QueueTest.cpp b/cpp/broker/test/QueueTest.cpp index 973b1b5cf6..1b4eb814cb 100644 --- a/cpp/broker/test/QueueTest.cpp +++ b/cpp/broker/test/QueueTest.cpp @@ -17,10 +17,7 @@ */ #include "Queue.h" #include "QueueRegistry.h" -#include <cppunit/TestCase.h> -#include <cppunit/TextTestRunner.h> -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/plugin/TestPlugIn.h> +#include <qpid_test_plugin.h> #include <iostream> using namespace qpid::broker; diff --git a/cpp/broker/test/RouterTest.cpp b/cpp/broker/test/RouterTest.cpp index 284a28f583..b1d4b9739f 100644 --- a/cpp/broker/test/RouterTest.cpp +++ b/cpp/broker/test/RouterTest.cpp @@ -20,10 +20,7 @@ #include "ExchangeRegistry.h" #include "Message.h" #include "Router.h" -#include <cppunit/TestCase.h> -#include <cppunit/TextTestRunner.h> -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/plugin/TestPlugIn.h> +#include <qpid_test_plugin.h> #include <iostream> #include <memory> @@ -38,16 +35,14 @@ struct TestExchange : public Exchange{ TestExchange() : Exchange("test"), args(0) {} - void bind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ - } + void bind(Queue::shared_ptr /*queue*/, const string& /*routingKey*/, FieldTable* /*args*/){} - void unbind(Queue::shared_ptr queue, const string& routingKey, FieldTable* args){ - } + void unbind(Queue::shared_ptr /*queue*/, const string& /*routingKey*/, FieldTable* /*args*/){ } - void route(Message::shared_ptr& msg, const string& routingKey, FieldTable* args){ - this->msg = msg; - this->routingKey = routingKey; - this->args = args; + void route(Message::shared_ptr& _msg, const string& _routingKey, FieldTable* _args){ + msg = _msg; + routingKey = _routingKey; + args = _args; } }; diff --git a/cpp/broker/test/TopicExchangeTest.cpp b/cpp/broker/test/TopicExchangeTest.cpp index 4653540040..d9b49fc603 100644 --- a/cpp/broker/test/TopicExchangeTest.cpp +++ b/cpp/broker/test/TopicExchangeTest.cpp @@ -1,8 +1,5 @@ #include "TopicExchange.h" -#include <cppunit/TestCase.h> -#include <cppunit/TextTestRunner.h> -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/plugin/TestPlugIn.h> +#include <qpid_test_plugin.h> using namespace qpid::broker; @@ -30,6 +27,7 @@ CppUnit::OStringStream& operator <<(CppUnit::OStringStream& out, const Tokens& v { out << '"' << *i << '"' << (i+1 == v.end() ? "]" : ", "); } + return out; } diff --git a/cpp/broker/test/ValueTest.cpp b/cpp/broker/test/ValueTest.cpp index 181f0ced84..ec9659e603 100644 --- a/cpp/broker/test/ValueTest.cpp +++ b/cpp/broker/test/ValueTest.cpp @@ -1,8 +1,5 @@ #include "Value.h" -#include <cppunit/TestCase.h> -#include <cppunit/TextTestRunner.h> -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/plugin/TestPlugIn.h> +#include <qpid_test_plugin.h> using namespace qpid::framing; diff --git a/cpp/broker/test/exchange_test.cpp b/cpp/broker/test/exchange_test.cpp index 6605f2685b..8c702ff836 100644 --- a/cpp/broker/test/exchange_test.cpp +++ b/cpp/broker/test/exchange_test.cpp @@ -20,10 +20,7 @@ #include "Exchange.h" #include "Queue.h" #include "TopicExchange.h" -#include <cppunit/TestCase.h> -#include <cppunit/TextTestRunner.h> -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/plugin/TestPlugIn.h> +#include <qpid_test_plugin.h> #include <iostream> using namespace qpid::broker; diff --git a/cpp/broker/test/message_test.cpp b/cpp/broker/test/message_test.cpp index 94d25a831e..fc2c6e01bb 100644 --- a/cpp/broker/test/message_test.cpp +++ b/cpp/broker/test/message_test.cpp @@ -17,10 +17,7 @@ */ #include "APRBase.h" #include "Message.h" -#include <cppunit/TestCase.h> -#include <cppunit/TextTestRunner.h> -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/plugin/TestPlugIn.h> +#include <qpid_test_plugin.h> #include <iostream> using namespace qpid::broker; |