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/Buffer.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/Buffer.cpp')
| -rw-r--r-- | qpid/cpp/common/framing/src/Buffer.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/qpid/cpp/common/framing/src/Buffer.cpp b/qpid/cpp/common/framing/src/Buffer.cpp index 15a4485abd..87aa1df7e9 100644 --- a/qpid/cpp/common/framing/src/Buffer.cpp +++ b/qpid/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; } |
