diff options
| author | Alan Conway <aconway@apache.org> | 2006-10-11 15:50:15 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2006-10-11 15:50:15 +0000 |
| commit | ac3335857e3b30b99240c2a7638c8aed31d3e78d (patch) | |
| tree | 144465ed3ea20dab341a972377de9c0451b71113 /qpid/cpp/common/framing/src/BasicHeaderProperties.cpp | |
| parent | a3d3d2ccc0ccb5d4b857be93c4774ac1bddd0aeb (diff) | |
| download | qpid-python-ac3335857e3b30b99240c2a7638c8aed31d3e78d.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@462834 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/common/framing/src/BasicHeaderProperties.cpp')
| -rw-r--r-- | qpid/cpp/common/framing/src/BasicHeaderProperties.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/qpid/cpp/common/framing/src/BasicHeaderProperties.cpp b/qpid/cpp/common/framing/src/BasicHeaderProperties.cpp index 4219d33a8f..c9153665d5 100644 --- a/qpid/cpp/common/framing/src/BasicHeaderProperties.cpp +++ b/qpid/cpp/common/framing/src/BasicHeaderProperties.cpp @@ -23,23 +23,23 @@ qpid::framing::BasicHeaderProperties::BasicHeaderProperties() : deliveryMode(0), qpid::framing::BasicHeaderProperties::~BasicHeaderProperties(){} u_int32_t qpid::framing::BasicHeaderProperties::size() const{ - u_int32_t size = 2;//flags - if(contentType.length() > 0) size += contentType.length() + 1; - if(contentEncoding.length() > 0) size += contentEncoding.length() + 1; - if(headers.count() > 0) size += headers.size(); - if(deliveryMode != 0) size += 1; - if(priority != 0) size += 1; - if(correlationId.length() > 0) size += correlationId.length() + 1; - if(replyTo.length() > 0) size += replyTo.length() + 1; - if(expiration.length() > 0) size += expiration.length() + 1; - if(messageId.length() > 0) size += messageId.length() + 1; - if(timestamp != 0) size += 8; - if(type.length() > 0) size += type.length() + 1; - if(userId.length() > 0) size += userId.length() + 1; - if(appId.length() > 0) size += appId.length() + 1; - if(clusterId.length() > 0) size += clusterId.length() + 1; + u_int32_t bytes = 2;//flags + if(contentType.length() > 0) bytes += contentType.length() + 1; + if(contentEncoding.length() > 0) bytes += contentEncoding.length() + 1; + if(headers.count() > 0) bytes += headers.size(); + if(deliveryMode != 0) bytes += 1; + if(priority != 0) bytes += 1; + if(correlationId.length() > 0) bytes += correlationId.length() + 1; + if(replyTo.length() > 0) bytes += replyTo.length() + 1; + if(expiration.length() > 0) bytes += expiration.length() + 1; + if(messageId.length() > 0) bytes += messageId.length() + 1; + if(timestamp != 0) bytes += 8; + if(type.length() > 0) bytes += type.length() + 1; + if(userId.length() > 0) bytes += userId.length() + 1; + if(appId.length() > 0) bytes += appId.length() + 1; + if(clusterId.length() > 0) bytes += clusterId.length() + 1; - return size; + return bytes; } void qpid::framing::BasicHeaderProperties::encode(qpid::framing::Buffer& buffer) const{ @@ -62,9 +62,8 @@ void qpid::framing::BasicHeaderProperties::encode(qpid::framing::Buffer& buffer) if(clusterId.length() > 0) buffer.putShortString(clusterId); } -void qpid::framing::BasicHeaderProperties::decode(qpid::framing::Buffer& buffer, u_int32_t size){ +void qpid::framing::BasicHeaderProperties::decode(qpid::framing::Buffer& buffer, u_int32_t /*size*/){ u_int16_t flags = buffer.getShort(); - int shift = 15; if(flags & (1 << 15)) buffer.getShortString(contentType); if(flags & (1 << 14)) buffer.getShortString(contentEncoding); if(flags & (1 << 13)) buffer.getFieldTable(headers); @@ -83,7 +82,6 @@ void qpid::framing::BasicHeaderProperties::decode(qpid::framing::Buffer& buffer, u_int16_t qpid::framing::BasicHeaderProperties::getFlags() const{ u_int16_t flags(0); - int shift = 15; if(contentType.length() > 0) flags |= (1 << 15); if(contentEncoding.length() > 0) flags |= (1 << 14); if(headers.count() > 0) flags |= (1 << 13); |
