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 | 2bcadbb42a6fb2f096c1fc0a4b957d64a5024ef6 (patch) | |
tree | 886eb0659c6f28c2f1d26de7d5fd29fff0072dc5 /cpp/common/framing/src/Buffer.cpp | |
parent | 9fc2b6c5f0848d65f1bf20e62279c055d12a1d40 (diff) | |
download | qpid-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/Buffer.cpp')
-rw-r--r-- | cpp/common/framing/src/Buffer.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/cpp/common/framing/src/Buffer.cpp b/cpp/common/framing/src/Buffer.cpp index 15a4485abd..87aa1df7e9 100644 --- a/cpp/common/framing/src/Buffer.cpp +++ b/cpp/common/framing/src/Buffer.cpp @@ -18,7 +18,7 @@ #include "Buffer.h" #include "FieldTable.h" -qpid::framing::Buffer::Buffer(int _size) : size(_size), position(0), limit(_size){ +qpid::framing::Buffer::Buffer(u_int32_t _size) : size(_size), position(0), limit(_size){ data = new char[size]; } @@ -37,7 +37,7 @@ void qpid::framing::Buffer::clear(){ } void qpid::framing::Buffer::compact(){ - int p = limit - position; + u_int32_t p = limit - position; //copy p chars from position to 0 memmove(data, data + position, p); limit = size; @@ -54,7 +54,7 @@ void qpid::framing::Buffer::restore(){ limit = r_limit; } -int qpid::framing::Buffer::available(){ +u_int32_t qpid::framing::Buffer::available(){ return limit - position; } @@ -62,7 +62,7 @@ char* qpid::framing::Buffer::start(){ return data + position; } -void qpid::framing::Buffer::move(int bytes){ +void qpid::framing::Buffer::move(u_int32_t bytes){ position += bytes; } @@ -123,29 +123,29 @@ u_int64_t qpid::framing::Buffer::getLongLong(){ void qpid::framing::Buffer::putShortString(const string& s){ - u_int8_t size = s.length(); - putOctet(size); - s.copy(data + position, size); - position += size; + u_int8_t len = s.length(); + putOctet(len); + s.copy(data + position, len); + position += len; } void qpid::framing::Buffer::putLongString(const string& s){ - u_int32_t size = s.length(); - putLong(size); - s.copy(data + position, size); - position += size; + u_int32_t len = s.length(); + putLong(len); + s.copy(data + position, len); + position += len; } void qpid::framing::Buffer::getShortString(string& s){ - u_int8_t size = getOctet(); - s.assign(data + position, size); - position += size; + u_int8_t len = getOctet(); + s.assign(data + position, len); + position += len; } void qpid::framing::Buffer::getLongString(string& s){ - u_int32_t size = getLong(); - s.assign(data + position, size); - position += size; + u_int32_t len = getLong(); + s.assign(data + position, len); + position += len; } void qpid::framing::Buffer::putFieldTable(const FieldTable& t){ @@ -157,12 +157,12 @@ void qpid::framing::Buffer::getFieldTable(FieldTable& t){ } void qpid::framing::Buffer::putRawData(const string& s){ - u_int32_t size = s.length(); - s.copy(data + position, size); - position += size; + u_int32_t len = s.length(); + s.copy(data + position, len); + position += len; } -void qpid::framing::Buffer::getRawData(string& s, u_int32_t size){ - s.assign(data + position, size); - position += size; +void qpid::framing::Buffer::getRawData(string& s, u_int32_t len){ + s.assign(data + position, len); + position += len; } |