summaryrefslogtreecommitdiff
path: root/cpp/client/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2006-10-11 15:50:15 +0000
committerAlan Conway <aconway@apache.org>2006-10-11 15:50:15 +0000
commit2bcadbb42a6fb2f096c1fc0a4b957d64a5024ef6 (patch)
tree886eb0659c6f28c2f1d26de7d5fd29fff0072dc5 /cpp/client/src
parent9fc2b6c5f0848d65f1bf20e62279c055d12a1d40 (diff)
downloadqpid-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/client/src')
-rw-r--r--cpp/client/src/Channel.cpp26
-rw-r--r--cpp/client/src/Connection.cpp14
-rw-r--r--cpp/client/src/IncomingMessage.cpp16
-rw-r--r--cpp/client/src/MessageListener.cpp21
-rw-r--r--cpp/client/src/Queue.cpp4
-rw-r--r--cpp/client/src/ResponseHandler.cpp4
-rw-r--r--cpp/client/src/ReturnedMessageHandler.cpp21
7 files changed, 77 insertions, 29 deletions
diff --git a/cpp/client/src/Channel.cpp b/cpp/client/src/Channel.cpp
index e965f7e5dd..cf2f5bc081 100644
--- a/cpp/client/src/Channel.cpp
+++ b/cpp/client/src/Channel.cpp
@@ -26,11 +26,16 @@ using namespace qpid::client;
using namespace qpid::framing;
using namespace qpid::concurrent;
-Channel::Channel(bool _transactional, u_int16_t _prefetch) : id(0), incoming(0), con(0), out(0),
- prefetch(_prefetch),
- transactional(_transactional),
- dispatcher(0),
- closed(true){
+Channel::Channel(bool _transactional, u_int16_t _prefetch) :
+ id(0),
+ con(0),
+ dispatcher(0),
+ out(0),
+ incoming(0),
+ closed(true),
+ prefetch(_prefetch),
+ transactional(_transactional)
+{
threadFactory = new ThreadFactoryImpl();
dispatchMonitor = new MonitorImpl();
retrievalMonitor = new MonitorImpl();
@@ -46,8 +51,8 @@ Channel::~Channel(){
delete threadFactory;
}
-void Channel::setPrefetch(u_int16_t prefetch){
- this->prefetch = prefetch;
+void Channel::setPrefetch(u_int16_t _prefetch){
+ prefetch = _prefetch;
if(con != 0 && out != 0){
setQos();
}
@@ -114,7 +119,9 @@ void Channel::deleteQueue(Queue& queue, bool ifunused, bool ifempty, bool synch)
void Channel::bind(const Exchange& exchange, const Queue& queue, const std::string& key, const FieldTable& args, bool synch){
string e = exchange.getName();
string q = queue.getName();
- AMQFrame* frame = new AMQFrame(id, new QueueBindBody(0, q, e, (string&) key,!synch, (FieldTable&) args));
+ // TODO aconway 2006-10-10: not const correct, get rid of const_cast.
+ //
+ AMQFrame* frame = new AMQFrame(id, new QueueBindBody(0, q, e, key,!synch, const_cast<FieldTable&>(args)));
if(synch){
sendAndReceive(frame, queue_bind_ok);
}else{
@@ -160,7 +167,6 @@ void Channel::cancel(std::string& tag, bool synch){
}
void Channel::cancelAll(){
- int count(consumers.size());
for(consumer_iterator i = consumers.begin(); i != consumers.end(); i = consumers.begin()){
Consumer* c = i->second;
if((c->ackMode == LAZY_ACK || c->ackMode == AUTO_ACK) && c->lastDeliveryTag > 0){
@@ -306,7 +312,7 @@ void Channel::handleContent(AMQContentBody::shared_ptr body){
}
}
-void Channel::handleHeartbeat(AMQHeartbeatBody::shared_ptr body){
+void Channel::handleHeartbeat(AMQHeartbeatBody::shared_ptr /*body*/){
THROW_QPID_ERROR(PROTOCOL_ERROR + 504, "Channel received heartbeat");
}
diff --git a/cpp/client/src/Connection.cpp b/cpp/client/src/Connection.cpp
index eeb2330561..f332d2242c 100644
--- a/cpp/client/src/Connection.cpp
+++ b/cpp/client/src/Connection.cpp
@@ -37,9 +37,9 @@ Connection::~Connection(){
delete connector;
}
-void Connection::open(const std::string& host, int port, const std::string& uid, const std::string& pwd, const std::string& virtualhost){
- this->host = host;
- this->port = port;
+void Connection::open(const std::string& _host, int _port, const std::string& uid, const std::string& pwd, const std::string& virtualhost){
+ host = _host;
+ port = _port;
connector->setInputHandler(this);
connector->setTimeoutHandler(this);
connector->setShutdownHandler(this);
@@ -181,15 +181,15 @@ void Connection::handleMethod(AMQMethodBody::shared_ptr body){
}
}
-void Connection::handleHeader(AMQHeaderBody::shared_ptr body){
+void Connection::handleHeader(AMQHeaderBody::shared_ptr /*body*/){
error(504, "Channel error: received header body with channel 0.");
}
-void Connection::handleContent(AMQContentBody::shared_ptr body){
+void Connection::handleContent(AMQContentBody::shared_ptr /*body*/){
error(504, "Channel error: received content body with channel 0.");
}
-void Connection::handleHeartbeat(AMQHeartbeatBody::shared_ptr body){
+void Connection::handleHeartbeat(AMQHeartbeatBody::shared_ptr /*body*/){
}
void Connection::sendAndReceive(AMQFrame* frame, const AMQMethodBody& body){
@@ -204,7 +204,7 @@ void Connection::error(int code, const string& msg, int classid, int methodid){
std::cout << " [" << methodid << ":" << classid << "]";
}
std::cout << std::endl;
- sendAndReceive(new AMQFrame(0, new ConnectionCloseBody(code, (string&) msg, classid, methodid)), connection_close_ok);
+ sendAndReceive(new AMQFrame(0, new ConnectionCloseBody(code, msg, classid, methodid)), connection_close_ok);
connector->close();
}
diff --git a/cpp/client/src/IncomingMessage.cpp b/cpp/client/src/IncomingMessage.cpp
index c95a92b651..9576051302 100644
--- a/cpp/client/src/IncomingMessage.cpp
+++ b/cpp/client/src/IncomingMessage.cpp
@@ -29,12 +29,12 @@ IncomingMessage::IncomingMessage(BasicGetOkBody::shared_ptr intro): response(int
IncomingMessage::~IncomingMessage(){
}
-void IncomingMessage::setHeader(AMQHeaderBody::shared_ptr header){
- this->header = header;
+void IncomingMessage::setHeader(AMQHeaderBody::shared_ptr _header){
+ this->header = _header;
}
-void IncomingMessage::addContent(AMQContentBody::shared_ptr content){
- this->content.push_back(content);
+void IncomingMessage::addContent(AMQContentBody::shared_ptr _content){
+ this->content.push_back(_content);
}
bool IncomingMessage::isComplete(){
@@ -75,10 +75,10 @@ void IncomingMessage::getData(string& s){
}
}
-long IncomingMessage::contentSize(){
- long size(0);
- int count(content.size());
- for(int i = 0; i < count; i++){
+u_int64_t IncomingMessage::contentSize(){
+ u_int64_t size(0);
+ u_int64_t count(content.size());
+ for(u_int64_t i = 0; i < count; i++){
size += content[i]->size();
}
return size;
diff --git a/cpp/client/src/MessageListener.cpp b/cpp/client/src/MessageListener.cpp
new file mode 100644
index 0000000000..cf55db8edf
--- /dev/null
+++ b/cpp/client/src/MessageListener.cpp
@@ -0,0 +1,21 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "MessageListener.h"
+
+qpid::client::MessageListener::~MessageListener() {}
diff --git a/cpp/client/src/Queue.cpp b/cpp/client/src/Queue.cpp
index cb957dd993..5b2881f7ff 100644
--- a/cpp/client/src/Queue.cpp
+++ b/cpp/client/src/Queue.cpp
@@ -30,8 +30,8 @@ const std::string& qpid::client::Queue::getName() const{
return name;
}
-void qpid::client::Queue::setName(const std::string& name){
- this->name = name;
+void qpid::client::Queue::setName(const std::string& _name){
+ name = _name;
}
bool qpid::client::Queue::isAutoDelete() const{
diff --git a/cpp/client/src/ResponseHandler.cpp b/cpp/client/src/ResponseHandler.cpp
index 837bba37fd..6938539469 100644
--- a/cpp/client/src/ResponseHandler.cpp
+++ b/cpp/client/src/ResponseHandler.cpp
@@ -39,8 +39,8 @@ void qpid::client::ResponseHandler::waitForResponse(){
monitor->release();
}
-void qpid::client::ResponseHandler::signalResponse(qpid::framing::AMQMethodBody::shared_ptr response){
- this->response = response;
+void qpid::client::ResponseHandler::signalResponse(qpid::framing::AMQMethodBody::shared_ptr _response){
+ response = _response;
monitor->acquire();
waiting = false;
monitor->notify();
diff --git a/cpp/client/src/ReturnedMessageHandler.cpp b/cpp/client/src/ReturnedMessageHandler.cpp
new file mode 100644
index 0000000000..cfa91fee97
--- /dev/null
+++ b/cpp/client/src/ReturnedMessageHandler.cpp
@@ -0,0 +1,21 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "ReturnedMessageHandler.h"
+
+qpid::client::ReturnedMessageHandler::~ReturnedMessageHandler() {}