summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2012-08-28 13:16:59 +0000
committerGordon Sim <gsim@apache.org>2012-08-28 13:16:59 +0000
commit93cfe7961b60929aae0718355291885d2e23ecfc (patch)
tree66d49528b04a2864ac12f01c632f85472c8e6ccf /cpp/src/qpid/sys
parent89a01d88c398751c228c0f57eb9520dc3f02abc4 (diff)
downloadqpid-python-93cfe7961b60929aae0718355291885d2e23ecfc.tar.gz
NO-JIRA: Remove const qualifier from encode buffer (can't encode into if it is const, and impls const cast it anyway)
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1378125 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys')
-rw-r--r--cpp/src/qpid/sys/Codec.h2
-rw-r--r--cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp6
-rw-r--r--cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/cpp/src/qpid/sys/Codec.h b/cpp/src/qpid/sys/Codec.h
index ace721fbcc..e398403e47 100644
--- a/cpp/src/qpid/sys/Codec.h
+++ b/cpp/src/qpid/sys/Codec.h
@@ -42,7 +42,7 @@ class Codec
/** Encode into buffer, return number of bytes encoded */
- virtual std::size_t encode(const char* buffer, std::size_t size) = 0;
+ virtual std::size_t encode(char* buffer, std::size_t size) = 0;
/** Return true if we have data to encode */
virtual bool canEncode() = 0;
diff --git a/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp b/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp
index 29b91f3e7a..a4d291ebab 100644
--- a/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp
+++ b/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.cpp
@@ -68,7 +68,7 @@ size_t CyrusSecurityLayer::decode(const char* input, size_t size)
return size;
}
-size_t CyrusSecurityLayer::encode(const char* buffer, size_t size)
+size_t CyrusSecurityLayer::encode(char* buffer, size_t size)
{
size_t processed = 0;//records how many bytes have been written to buffer
do {
@@ -92,12 +92,12 @@ size_t CyrusSecurityLayer::encode(const char* buffer, size_t size)
//can't fit all encrypted data in the buffer we've
//been given, copy in what we can and hold on to the
//rest until the next call
- ::memcpy(const_cast<char*>(buffer + processed), encrypted, remaining);
+ ::memcpy(buffer + processed, encrypted, remaining);
processed += remaining;
encrypted += remaining;
encryptedSize -= remaining;
} else {
- ::memcpy(const_cast<char*>(buffer + processed), encrypted, encryptedSize);
+ ::memcpy(buffer + processed, encrypted, encryptedSize);
processed += encryptedSize;
encrypted = 0;
encryptedSize = 0;
diff --git a/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h b/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h
index 1645cf1a58..7f108248ee 100644
--- a/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h
+++ b/cpp/src/qpid/sys/cyrus/CyrusSecurityLayer.h
@@ -39,7 +39,7 @@ class CyrusSecurityLayer : public qpid::sys::SecurityLayer
public:
CyrusSecurityLayer(sasl_conn_t*, uint16_t maxFrameSize);
size_t decode(const char* buffer, size_t size);
- size_t encode(const char* buffer, size_t size);
+ size_t encode(char* buffer, size_t size);
bool canEncode();
void init(qpid::sys::Codec*);
private: