diff options
| author | Charles E. Rolke <chug@apache.org> | 2011-10-14 14:57:58 +0000 |
|---|---|---|
| committer | Charles E. Rolke <chug@apache.org> | 2011-10-14 14:57:58 +0000 |
| commit | d3c9e9725c8fa014e9ecdd421e967bd53d962b08 (patch) | |
| tree | bfd07428c0be64fa5101a5f4081812067c3205be /cpp/src/tests | |
| parent | 085cdb1910ded5e6fcf9b56da595e9f4609f95b8 (diff) | |
| download | qpid-python-d3c9e9725c8fa014e9ecdd421e967bd53d962b08.tar.gz | |
QPID-3540 Typecasting and alignment requirements for various platforms
In RefCountedBuffer:
1. Pad the instantiantion address of RefCountedBuffer class up to an 8-byte boundary.
2. Add (void *) casts to 'store' pointer to prevent warnings about alignment.
In qpid-perftest:
1. Don't pull a size_t object from an arbitrary buffer address.
Instead, memcopy the object by bytes.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1183378 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
| -rw-r--r-- | cpp/src/tests/qpid-perftest.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cpp/src/tests/qpid-perftest.cpp b/cpp/src/tests/qpid-perftest.cpp index 3aff742c62..dd81354adb 100644 --- a/cpp/src/tests/qpid-perftest.cpp +++ b/cpp/src/tests/qpid-perftest.cpp @@ -644,7 +644,9 @@ 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 size_t*>(msg.getData().data() + offset); + size_t n; + memcpy (&n, reinterpret_cast<const char*>(msg.getData().data() + offset), + sizeof(n)); if (opts.pubs == 1) { if (opts.subs == 1 || opts.mode == FANOUT) verify(n==expect, "==", expect, n); else verify(n>=expect, ">=", expect, n); |
