summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/client/amqp0_10/IncomingMessages.cpp6
-rw-r--r--cpp/src/qpid/client/amqp0_10/SessionImpl.cpp8
-rw-r--r--cpp/src/tests/MessagingSessionTests.cpp2
3 files changed, 11 insertions, 5 deletions
diff --git a/cpp/src/qpid/client/amqp0_10/IncomingMessages.cpp b/cpp/src/qpid/client/amqp0_10/IncomingMessages.cpp
index 83e1b48bed..b69c1917e6 100644
--- a/cpp/src/qpid/client/amqp0_10/IncomingMessages.cpp
+++ b/cpp/src/qpid/client/amqp0_10/IncomingMessages.cpp
@@ -114,7 +114,7 @@ void IncomingMessages::releaseAll()
}
//then pump out any available messages from incoming queue...
GetAny handler;
- while (process(&handler, 0));
+ while (process(&handler, 0)) ;
//now release all messages
session.messageRelease(unaccepted);
unaccepted.clear();
@@ -123,11 +123,11 @@ void IncomingMessages::releaseAll()
void IncomingMessages::releasePending(const std::string& destination)
{
//first pump all available messages from incoming to received...
- while (process(0, 0));
+ while (process(0, 0)) ;
//now remove all messages for this destination from received list, recording their ids...
MatchAndTrack match(destination);
- for (FrameSetQueue::iterator i = received.begin(); i != received.end(); i = match(*i) ? received.erase(i) : ++i);
+ for (FrameSetQueue::iterator i = received.begin(); i != received.end(); i = match(*i) ? received.erase(i) : ++i) ;
//now release those messages
session.messageRelease(match.ids);
}
diff --git a/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp b/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp
index 647ace5f92..9ea2a9f598 100644
--- a/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp
+++ b/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp
@@ -79,7 +79,13 @@ void SessionImpl::reject(qpid::messaging::Message& m)
{
qpid::sys::Mutex::ScopedLock l(lock);
//TODO: how do I get the id of the original transfer command? think this through some more...
- SequenceNumber id(reinterpret_cast<uint32_t>(m.getInternalId()));
+
+ // [tross] The following hack was added to get this code to compile on a 64-bit machine.
+ // It should be functionally equivalent to the original on a 32-bit architecture
+ // but is almost certainly not what was intended by the author.
+ uint64_t rawId(reinterpret_cast<uint64_t>(m.getInternalId()));
+ SequenceNumber id((uint32_t) ((rawId & 0xFFFFFFFF) ^ ((rawId >> 32) & 0xFFFFFFFF)));
+
SequenceSet set;
set.add(id);
session.messageReject(set);
diff --git a/cpp/src/tests/MessagingSessionTests.cpp b/cpp/src/tests/MessagingSessionTests.cpp
index ef320c3ae0..6eebf717bf 100644
--- a/cpp/src/tests/MessagingSessionTests.cpp
+++ b/cpp/src/tests/MessagingSessionTests.cpp
@@ -274,7 +274,7 @@ QPID_AUTO_TEST_CASE(testSessionDispatch)
s.send(msg);
}
- while (fix.session.dispatch(qpid::sys::TIME_SEC));
+ while (fix.session.dispatch(qpid::sys::TIME_SEC)) ;
BOOST_CHECK_EQUAL(collector.messageData, boost::assign::list_of<std::string>("Message_1")("Message_2")("Message_3"));
}