summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-07-23 09:40:49 +0000
committerGordon Sim <gsim@apache.org>2008-07-23 09:40:49 +0000
commitffb8dcddca58e1277da90b823d7e7ec45a72e488 (patch)
tree7e5e296aecaff9234a8d5b627ac8e3cb2fb56a29 /qpid/cpp
parentb01fbd47df48b3871622ce35f3e9dce67e09be3f (diff)
downloadqpid-python-ffb8dcddca58e1277da90b823d7e7ec45a72e488.tar.gz
QPID-1183: Use the right sizes to insert data inside the message payload where sizeof(size_t) != sizeof(uint32_t). Patch from Manuel Teira.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@679048 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/src/tests/perftest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/perftest.cpp b/qpid/cpp/src/tests/perftest.cpp
index b666102e70..9096854a6d 100644
--- a/qpid/cpp/src/tests/perftest.cpp
+++ b/qpid/cpp/src/tests/perftest.cpp
@@ -465,8 +465,8 @@ struct PublishThread : public Client {
for (size_t i=0; i<opts.count; i++) {
// Stamp the iteration into the message data, avoid
// any heap allocation.
- const_cast<std::string&>(msg.getData()).replace(offset, sizeof(uint32_t),
- reinterpret_cast<const char*>(&i), sizeof(uint32_t));
+ const_cast<std::string&>(msg.getData()).replace(offset, sizeof(size_t),
+ reinterpret_cast<const char*>(&i), sizeof(size_t));
if (opts.syncPub) {
sync(session).messageTransfer(
arg::destination=destination,
@@ -561,7 +561,7 @@ struct SubscribeThread : public Client {
//
// For now verify order only for a single publisher.
size_t offset = opts.uniqueData ? 5 /*marker is 'data:'*/ : 0;
- size_t n = *reinterpret_cast<const uint32_t*>(msg.getData().data() + offset);
+ size_t n = *reinterpret_cast<const size_t*>(msg.getData().data() + offset);
if (opts.pubs == 1) {
if (opts.subs == 1 || opts.mode == FANOUT) verify(n==expect, "==", expect, n);
else verify(n>=expect, ">=", expect, n);