From f0cf4ae2afe59441b23fcd3b6cba5529ee3ac151 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 23 Jul 2008 09:40:49 +0000 Subject: 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/qpid@679048 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/perftest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cpp') diff --git a/cpp/src/tests/perftest.cpp b/cpp/src/tests/perftest.cpp index b666102e70..9096854a6d 100644 --- a/cpp/src/tests/perftest.cpp +++ b/cpp/src/tests/perftest.cpp @@ -465,8 +465,8 @@ struct PublishThread : public Client { for (size_t i=0; i(msg.getData()).replace(offset, sizeof(uint32_t), - reinterpret_cast(&i), sizeof(uint32_t)); + const_cast(msg.getData()).replace(offset, sizeof(size_t), + reinterpret_cast(&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(msg.getData().data() + offset); + size_t n = *reinterpret_cast(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); -- cgit v1.2.1