diff options
author | Michi Henning <michi@zeroc.com> | 2003-05-30 06:13:39 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2003-05-30 06:13:39 +0000 |
commit | 63539f257131942912257a7f0663e2e70aab890b (patch) | |
tree | 017f7a35470a26bbd0c66dd521cd55f361799056 /cpp/src | |
parent | *** empty log message *** (diff) | |
download | ice-63539f257131942912257a7f0663e2e70aab890b.tar.bz2 ice-63539f257131942912257a7f0663e2e70aab890b.tar.xz ice-63539f257131942912257a7f0663e2e70aab890b.zip |
Changed C++ mapping of Slice byte from char to unsigned char.
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Connection.cpp | 10 | ||||
-rw-r--r-- | cpp/src/IcePatch/ClientUtil.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IcePatch/Util.cpp | 12 | ||||
-rw-r--r-- | cpp/src/IceSSL/SslClientTransceiver.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceSSL/SslServerTransceiver.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceSSL/SslTransceiver.cpp | 6 | ||||
-rw-r--r-- | cpp/src/IceSSL/SslTransceiver.h | 4 | ||||
-rw-r--r-- | cpp/src/IceUtil/Base64.cpp | 6 | ||||
-rw-r--r-- | cpp/src/XMLTransform/XMLTransform.cpp | 4 | ||||
-rw-r--r-- | cpp/src/slice2freeze/Main.cpp | 2 |
10 files changed, 27 insertions, 25 deletions
diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp index 3721cdc2334..95098e94681 100644 --- a/cpp/src/Ice/Connection.cpp +++ b/cpp/src/Ice/Connection.cpp @@ -1685,8 +1685,10 @@ IceInternal::Connection::doCompress(BasicStream& uncompressed, BasicStream& comp unsigned int uncompressedLen = static_cast<unsigned int>(uncompressed.b.size() - headerSize); unsigned int compressedLen = static_cast<unsigned int>(uncompressedLen * 1.01 + 600); compressed.b.resize(headerSize + sizeof(Int) + compressedLen); - int bzError = BZ2_bzBuffToBuffCompress(&compressed.b[0] + headerSize + sizeof(Int), &compressedLen, - &uncompressed.b[0] + headerSize, uncompressedLen, + int bzError = BZ2_bzBuffToBuffCompress(reinterpret_cast<char*>(&compressed.b[0]) + headerSize + sizeof(Int), + &compressedLen, + reinterpret_cast<char*>(&uncompressed.b[0]) + headerSize, + uncompressedLen, 1, 0, 0); if(bzError != BZ_OK) { @@ -1741,9 +1743,9 @@ IceInternal::Connection::doUncompress(BasicStream& compressed, BasicStream& unco uncompressed.resize(uncompressedSize); unsigned int uncompressedLen = uncompressedSize - headerSize; unsigned int compressedLen = static_cast<unsigned int>(compressed.b.size() - headerSize - sizeof(Int)); - int bzError = BZ2_bzBuffToBuffDecompress(&uncompressed.b[0] + headerSize, + int bzError = BZ2_bzBuffToBuffDecompress(reinterpret_cast<char*>(&uncompressed.b[0]) + headerSize, &uncompressedLen, - &compressed.b[0] + headerSize + sizeof(Int), + reinterpret_cast<char*>(&compressed.b[0]) + headerSize + sizeof(Int), compressedLen, 0, 0); if(bzError != BZ_OK) diff --git a/cpp/src/IcePatch/ClientUtil.cpp b/cpp/src/IcePatch/ClientUtil.cpp index b9f54b78b0b..e6fefd967da 100644 --- a/cpp/src/IcePatch/ClientUtil.cpp +++ b/cpp/src/IcePatch/ClientUtil.cpp @@ -83,7 +83,7 @@ IcePatch::getRegular(const RegularPrx& regular, ProgressCB& progressCB) posBZ2 += static_cast<Int>(bytesBZ2.size()); - fileBZ2.write(&bytesBZ2[0], bytesBZ2.size()); + fileBZ2.write(reinterpret_cast<const char*>(&bytesBZ2[0]), bytesBZ2.size()); if(!fileBZ2) { FileAccessException ex; @@ -169,7 +169,7 @@ IcePatch::getRegular(const RegularPrx& regular, ProgressCB& progressCB) progressCB.updateUncompress(totalBZ2, static_cast<Int>(pos)); - file.write(bytesBZ2, sz); + file.write(reinterpret_cast<const char*>(bytesBZ2), sz); if(!file) { FileAccessException ex; diff --git a/cpp/src/IcePatch/Util.cpp b/cpp/src/IcePatch/Util.cpp index 036d7d6b1b7..e709b521065 100644 --- a/cpp/src/IcePatch/Util.cpp +++ b/cpp/src/IcePatch/Util.cpp @@ -441,7 +441,7 @@ IcePatch::getMD5(const string& path) ByteSeq bytesMD5; bytesMD5.resize(16); - fileMD5.read(&bytesMD5[0], 16); + fileMD5.read(reinterpret_cast<char*>(&bytesMD5[0]), 16); if(!fileMD5) { FileAccessException ex; @@ -477,7 +477,7 @@ IcePatch::putMD5(const string& path, const ByteSeq& bytesMD5) throw ex; } - fileMD5.write(&bytesMD5[0], 16); + fileMD5.write(reinterpret_cast<const char*>(&bytesMD5[0]), 16); if(!fileMD5) { FileAccessException ex; @@ -555,7 +555,7 @@ IcePatch::createMD5(const string& path, const LoggerPtr& logger) bytes.resize(info.size); if(bytes.size() > 0) { - file.read(&bytes[0], bytes.size()); + file.read(reinterpret_cast<char*>(&bytes[0]), bytes.size()); if(!file) { FileAccessException ex; @@ -633,7 +633,7 @@ IcePatch::calcPartialMD5(const string& path, Int size, const LoggerPtr& logger) bytes.resize(size); if(bytes.size() > 0) { - file.read(&bytes[0], bytes.size()); + file.read(reinterpret_cast<char*>(&bytes[0]), bytes.size()); if(!file) { FileAccessException ex; @@ -712,7 +712,7 @@ IcePatch::getBZ2(const string& path, Int pos, Int num) ByteSeq bytesBZ2; bytesBZ2.resize(num); - fileBZ2.read(&bytesBZ2[0], bytesBZ2.size()); + fileBZ2.read(reinterpret_cast<char*>(&bytesBZ2[0]), bytesBZ2.size()); if(!fileBZ2 && !fileBZ2.eof()) { FileAccessException ex; @@ -778,7 +778,7 @@ IcePatch::createBZ2(const string& path, const Ice::LoggerPtr& logger) while(!file.eof()) { - file.read(bytes, num); + file.read(reinterpret_cast<char*>(&bytes[0]), num); if(!file && !file.eof()) { FileAccessException ex; diff --git a/cpp/src/IceSSL/SslClientTransceiver.cpp b/cpp/src/IceSSL/SslClientTransceiver.cpp index 1b58023be0c..4deb7038700 100644 --- a/cpp/src/IceSSL/SslClientTransceiver.cpp +++ b/cpp/src/IceSSL/SslClientTransceiver.cpp @@ -74,7 +74,7 @@ IceSSL::SslClientTransceiver::write(Buffer& buf, int timeout) break; } - bytesWritten = sslWrite(static_cast<char*>(&*buf.i), static_cast<Int>(packetSize)); + bytesWritten = sslWrite(&*buf.i, static_cast<Int>(packetSize)); switch(getLastError()) { diff --git a/cpp/src/IceSSL/SslServerTransceiver.cpp b/cpp/src/IceSSL/SslServerTransceiver.cpp index 88b48696706..3a38180171b 100644 --- a/cpp/src/IceSSL/SslServerTransceiver.cpp +++ b/cpp/src/IceSSL/SslServerTransceiver.cpp @@ -75,7 +75,7 @@ IceSSL::SslServerTransceiver::write(Buffer& buf, int timeout) break; } - bytesWritten = sslWrite(static_cast<char*>(&*buf.i), static_cast<Int>(packetSize)); + bytesWritten = sslWrite(&*buf.i, static_cast<Int>(packetSize)); switch(getLastError()) { diff --git a/cpp/src/IceSSL/SslTransceiver.cpp b/cpp/src/IceSSL/SslTransceiver.cpp index 6a83659c3cd..2fd8b3ed2df 100644 --- a/cpp/src/IceSSL/SslTransceiver.cpp +++ b/cpp/src/IceSSL/SslTransceiver.cpp @@ -152,7 +152,7 @@ IceSSL::SslTransceiver::read(Buffer& buf, int timeout) _readTimeout = timeout; - bytesRead = sslRead(static_cast<char*>(&*buf.i), static_cast<Int>(packetSize)); + bytesRead = sslRead(&*buf.i, static_cast<Int>(packetSize)); switch(getLastError()) { @@ -680,7 +680,7 @@ IceSSL::SslTransceiver::getLastError() const } int -IceSSL::SslTransceiver::sslRead(char* buffer, int bufferSize) +IceSSL::SslTransceiver::sslRead(unsigned char* buffer, int bufferSize) { assert(_sslConnection != 0); @@ -693,7 +693,7 @@ IceSSL::SslTransceiver::sslRead(char* buffer, int bufferSize) } int -IceSSL::SslTransceiver::sslWrite(char* buffer, int bufferSize) +IceSSL::SslTransceiver::sslWrite(unsigned char* buffer, int bufferSize) { assert(_sslConnection != 0); diff --git a/cpp/src/IceSSL/SslTransceiver.h b/cpp/src/IceSSL/SslTransceiver.h index 781fa34a9f2..582d648587e 100644 --- a/cpp/src/IceSSL/SslTransceiver.h +++ b/cpp/src/IceSSL/SslTransceiver.h @@ -160,8 +160,8 @@ protected: int pending(); int getLastError() const; - int sslRead(char*, int); - int sslWrite(char*, int); + int sslRead(unsigned char*, int); + int sslWrite(unsigned char*, int); int select(int, bool); int readSelect(int); diff --git a/cpp/src/IceUtil/Base64.cpp b/cpp/src/IceUtil/Base64.cpp index 414b85f2bbf..3989e23533a 100644 --- a/cpp/src/IceUtil/Base64.cpp +++ b/cpp/src/IceUtil/Base64.cpp @@ -18,7 +18,7 @@ using namespace std; string -IceUtil::Base64::encode(const vector<char>& plainSeq) +IceUtil::Base64::encode(const vector<unsigned char>& plainSeq) { string retval; @@ -101,7 +101,7 @@ IceUtil::Base64::encode(const vector<char>& plainSeq) return outString; } -vector<char> +vector<unsigned char> IceUtil::Base64::decode(const string& str) { string newStr; @@ -116,7 +116,7 @@ IceUtil::Base64::decode(const string& str) } } - vector<char> retval; + vector<unsigned char> retval; if(newStr.length() == 0) { diff --git a/cpp/src/XMLTransform/XMLTransform.cpp b/cpp/src/XMLTransform/XMLTransform.cpp index aa193397b55..9a82b790a44 100644 --- a/cpp/src/XMLTransform/XMLTransform.cpp +++ b/cpp/src/XMLTransform/XMLTransform.cpp @@ -2969,7 +2969,7 @@ XMLTransform::DBTransformer::transform(ICE_XERCES_NS DOMDocument* oldSchema, ICE // string fullKey; fullKey.append(header); - fullKey.append(&k[0], k.size()); + fullKey.append(reinterpret_cast<const char*>(&k[0]), k.size()); fullKey.append(footer); ICE_XERCES_NS MemBufInputSource keySource((const XMLByte*)fullKey.data(), static_cast<unsigned int>(fullKey.size()), "key"); parser.parse(keySource); @@ -2990,7 +2990,7 @@ XMLTransform::DBTransformer::transform(ICE_XERCES_NS DOMDocument* oldSchema, ICE Value value = _db->getWithTxn(txn, k); string fullValue; fullValue.append(header); - fullValue.append(&value[0], value.size()); + fullValue.append(reinterpret_cast<const char*>(&value[0]), value.size()); fullValue.append(footer); ICE_XERCES_NS MemBufInputSource valueSource((const XMLByte*)fullValue.data(), static_cast<unsigned int>(fullValue.size()), diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp index c63deb92dae..24b3cb70f1e 100644 --- a/cpp/src/slice2freeze/Main.cpp +++ b/cpp/src/slice2freeze/Main.cpp @@ -151,7 +151,7 @@ writeCodecC(const TypePtr& type, const string& name, const string& freezeType, O // C << nl << "std::string str;"; C << nl << "str.append(\"<data>\");"; - C << nl << "str.append(&bytes[0], bytes.size());"; + C << nl << "str.append(reinterpret_cast<const char*>(&bytes[0]), bytes.size());"; C << nl << "str.append(\"</data>\");"; C << nl << "std::istringstream istr(str);"; C << nl << "Ice::StreamPtr stream = new IceXML::StreamI(communicator, istr, false);"; |