summaryrefslogtreecommitdiff
path: root/cpp/common/framing/src/BasicHeaderProperties.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2006-10-11 15:50:15 +0000
committerAlan Conway <aconway@apache.org>2006-10-11 15:50:15 +0000
commit2bcadbb42a6fb2f096c1fc0a4b957d64a5024ef6 (patch)
tree886eb0659c6f28c2f1d26de7d5fd29fff0072dc5 /cpp/common/framing/src/BasicHeaderProperties.cpp
parent9fc2b6c5f0848d65f1bf20e62279c055d12a1d40 (diff)
downloadqpid-python-2bcadbb42a6fb2f096c1fc0a4b957d64a5024ef6.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/qpid@462834 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/common/framing/src/BasicHeaderProperties.cpp')
-rw-r--r--cpp/common/framing/src/BasicHeaderProperties.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/cpp/common/framing/src/BasicHeaderProperties.cpp b/cpp/common/framing/src/BasicHeaderProperties.cpp
index 4219d33a8f..c9153665d5 100644
--- a/cpp/common/framing/src/BasicHeaderProperties.cpp
+++ b/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);