diff --git a/cpp/include/Ice/Buffer.h b/cpp/include/Ice/Buffer.h index 5ac50dcf4f6..234d2547349 100644 --- a/cpp/include/Ice/Buffer.h +++ b/cpp/include/Ice/Buffer.h @@ -15,8 +15,8 @@ class ICE_API Buffer : private IceUtil::noncopyable public: Buffer() : i(b.begin()) { } - Buffer(const Ice::Byte* beg, const Ice::Byte* end) : b(beg, end), i(b.begin()) { } - Buffer(const std::vector& v) : b(v), i(b.begin()) { } + Buffer(const std::uint8_t* beg, const std::uint8_t* end) : b(beg, end), i(b.begin()) { } + Buffer(const std::vector& v) : b(v), i(b.begin()) { } Buffer(Buffer& o, bool adopt) : b(o.b, adopt), i(b.begin()) { } void swapBuffer(Buffer&); @@ -29,12 +29,12 @@ class ICE_API Buffer : private IceUtil::noncopyable // Standard vector-like operations. // - typedef Ice::Byte value_type; - typedef Ice::Byte* iterator; - typedef const Ice::Byte* const_iterator; - typedef Ice::Byte& reference; - typedef const Ice::Byte& const_reference; - typedef Ice::Byte* pointer; + typedef std::uint8_t value_type; + typedef std::uint8_t* iterator; + typedef const std::uint8_t* const_iterator; + typedef std::uint8_t& reference; + typedef const std::uint8_t& const_reference; + typedef std::uint8_t* pointer; typedef size_t size_type; Container(); diff --git a/cpp/include/Ice/Config.h b/cpp/include/Ice/Config.h index 13665281fe7..1915c92e76d 100644 --- a/cpp/include/Ice/Config.h +++ b/cpp/include/Ice/Config.h @@ -41,18 +41,6 @@ namespace Ice { } -namespace IceInternal -{ -} - -namespace Ice -{ - -/** The mapping for the Slice byte type. */ -typedef unsigned char Byte; - -} - namespace IceInternal { diff --git a/cpp/include/Ice/IconvStringConverter.h b/cpp/include/Ice/IconvStringConverter.h index 25df4d192d9..d2d5287a507 100644 --- a/cpp/include/Ice/IconvStringConverter.h +++ b/cpp/include/Ice/IconvStringConverter.h @@ -90,9 +90,9 @@ class IconvStringConverter : public IceUtil::BasicStringConverter IconvStringConverter(const std::string&); - virtual Ice::Byte* toUTF8(const charT*, const charT*, Ice::UTF8Buffer&) const; + virtual std::uint8_t* toUTF8(const charT*, const charT*, Ice::UTF8Buffer&) const; - virtual void fromUTF8(const Ice::Byte*, const Ice::Byte*, std::basic_string&) const; + virtual void fromUTF8(const std::uint8_t*, const std::uint8_t*, std::basic_string&) const; private: @@ -175,7 +175,7 @@ IconvStringConverter::getDescriptors() const return descriptorHolder.descriptor; } -template Ice::Byte* +template std::uint8_t* IconvStringConverter::toUTF8(const charT* sourceStart, const charT* sourceEnd, Ice::UTF8Buffer& buf) const @@ -208,7 +208,7 @@ IconvStringConverter::toUTF8(const charT* sourceStart, { size_t howMany = std::max(inbytesleft, size_t(4)); outbuf = reinterpret_cast(buf.getMoreBytes(howMany, - reinterpret_cast(outbuf))); + reinterpret_cast(outbuf))); count = iconv(cd, &inbuf, &inbytesleft, &outbuf, &howMany); } while(count == size_t(-1) && errno == E2BIG); @@ -217,11 +217,11 @@ IconvStringConverter::toUTF8(const charT* sourceStart, throw Ice::IllegalConversionException(__FILE__, __LINE__, errno == 0 ? "Unknown error" : IceUtilInternal::errorToString(errno)); } - return reinterpret_cast(outbuf); + return reinterpret_cast(outbuf); } template void -IconvStringConverter::fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd, +IconvStringConverter::fromUTF8(const std::uint8_t* sourceStart, const std::uint8_t* sourceEnd, std::basic_string& target) const { iconv_t cd = getDescriptors().first; @@ -239,7 +239,7 @@ IconvStringConverter::fromUTF8(const Ice::Byte* sourceStart, const Ice::B #ifdef ICE_CONST_ICONV_INBUF const char* inbuf = reinterpret_cast(sourceStart); #else - char* inbuf = reinterpret_cast(const_cast(sourceStart)); + char* inbuf = reinterpret_cast(const_cast(sourceStart)); #endif assert(sourceEnd > sourceStart); size_t inbytesleft = static_cast(sourceEnd - sourceStart); diff --git a/cpp/include/Ice/Incoming.h b/cpp/include/Ice/Incoming.h index f1dfa53fa79..e473f935413 100644 --- a/cpp/include/Ice/Incoming.h +++ b/cpp/include/Ice/Incoming.h @@ -67,7 +67,7 @@ class ICE_API IncomingBase Ice::OutputStream* startWriteParams(); void endWriteParams(); void writeEmptyParams(); - void writeParamEncaps(const Ice::Byte*, std::int32_t, bool); + void writeParamEncaps(const std::uint8_t*, std::int32_t, bool); void setMarshaledResult(const Ice::MarshaledResult&); void response(bool); @@ -75,7 +75,7 @@ class ICE_API IncomingBase protected: - IncomingBase(Instance*, ResponseHandler*, Ice::Connection*, const Ice::ObjectAdapterPtr&, bool, Ice::Byte, std::int32_t); + IncomingBase(Instance*, ResponseHandler*, Ice::Connection*, const Ice::ObjectAdapterPtr&, bool, std::uint8_t, std::int32_t); IncomingBase(IncomingBase&); IncomingBase(const IncomingBase&) = delete; @@ -92,7 +92,7 @@ class ICE_API IncomingBase ::std::shared_ptr _cookie; DispatchObserver _observer; bool _response; - Ice::Byte _compress; + std::uint8_t _compress; Ice::FormatType _format; Ice::OutputStream _os; @@ -110,7 +110,7 @@ class ICE_API Incoming final : public IncomingBase { public: - Incoming(Instance*, ResponseHandler*, Ice::Connection*, const Ice::ObjectAdapterPtr&, bool, Ice::Byte, std::int32_t); + Incoming(Instance*, ResponseHandler*, Ice::Connection*, const Ice::ObjectAdapterPtr&, bool, std::uint8_t, std::int32_t); const Ice::Current& getCurrent() { @@ -157,7 +157,7 @@ class ICE_API Incoming final : public IncomingBase { _current.encoding = _is->skipEmptyEncapsulation(); } - void readParamEncaps(const Ice::Byte*& v, std::int32_t& sz) + void readParamEncaps(const std::uint8_t*& v, std::int32_t& sz) { _current.encoding = _is->readEncapsulation(v, sz); } @@ -167,7 +167,7 @@ class ICE_API Incoming final : public IncomingBase friend class IncomingAsync; Ice::InputStream* _is; - Ice::Byte* _inParamPos; + std::uint8_t* _inParamPos; IncomingAsyncPtr _inAsync; }; diff --git a/cpp/include/Ice/InputStream.h b/cpp/include/Ice/InputStream.h index 658f399f231..20db296c805 100644 --- a/cpp/include/Ice/InputStream.h +++ b/cpp/include/Ice/InputStream.h @@ -70,7 +70,7 @@ class ICE_API InputStream : public IceInternal::Buffer * You can supply a communicator later by calling initialize(). * @param bytes The encoded data. */ - InputStream(const std::vector& bytes); + InputStream(const std::vector& bytes); /** * Constructs a stream using the latest encoding version but without a communicator. @@ -79,7 +79,7 @@ class ICE_API InputStream : public IceInternal::Buffer * You can supply a communicator later by calling initialize(). * @param bytes The encoded data. */ - InputStream(const std::pair& bytes); + InputStream(const std::pair& bytes); /// \cond INTERNAL InputStream(IceInternal::Buffer&, bool = false); @@ -96,14 +96,14 @@ class ICE_API InputStream : public IceInternal::Buffer * @param communicator The communicator to use for unmarshaling tasks. * @param bytes The encoded data. */ - InputStream(const CommunicatorPtr& communicator, const std::vector& bytes); + InputStream(const CommunicatorPtr& communicator, const std::vector& bytes); /** * Constructs a stream using the communicator's default encoding version. * @param communicator The communicator to use for unmarshaling tasks. * @param bytes The encoded data. */ - InputStream(const CommunicatorPtr& communicator, const std::pair& bytes); + InputStream(const CommunicatorPtr& communicator, const std::pair& bytes); /// \cond INTERNAL InputStream(const CommunicatorPtr& communicator, IceInternal::Buffer&, bool = false); @@ -126,7 +126,7 @@ class ICE_API InputStream : public IceInternal::Buffer * @param version The encoding version used to encode the data to be unmarshaled. * @param bytes The encoded data. */ - InputStream(const EncodingVersion& version, const std::vector& bytes); + InputStream(const EncodingVersion& version, const std::vector& bytes); /** * Constructs a stream using the given encoding version but without a communicator. @@ -136,7 +136,7 @@ class ICE_API InputStream : public IceInternal::Buffer * @param version The encoding version used to encode the data to be unmarshaled. * @param bytes The encoded data. */ - InputStream(const EncodingVersion& version, const std::pair& bytes); + InputStream(const EncodingVersion& version, const std::pair& bytes); /// \cond INTERNAL InputStream(const EncodingVersion&, IceInternal::Buffer&, bool = false); @@ -155,7 +155,7 @@ class ICE_API InputStream : public IceInternal::Buffer * @param version The encoding version used to encode the data to be unmarshaled. * @param bytes The encoded data. */ - InputStream(const CommunicatorPtr& communicator, const EncodingVersion& version, const std::vector& bytes); + InputStream(const CommunicatorPtr& communicator, const EncodingVersion& version, const std::vector& bytes); /** * Constructs a stream using the given communicator and encoding version. @@ -164,7 +164,7 @@ class ICE_API InputStream : public IceInternal::Buffer * @param bytes The encoded data. */ InputStream(const CommunicatorPtr& communicator, const EncodingVersion& version, - const std::pair& bytes); + const std::pair& bytes); /// \cond INTERNAL InputStream(const CommunicatorPtr&, const EncodingVersion&, IceInternal::Buffer&, bool = false); @@ -475,7 +475,7 @@ class ICE_API InputStream : public IceInternal::Buffer * @param sz The number of bytes in the encapsulation. * @return encoding The encapsulation's encoding version. */ - EncodingVersion readEncapsulation(const Byte*& v, std::int32_t& sz) + EncodingVersion readEncapsulation(const std::uint8_t*& v, std::int32_t& sz) { EncodingVersion encoding; v = i; @@ -561,7 +561,7 @@ class ICE_API InputStream : public IceInternal::Buffer */ std::int32_t readSize() // Inlined for performance reasons. { - Byte byte; + std::uint8_t byte; read(byte); unsigned char val = static_cast(byte); if(val == 255) @@ -594,7 +594,7 @@ class ICE_API InputStream : public IceInternal::Buffer * @param bytes The vector to hold a copy of the bytes from the marshaling buffer. * @param sz The number of bytes to read. */ - void readBlob(std::vector& bytes, std::int32_t sz); + void readBlob(std::vector& bytes, std::int32_t sz); /** * Reads a blob of bytes from the stream. @@ -602,7 +602,7 @@ class ICE_API InputStream : public IceInternal::Buffer * @param v A pointer into the internal marshaling buffer representing the start of the blob. * @param sz The number of bytes to read. */ - void readBlob(const Byte*& v, Container::size_type sz) + void readBlob(const std::uint8_t*& v, Container::size_type sz) { if(sz > 0) { @@ -753,7 +753,7 @@ class ICE_API InputStream : public IceInternal::Buffer * Reads a byte from the stream. * @param v The extracted byte. */ - void read(Byte& v) + void read(std::uint8_t& v) { if(i >= b.end()) { @@ -766,14 +766,14 @@ class ICE_API InputStream : public IceInternal::Buffer * Reads a sequence of bytes from the stream. * @param v A vector to hold a copy of the bytes. */ - void read(std::vector& v); + void read(std::vector& v); /** * Reads a sequence of bytes from the stream. * @param v A pair of pointers into the internal marshaling buffer representing the start and end of the * sequence elements. */ - void read(std::pair& v); + void read(std::pair& v); /** * Reads a bool from the stream. @@ -830,16 +830,16 @@ class ICE_API InputStream : public IceInternal::Buffer { throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); } - const Byte* src = &(*i); + const std::uint8_t* src = &(*i); i += sizeof(std::int32_t); #ifdef ICE_BIG_ENDIAN - Byte* dest = reinterpret_cast(&v) + sizeof(std::int32_t) - 1; + std::uint8_t* dest = reinterpret_cast(&v) + sizeof(std::int32_t) - 1; *dest-- = *src++; *dest-- = *src++; *dest-- = *src++; *dest = *src; #else - Byte* dest = reinterpret_cast(&v); + std::uint8_t* dest = reinterpret_cast(&v); *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; @@ -1035,7 +1035,7 @@ class ICE_API InputStream : public IceInternal::Buffer */ void skipSize() { - Byte bt; + std::uint8_t bt; read(bt); if(static_cast(bt) == 255) { @@ -1276,7 +1276,7 @@ class ICE_API InputStream : public IceInternal::Buffer IndexListList indirectionTables; // Slice attributes - Byte sliceFlags; + std::uint8_t sliceFlags; std::int32_t sliceSize; std::string typeId; int compactId; diff --git a/cpp/include/Ice/Object.h b/cpp/include/Ice/Object.h index ead1434fb6d..5cccfb592f4 100644 --- a/cpp/include/Ice/Object.h +++ b/cpp/include/Ice/Object.h @@ -148,7 +148,7 @@ class ICE_API Blobject : public virtual Object * @throws UserException A user exception can be raised directly and the * run time will marshal it. */ - virtual bool ice_invoke(std::vector inEncaps, std::vector& outEncaps, const Current& current) = 0; + virtual bool ice_invoke(std::vector inEncaps, std::vector& outEncaps, const Current& current) = 0; /// \cond INTERNAL virtual bool _iceDispatch(IceInternal::Incoming&, const Current&); @@ -176,7 +176,7 @@ class ICE_API BlobjectArray : public virtual Object * @throws UserException A user exception can be raised directly and the * run time will marshal it. */ - virtual bool ice_invoke(std::pair inEncaps, std::vector& outEncaps, + virtual bool ice_invoke(std::pair inEncaps, std::vector& outEncaps, const Current& current) = 0; /// \cond INTERNAL @@ -206,8 +206,8 @@ class ICE_API BlobjectAsync : public virtual Object * @throws UserException A user exception can be raised directly and the * run time will marshal it. */ - virtual void ice_invokeAsync(std::vector inEncaps, - std::function&)> response, + virtual void ice_invokeAsync(std::vector inEncaps, + std::function&)> response, std::function error, const Current& current) = 0; @@ -238,8 +238,8 @@ class ICE_API BlobjectArrayAsync : public virtual Object * @throws UserException A user exception can be raised directly and the * run time will marshal it. */ - virtual void ice_invokeAsync(std::pair inEncaps, - std::function&)> response, + virtual void ice_invokeAsync(std::pair inEncaps, + std::function&)> response, std::function error, const Current& current) = 0; /// \cond INTERNAL diff --git a/cpp/include/Ice/OutgoingAsync.h b/cpp/include/Ice/OutgoingAsync.h index f486267fec5..b405a8a2507 100644 --- a/cpp/include/Ice/OutgoingAsync.h +++ b/cpp/include/Ice/OutgoingAsync.h @@ -224,7 +224,7 @@ class ICE_API OutgoingAsync : public ProxyOutgoingAsyncBase { _os.writeEmptyEncapsulation(_encoding); } - void writeParamEncaps(const ::Ice::Byte* encaps, std::int32_t size) + void writeParamEncaps(const ::std::uint8_t* encaps, std::int32_t size) { if(size == 0) { diff --git a/cpp/include/Ice/OutputStream.h b/cpp/include/Ice/OutputStream.h index 0a5a10aeddc..a265aeb2f24 100644 --- a/cpp/include/Ice/OutputStream.h +++ b/cpp/include/Ice/OutputStream.h @@ -57,7 +57,7 @@ class ICE_API OutputStream : public IceInternal::Buffer * stream will reallocate if the size of the marshaled data exceeds the application's buffer. */ OutputStream(const CommunicatorPtr& communicator, const EncodingVersion& version, - const std::pair& bytes); + const std::pair& bytes); ~OutputStream() { @@ -252,7 +252,7 @@ class ICE_API OutputStream : public IceInternal::Buffer * @param v The start of the buffer. * @param sz The number of bytes to copy. */ - void writeEncapsulation(const Byte* v, std::int32_t sz) + void writeEncapsulation(const std::uint8_t* v, std::int32_t sz) { if(sz < 6) { @@ -313,12 +313,12 @@ class ICE_API OutputStream : public IceInternal::Buffer assert(v >= 0); if(v > 254) { - write(Byte(255)); + write(std::uint8_t(255)); write(v); } else { - write(static_cast(v)); + write(static_cast(v)); } } @@ -333,12 +333,12 @@ class ICE_API OutputStream : public IceInternal::Buffer assert(v >= 0); if(v > 254) { - *dest++ = Byte(255); + *dest++ = std::uint8_t(255); write(v, dest); } else { - *dest = static_cast(v); + *dest = static_cast(v); } } @@ -369,14 +369,14 @@ class ICE_API OutputStream : public IceInternal::Buffer * Copies the specified blob of bytes to the stream without modification. * @param v The bytes to be copied. */ - void writeBlob(const std::vector& v); + void writeBlob(const std::vector& v); /** * Copies the specified blob of bytes to the stream without modification. * @param v The start of the buffer to be copied. * @param sz The number of bytes to be copied. */ - void writeBlob(const Byte* v, Container::size_type sz) + void writeBlob(const std::uint8_t* v, Container::size_type sz) { if(sz > 0) { @@ -551,7 +551,7 @@ class ICE_API OutputStream : public IceInternal::Buffer * Writes a byte to the stream. * @param v The byte to write. */ - void write(Byte v) + void write(std::uint8_t v) { b.push_back(v); } @@ -561,7 +561,7 @@ class ICE_API OutputStream : public IceInternal::Buffer * @param start The beginning of the sequence. * @param end The end of the sequence. */ - void write(const Byte* start, const Byte* end); + void write(const std::uint8_t* start, const std::uint8_t* end); /** * Writes a boolean to the stream. @@ -569,7 +569,7 @@ class ICE_API OutputStream : public IceInternal::Buffer */ void write(bool v) { - b.push_back(static_cast(v)); + b.push_back(static_cast(v)); } /** @@ -618,13 +618,13 @@ class ICE_API OutputStream : public IceInternal::Buffer void write(std::int32_t v, Container::iterator dest) { #ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast(&v) + sizeof(std::) - 1; + const std::uint8_t* src = reinterpret_cast(&v) + sizeof(std::) - 1; *dest++ = *src--; *dest++ = *src--; *dest++ = *src--; *dest = *src; #else - const Byte* src = reinterpret_cast(&v); + const std::uint8_t* src = reinterpret_cast(&v); *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; @@ -852,14 +852,14 @@ class ICE_API OutputStream : public IceInternal::Buffer * Indicates that marshaling is complete. This function must only be called once. * @param v Filled with a copy of the encoded data. */ - void finished(std::vector& v); + void finished(std::vector& v); /** * Indicates that marshaling is complete. This function must only be called once. * @return A pair of pointers into the internal marshaling buffer. These pointers are * valid for the lifetime of the stream. */ - std::pair finished(); + std::pair finished(); /// \cond INTERNAL OutputStream(IceInternal::Instance*, const EncodingVersion&); @@ -1028,7 +1028,7 @@ class ICE_API OutputStream : public IceInternal::Buffer bool firstSlice; // Slice attributes - Byte sliceFlags; + std::uint8_t sliceFlags; Container::size_type writeSlice; // Position of the slice data members Container::size_type sliceFlagsPos; // Position of the slice flags PtrToIndexMap indirectionMap; diff --git a/cpp/include/Ice/Protocol.h b/cpp/include/Ice/Protocol.h index 61306f44320..2c85eda7c25 100644 --- a/cpp/include/Ice/Protocol.h +++ b/cpp/include/Ice/Protocol.h @@ -15,12 +15,12 @@ namespace IceInternal // Size of the Ice protocol header // // Magic number (4 Bytes) -// Protocol version major (Byte) -// Protocol version minor (Byte) -// Encoding version major (Byte) -// Encoding version minor (Byte) -// Message type (Byte) -// Compression status (Byte) +// Protocol version major (std::uint8_t) +// Protocol version minor (std::uint8_t) +// Encoding version major (std::uint8_t) +// Encoding version minor (std::uint8_t) +// Message type (std::uint8_t) +// Compression status (std::uint8_t) // Message size (Int) // const ::std::int32_t headerSize = 14; @@ -28,34 +28,34 @@ const ::std::int32_t headerSize = 14; // // The magic number at the front of each message // -extern const ::Ice::Byte magic[4]; +extern const ::std::uint8_t magic[4]; // // The current Ice protocol, protocol encoding and encoding version // -const ::Ice::Byte protocolMajor = 1; -const ::Ice::Byte protocolMinor = 0; -const ::Ice::Byte protocolEncodingMajor = 1; -const ::Ice::Byte protocolEncodingMinor = 0; +const ::std::uint8_t protocolMajor = 1; +const ::std::uint8_t protocolMinor = 0; +const ::std::uint8_t protocolEncodingMajor = 1; +const ::std::uint8_t protocolEncodingMinor = 0; -const ::Ice::Byte encodingMajor = 1; -const ::Ice::Byte encodingMinor = 1; +const ::std::uint8_t encodingMajor = 1; +const ::std::uint8_t encodingMinor = 1; // // The Ice protocol message types // -const ::Ice::Byte requestMsg = 0; -const ::Ice::Byte requestBatchMsg = 1; -const ::Ice::Byte replyMsg = 2; -const ::Ice::Byte validateConnectionMsg = 3; -const ::Ice::Byte closeConnectionMsg = 4; +const ::std::uint8_t requestMsg = 0; +const ::std::uint8_t requestBatchMsg = 1; +const ::std::uint8_t replyMsg = 2; +const ::std::uint8_t validateConnectionMsg = 3; +const ::std::uint8_t closeConnectionMsg = 4; // // The request header, batch request header and reply header. // -extern const ::Ice::Byte requestHdr[headerSize + sizeof(std::int32_t)]; -extern const ::Ice::Byte requestBatchHdr[headerSize + sizeof(std::int32_t)]; -extern const ::Ice::Byte replyHdr[headerSize]; +extern const ::std::uint8_t requestHdr[headerSize + sizeof(std::int32_t)]; +extern const ::std::uint8_t requestBatchHdr[headerSize + sizeof(std::int32_t)]; +extern const ::std::uint8_t replyHdr[headerSize]; // // IPv4/IPv6 support enumeration. @@ -67,7 +67,7 @@ enum ProtocolSupport EnableBoth }; -ICE_API void stringToMajorMinor(const ::std::string&, Ice::Byte&, Ice::Byte&); +ICE_API void stringToMajorMinor(const ::std::string&, std::uint8_t&, std::uint8_t&); template std::string versionToString(const T& v) @@ -96,15 +96,15 @@ ICE_API void throwUnsupportedProtocolException(const char*, int, const Ice::Prot ICE_API void throwUnsupportedEncodingException(const char*, int, const Ice::EncodingVersion&, const Ice::EncodingVersion&); -const ::Ice::Byte OPTIONAL_END_MARKER = 0xFF; +const ::std::uint8_t OPTIONAL_END_MARKER = 0xFF; -const ::Ice::Byte FLAG_HAS_TYPE_ID_STRING = (1<<0); -const ::Ice::Byte FLAG_HAS_TYPE_ID_INDEX = (1<<1); -const ::Ice::Byte FLAG_HAS_TYPE_ID_COMPACT = (1<<0) | (1<<1); -const ::Ice::Byte FLAG_HAS_OPTIONAL_MEMBERS = (1<<2); -const ::Ice::Byte FLAG_HAS_INDIRECTION_TABLE = (1<<3); -const ::Ice::Byte FLAG_HAS_SLICE_SIZE = (1<<4); -const ::Ice::Byte FLAG_IS_LAST_SLICE = (1<<5); +const ::std::uint8_t FLAG_HAS_TYPE_ID_STRING = (1<<0); +const ::std::uint8_t FLAG_HAS_TYPE_ID_INDEX = (1<<1); +const ::std::uint8_t FLAG_HAS_TYPE_ID_COMPACT = (1<<0) | (1<<1); +const ::std::uint8_t FLAG_HAS_OPTIONAL_MEMBERS = (1<<2); +const ::std::uint8_t FLAG_HAS_INDIRECTION_TABLE = (1<<3); +const ::std::uint8_t FLAG_HAS_SLICE_SIZE = (1<<4); +const ::std::uint8_t FLAG_IS_LAST_SLICE = (1<<5); } diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h index 06a8303c9b8..e64ea8bcf43 100644 --- a/cpp/include/Ice/Proxy.h +++ b/cpp/include/Ice/Proxy.h @@ -483,8 +483,8 @@ class ICE_API ObjectPrx : public Proxy bool ice_invoke(std::string_view operation, Ice::OperationMode mode, - const std::vector& inParams, - std::vector& outParams, + const std::vector& inParams, + std::vector& outParams, const Ice::Context& context = Ice::noExplicitContext) const; /** @@ -495,10 +495,10 @@ class ICE_API ObjectPrx : public Proxy * @param context The context map for the invocation. * @return The future object for the invocation. */ - std::future>> - ice_invokeAsync(std::string_view operation, + std::future>> + ice_invokeAsync(const std::string& operation, Ice::OperationMode mode, - const std::vector& inParams, + const std::vector& inParams, const Ice::Context& context = Ice::noExplicitContext) const; /** @@ -515,8 +515,8 @@ class ICE_API ObjectPrx : public Proxy std::function ice_invokeAsync(std::string_view operation, Ice::OperationMode mode, - const std::vector& inParams, - std::function)> response, + const std::vector& inParams, + std::function)> response, std::function ex = nullptr, std::function sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const; @@ -536,8 +536,8 @@ class ICE_API ObjectPrx : public Proxy bool ice_invoke(std::string_view operation, Ice::OperationMode mode, - const std::pair& inParams, - std::vector& outParams, + const std::pair& inParams, + std::vector& outParams, const Ice::Context& context = Ice::noExplicitContext) const; /** @@ -548,10 +548,10 @@ class ICE_API ObjectPrx : public Proxy * @param context The context map for the invocation. * @return The future object for the invocation. */ - std::future>> - ice_invokeAsync(std::string_view operation, + std::future>> + ice_invokeAsync(const std::string& operation, Ice::OperationMode mode, - const std::pair& inParams, + const std::pair& inParams, const Ice::Context& context = Ice::noExplicitContext) const; /** @@ -568,8 +568,8 @@ class ICE_API ObjectPrx : public Proxy std::function ice_invokeAsync(std::string_view operation, Ice::OperationMode mode, - const std::pair& inParams, - std::function)> response, + const std::pair& inParams, + std::function)> response, std::function ex = nullptr, std::function sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const; diff --git a/cpp/include/Ice/SlicedData.h b/cpp/include/Ice/SlicedData.h index 4b6c2d5133e..c82a17489b1 100644 --- a/cpp/include/Ice/SlicedData.h +++ b/cpp/include/Ice/SlicedData.h @@ -30,7 +30,7 @@ struct ICE_API SliceInfo /** * The encoded bytes for this slice, including the leading size integer. */ - std::vector bytes; + std::vector bytes; /** * The class instances referenced by this slice. diff --git a/cpp/include/IceSSL/Plugin.h b/cpp/include/IceSSL/Plugin.h index 6b79c6fd727..15e195de26b 100644 --- a/cpp/include/IceSSL/Plugin.h +++ b/cpp/include/IceSSL/Plugin.h @@ -349,7 +349,7 @@ class ICESSL_API X509Extension * Obtains the data associated with this extension. * @return The extension data. */ - virtual std::vector getData() const = 0; + virtual std::vector getData() const = 0; }; using X509ExtensionPtr = std::shared_ptr; @@ -379,13 +379,13 @@ class ICESSL_API Certificate : public std::enable_shared_from_this * Obtains the authority key identifier. * @return The identifier. */ - virtual std::vector getAuthorityKeyIdentifier() const = 0; + virtual std::vector getAuthorityKeyIdentifier() const = 0; /** * Obtains the subject key identifier. * @return The identifier. */ - virtual std::vector getSubjectKeyIdentifier() const = 0; + virtual std::vector getSubjectKeyIdentifier() const = 0; /** * Verifies that this certificate was signed by the given certificate diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h index 6fb992d3dac..cbbd06c4aa2 100644 --- a/cpp/include/IceUtil/Config.h +++ b/cpp/include/IceUtil/Config.h @@ -221,8 +221,6 @@ class ICE_API noncopyable const noncopyable& operator=(const noncopyable&); }; -typedef unsigned char Byte; - // // Int64 typedef and ICE_INT64 macro for Int64 literal values // diff --git a/cpp/include/IceUtil/StringConverter.h b/cpp/include/IceUtil/StringConverter.h index 3bb01f38d1d..c1a07885fa8 100644 --- a/cpp/include/IceUtil/StringConverter.h +++ b/cpp/include/IceUtil/StringConverter.h @@ -29,7 +29,7 @@ class ICE_API UTF8Buffer * @param firstUnused A pointer to the first unused byte. * @return A pointer to the beginning of the buffer. */ - virtual Byte* getMoreBytes(size_t howMany, Byte* firstUnused) = 0; + virtual std::uint8_t* getMoreBytes(size_t howMany, std::uint8_t* firstUnused) = 0; virtual ~UTF8Buffer(); }; @@ -50,12 +50,12 @@ class BasicStringConverter * Returns a pointer to byte after the last written byte (which may be * past the last byte returned by getMoreBytes). */ - virtual Byte* toUTF8(const charT* sourceStart, const charT* sourceEnd, UTF8Buffer& buf) const = 0; + virtual std::uint8_t* toUTF8(const charT* sourceStart, const charT* sourceEnd, UTF8Buffer& buf) const = 0; /** * Unmarshals a UTF-8 sequence into a basic_string. */ - virtual void fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, std::basic_string& target) const = 0; + virtual void fromUTF8(const std::uint8_t* sourceStart, const std::uint8_t* sourceEnd, std::basic_string& target) const = 0; virtual ~BasicStringConverter() { @@ -163,13 +163,13 @@ namespace IceUtilInternal // // Convert from UTF-8 to UTF-16/32 // -ICE_API std::vector toUTF16(const std::vector&); -ICE_API std::vector toUTF32(const std::vector&); +ICE_API std::vector toUTF16(const std::vector&); +ICE_API std::vector toUTF32(const std::vector&); // // Convert from UTF-32 to UTF-8 // -ICE_API std::vector fromUTF32(const std::vector&); +ICE_API std::vector fromUTF32(const std::vector&); } diff --git a/cpp/src/Glacier2/Blobject.cpp b/cpp/src/Glacier2/Blobject.cpp index 59f29f66291..cdccd8a9459 100644 --- a/cpp/src/Glacier2/Blobject.cpp +++ b/cpp/src/Glacier2/Blobject.cpp @@ -67,8 +67,8 @@ Glacier2::Blobject::updateObserver(const shared_ptr& inParams, - function&)> response, + const std::pair& inParams, + function&)> response, function exception, const Current& current) { @@ -252,7 +252,7 @@ Glacier2::Blobject::invoke(ObjectPrx& proxy, try { - function)> amiResponse = nullptr; + function)> amiResponse = nullptr; function amiSent = nullptr; if(proxy->ice_isTwoway()) diff --git a/cpp/src/Glacier2/Blobject.h b/cpp/src/Glacier2/Blobject.h index 2c0133f2695..fbfaa5c8433 100644 --- a/cpp/src/Glacier2/Blobject.h +++ b/cpp/src/Glacier2/Blobject.h @@ -27,8 +27,8 @@ class Blobject : public Ice::BlobjectArrayAsync, public std::enable_shared_from_ protected: void invoke(Ice::ObjectPrx&, - const std::pair&, - std::function&)>, + const std::pair&, + std::function&)>, std::function, const Ice::Current&); diff --git a/cpp/src/Glacier2/ClientBlobject.cpp b/cpp/src/Glacier2/ClientBlobject.cpp index f08f01cfed0..f4fe3838e01 100644 --- a/cpp/src/Glacier2/ClientBlobject.cpp +++ b/cpp/src/Glacier2/ClientBlobject.cpp @@ -24,8 +24,8 @@ Glacier2::ClientBlobject::ClientBlobject(shared_ptrinstance, } void -Glacier2::ClientBlobject::ice_invokeAsync(pair inParams, - function&)> response, +Glacier2::ClientBlobject::ice_invokeAsync(pair inParams, + function&)> response, function error, const Current& current) { diff --git a/cpp/src/Glacier2/ClientBlobject.h b/cpp/src/Glacier2/ClientBlobject.h index f098e1cd62a..cba6c459e7b 100644 --- a/cpp/src/Glacier2/ClientBlobject.h +++ b/cpp/src/Glacier2/ClientBlobject.h @@ -21,8 +21,8 @@ class ClientBlobject final : public Glacier2::Blobject ClientBlobject(std::shared_ptr, std::shared_ptr, const Ice::Context&, std::shared_ptr); - void ice_invokeAsync(std::pair inEncaps, - std::function&)> response, + void ice_invokeAsync(std::pair inEncaps, + std::function&)> response, std::function error, const Ice::Current& current) override; diff --git a/cpp/src/Glacier2/RequestQueue.cpp b/cpp/src/Glacier2/RequestQueue.cpp index 1cc829f296c..9d6e3d2db76 100644 --- a/cpp/src/Glacier2/RequestQueue.cpp +++ b/cpp/src/Glacier2/RequestQueue.cpp @@ -10,9 +10,9 @@ using namespace std; using namespace Ice; using namespace Glacier2; -Glacier2::Request::Request(ObjectPrxPtr proxy, const std::pair& inParams, +Glacier2::Request::Request(ObjectPrxPtr proxy, const std::pair& inParams, const Current& current, bool forwardContext, const Ice::Context& sslContext, - function)> response, + function)> response, function exception) : _proxy(std::move(proxy)), _inParams(inParams.first, inParams.second), @@ -30,11 +30,11 @@ Glacier2::Request::Request(ObjectPrxPtr proxy, const std::pair)>&& response, +Glacier2::Request::invoke(function)>&& response, function&& exception, std::function&& sent) { - pair inPair; + pair inPair; if(_inParams.size() == 0) { inPair.first = inPair.second = nullptr; @@ -110,7 +110,7 @@ Glacier2::Request::override(const shared_ptr& other) const } void -Glacier2::Request::response(bool ok, const pair& outParams) +Glacier2::Request::response(bool ok, const pair& outParams) { assert(_proxy->ice_isTwoway()); _response(ok, outParams); @@ -216,7 +216,7 @@ Glacier2::RequestQueue::flushRequests() } auto self = shared_from_this(); request->invoke( - [self, request](bool ok, const pair& outParams) + [self, request](bool ok, const pair& outParams) { self->response(ok, outParams, request); }, @@ -266,7 +266,7 @@ Glacier2::RequestQueue::flush() auto request = *p; request->invoke( - [self, request](bool ok, const pair& outParams) + [self, request](bool ok, const pair& outParams) { self->response(ok, outParams, request); }, @@ -302,7 +302,7 @@ Glacier2::RequestQueue::flush() } void -Glacier2::RequestQueue::response(bool ok, const pair& outParams, const shared_ptr& request) +Glacier2::RequestQueue::response(bool ok, const pair& outParams, const shared_ptr& request) { assert(request); request->response(ok, outParams); diff --git a/cpp/src/Glacier2/RequestQueue.h b/cpp/src/Glacier2/RequestQueue.h index e64aadf79c5..8a7d79cbf42 100644 --- a/cpp/src/Glacier2/RequestQueue.h +++ b/cpp/src/Glacier2/RequestQueue.h @@ -24,14 +24,14 @@ class Request public: Request(Ice::ObjectPrxPtr, - const std::pair&, + const std::pair&, const Ice::Current&, bool, const Ice::Context&, - std::function)>, + std::function)>, std::function); - void invoke(std::function)>&&, + void invoke(std::function)>&&, std::function&&, std::function&& = nullptr); bool override(const std::shared_ptr&) const; @@ -40,7 +40,7 @@ class Request private: friend class RequestQueue; - void response(bool, const std::pair&); + void response(bool, const std::pair&); void exception(std::exception_ptr); void queued(); @@ -50,7 +50,7 @@ class Request const bool _forwardContext; const Ice::Context _sslContext; const std::string _override; - std::function&)> _response; + std::function&)> _response; std::function _exception; }; @@ -71,7 +71,7 @@ class RequestQueue : public std::enable_shared_from_this void flush(); - void response(bool, const std::pair&, const std::shared_ptr&); + void response(bool, const std::pair&, const std::shared_ptr&); void exception(std::exception_ptr, const std::shared_ptr&); void sent(bool, const std::shared_ptr&); diff --git a/cpp/src/Glacier2/ServerBlobject.cpp b/cpp/src/Glacier2/ServerBlobject.cpp index 26cd1609c92..83dd57b7b00 100644 --- a/cpp/src/Glacier2/ServerBlobject.cpp +++ b/cpp/src/Glacier2/ServerBlobject.cpp @@ -14,8 +14,8 @@ Glacier2::ServerBlobject::ServerBlobject(shared_ptr instance, shared_p } void -Glacier2::ServerBlobject::ice_invokeAsync(pair inParams, - function&)> response, +Glacier2::ServerBlobject::ice_invokeAsync(pair inParams, + function&)> response, function error, const Current& current) { diff --git a/cpp/src/Glacier2/ServerBlobject.h b/cpp/src/Glacier2/ServerBlobject.h index 807cf76768a..b525e70580f 100644 --- a/cpp/src/Glacier2/ServerBlobject.h +++ b/cpp/src/Glacier2/ServerBlobject.h @@ -16,8 +16,8 @@ class ServerBlobject final : public Glacier2::Blobject ServerBlobject(std::shared_ptr, std::shared_ptr); - void ice_invokeAsync(std::pair inEncaps, - std::function&)> response, + void ice_invokeAsync(std::pair inEncaps, + std::function&)> response, std::function error, const Ice::Current& current) override; }; diff --git a/cpp/src/Ice/BatchRequestQueue.cpp b/cpp/src/Ice/BatchRequestQueue.cpp index 793694b208a..55e95eb16fc 100644 --- a/cpp/src/Ice/BatchRequestQueue.cpp +++ b/cpp/src/Ice/BatchRequestQueue.cpp @@ -160,10 +160,10 @@ BatchRequestQueue::swap(OutputStream* os, bool& compress) _conditionVariable.wait(lock, [this] { return !_batchStreamInUse || _batchStreamCanFlush; }); - vector lastRequest; + vector lastRequest; if(_batchMarker < _batchStream.b.size()) { - vector(_batchStream.b.begin() + _batchMarker, _batchStream.b.end()).swap(lastRequest); + vector(_batchStream.b.begin() + _batchMarker, _batchStream.b.end()).swap(lastRequest); _batchStream.b.resize(_batchMarker); } diff --git a/cpp/src/Ice/CollocatedRequestHandler.cpp b/cpp/src/Ice/CollocatedRequestHandler.cpp index 1679d09c25e..fca1533034c 100644 --- a/cpp/src/Ice/CollocatedRequestHandler.cpp +++ b/cpp/src/Ice/CollocatedRequestHandler.cpp @@ -52,7 +52,7 @@ class InvokeAllAsync final : public DispatchWorkItem void fillInValue(OutputStream* os, int pos, int32_t value) { - const Byte* p = reinterpret_cast(&value); + const uint8_t* p = reinterpret_cast(&value); #ifdef ICE_BIG_ENDIAN reverse_copy(p, p + sizeof(std::int32_t), os->b.begin() + pos); #else @@ -191,7 +191,7 @@ CollocatedRequestHandler::invokeAsyncRequest(OutgoingAsyncBase* outAsync, int ba } void -CollocatedRequestHandler::sendResponse(int32_t requestId, OutputStream* os, Byte, bool amd) +CollocatedRequestHandler::sendResponse(int32_t requestId, OutputStream* os, uint8_t, bool amd) { OutgoingAsyncBasePtr outAsync; { diff --git a/cpp/src/Ice/CollocatedRequestHandler.h b/cpp/src/Ice/CollocatedRequestHandler.h index 745ce0dd261..af375c3e080 100644 --- a/cpp/src/Ice/CollocatedRequestHandler.h +++ b/cpp/src/Ice/CollocatedRequestHandler.h @@ -39,7 +39,7 @@ class CollocatedRequestHandler : public RequestHandler, public ResponseHandler virtual void asyncRequestCanceled(const OutgoingAsyncBasePtr&, std::exception_ptr); - virtual void sendResponse(std::int32_t, Ice::OutputStream*, Ice::Byte, bool); + virtual void sendResponse(std::int32_t, Ice::OutputStream*, std::uint8_t, bool); virtual void sendNoResponse(); virtual bool systemException(std::int32_t, std::exception_ptr, bool); virtual void invokeException(std::int32_t, std::exception_ptr, int, bool); diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index de0af94a383..d804f2f5e0e 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -61,7 +61,7 @@ class DispatchCall final : public DispatchWorkItem const ConnectionIPtr& connection, function connectionStartCompleted, const vector& sentCBs, - Byte compress, + uint8_t compress, int32_t requestId, int32_t invokeNum, const ServantManagerPtr& servantManager, @@ -96,7 +96,7 @@ class DispatchCall final : public DispatchWorkItem const ConnectionIPtr _connection; const function _connectionStartCompleted; const vector _sentCBs; - const Byte _compress; + const uint8_t _compress; const int32_t _requestId; const int32_t _invokeNum; const ServantManagerPtr _servantManager; @@ -722,7 +722,7 @@ Ice::ConnectionI::sendAsyncRequest(const OutgoingAsyncBasePtr& out, bool compres // // Fill in the request ID. // - const Byte* p = reinterpret_cast(&requestId); + const uint8_t* p = reinterpret_cast(&requestId); #ifdef ICE_BIG_ENDIAN reverse_copy(p, p + sizeof(int32_t), os->b.begin() + headerSize); #else @@ -731,7 +731,7 @@ Ice::ConnectionI::sendAsyncRequest(const OutgoingAsyncBasePtr& out, bool compres } else if(batchRequestNum > 0) { - const Byte* p = reinterpret_cast(&batchRequestNum); + const uint8_t* p = reinterpret_cast(&batchRequestNum); #ifdef ICE_BIG_ENDIAN reverse_copy(p, p + sizeof(int32_t), os->b.begin() + headerSize); #else @@ -837,7 +837,7 @@ class HeartbeatAsync : public OutgoingAsyncBase _os.write(currentProtocol); _os.write(currentProtocolEncoding); _os.write(validateConnectionMsg); - _os.write(static_cast(0)); // Compression status (always zero for validate connection). + _os.write(static_cast(0)); // Compression status (always zero for validate connection). _os.write(headerSize); // Message size. _os.i = _os.b.begin(); @@ -1119,7 +1119,7 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, exc } void -Ice::ConnectionI::sendResponse(int32_t, OutputStream* os, Byte compressFlag, bool /*amd*/) +Ice::ConnectionI::sendResponse(int32_t, OutputStream* os, uint8_t compressFlag, bool /*amd*/) { std::unique_lock lock(_mutex); assert(_state > StateNotValidated); @@ -1402,7 +1402,7 @@ Ice::ConnectionI::message(ThreadPoolCurrent& current) { function connectionStartCompleted; vector sentCBs; - Byte compress = 0; + uint8_t compress = 0; int32_t requestId = 0; int32_t invokeNum = 0; ServantManagerPtr servantManager; @@ -1492,7 +1492,7 @@ Ice::ConnectionI::message(ThreadPoolCurrent& current) } _readStream.i = _readStream.b.begin(); - const Byte* m; + const uint8_t* m; _readStream.readBlob(m, static_cast(sizeof(magic))); if(m[0] != magic[0] || m[1] != magic[1] || m[2] != magic[2] || m[3] != magic[3]) { @@ -1505,9 +1505,9 @@ Ice::ConnectionI::message(ThreadPoolCurrent& current) _readStream.read(ev); checkSupportedProtocolEncoding(ev); - Byte messageType; + uint8_t messageType; _readStream.read(messageType); - Byte compressByte; + uint8_t compressByte; _readStream.read(compressByte); int32_t size; _readStream.read(size); @@ -1719,7 +1719,7 @@ Ice::ConnectionI::message(ThreadPoolCurrent& current) void ConnectionI::dispatch(function connectionStartCompleted, const vector& sentCBs, - Byte compress, int32_t requestId, int32_t invokeNum, const ServantManagerPtr& servantManager, + uint8_t compress, int32_t requestId, int32_t invokeNum, const ServantManagerPtr& servantManager, const ObjectAdapterPtr& adapter, const OutgoingAsyncBasePtr& outAsync, const HeartbeatCallback& heartbeatCallback, InputStream& stream) { @@ -2525,7 +2525,7 @@ Ice::ConnectionI::initiateShutdown() os.write(currentProtocol); os.write(currentProtocolEncoding); os.write(closeConnectionMsg); - os.write(static_cast(1)); // compression status: compression supported but not used. + os.write(static_cast(1)); // compression status: compression supported but not used. os.write(headerSize); // Message size. OutgoingMessage message(&os, false); @@ -2561,7 +2561,7 @@ Ice::ConnectionI::sendHeartbeatNow() os.write(currentProtocol); os.write(currentProtocolEncoding); os.write(validateConnectionMsg); - os.write(static_cast(0)); // Compression status (always zero for validate connection). + os.write(static_cast(0)); // Compression status (always zero for validate connection). os.write(headerSize); // Message size. os.i = os.b.begin(); try @@ -2613,7 +2613,7 @@ Ice::ConnectionI::validate(SocketOperation operation) _writeStream.write(currentProtocol); _writeStream.write(currentProtocolEncoding); _writeStream.write(validateConnectionMsg); - _writeStream.write(static_cast(0)); // Compression status (always zero for validate connection). + _writeStream.write(static_cast(0)); // Compression status (always zero for validate connection). _writeStream.write(headerSize); // Message size. _writeStream.i = _writeStream.b.begin(); traceSend(_writeStream, _logger, _traceLevels); @@ -2673,7 +2673,7 @@ Ice::ConnectionI::validate(SocketOperation operation) assert(_readStream.i == _readStream.b.end()); _readStream.i = _readStream.b.begin(); - Byte m[4]; + uint8_t m[4]; _readStream.read(m[0]); _readStream.read(m[1]); _readStream.read(m[2]); @@ -2688,13 +2688,13 @@ Ice::ConnectionI::validate(SocketOperation operation) EncodingVersion ev; _readStream.read(ev); checkSupportedProtocolEncoding(ev); - Byte messageType; + uint8_t messageType; _readStream.read(messageType); if(messageType != validateConnectionMsg) { throw ConnectionNotValidatedException(__FILE__, __LINE__); } - Byte compress; + uint8_t compress; _readStream.read(compress); // Ignore compression status for validate connection. int32_t size; _readStream.read(size); @@ -2824,7 +2824,7 @@ Ice::ConnectionI::sendNextMessage(vector& callbacks) // No compression, just fill in the message size. // int32_t sz = static_cast(message->stream->b.size()); - const Byte* p = reinterpret_cast(&sz); + const uint8_t* p = reinterpret_cast(&sz); #ifdef ICE_BIG_ENDIAN reverse_copy(p, p + sizeof(int32_t), message->stream->b.begin() + 10); #else @@ -2964,7 +2964,7 @@ Ice::ConnectionI::sendMessage(OutgoingMessage& message) // No compression, just fill in the message size. // int32_t sz = static_cast(message.stream->b.size()); - const Byte* p = reinterpret_cast(&sz); + const uint8_t* p = reinterpret_cast(&sz); #ifdef ICE_BIG_ENDIAN reverse_copy(p, p + sizeof(int32_t), message.stream->b.begin() + 10); #else @@ -3077,7 +3077,7 @@ getBZ2Error(int bzError) void Ice::ConnectionI::doCompress(OutputStream& uncompressed, OutputStream& compressed) { - const Byte* p; + const uint8_t* p; // // Compress the message body, but not the header. @@ -3102,7 +3102,7 @@ Ice::ConnectionI::doCompress(OutputStream& uncompressed, OutputStream& compresse // will also be in the header of the compressed stream. // int32_t compressedSize = static_cast(compressed.b.size()); - p = reinterpret_cast(&compressedSize); + p = reinterpret_cast(&compressedSize); #ifdef ICE_BIG_ENDIAN reverse_copy(p, p + sizeof(int32_t), uncompressed.b.begin() + 10); #else @@ -3114,7 +3114,7 @@ Ice::ConnectionI::doCompress(OutputStream& uncompressed, OutputStream& compresse // of the compressed stream. // int32_t uncompressedSize = static_cast(uncompressed.b.size()); - p = reinterpret_cast(&uncompressedSize); + p = reinterpret_cast(&uncompressedSize); #ifdef ICE_BIG_ENDIAN reverse_copy(p, p + sizeof(int32_t), compressed.b.begin() + headerSize); #else @@ -3161,7 +3161,7 @@ Ice::ConnectionI::doUncompress(InputStream& compressed, InputStream& uncompresse #endif SocketOperation -Ice::ConnectionI::parseMessage(InputStream& stream, int32_t& invokeNum, int32_t& requestId, Byte& compress, +Ice::ConnectionI::parseMessage(InputStream& stream, int32_t& invokeNum, int32_t& requestId, uint8_t& compress, ServantManagerPtr& servantManager, ObjectAdapterPtr& adapter, OutgoingAsyncBasePtr& outAsync, HeartbeatCallback& heartbeatCallback, int& dispatchCount) @@ -3184,7 +3184,7 @@ Ice::ConnectionI::parseMessage(InputStream& stream, int32_t& invokeNum, int32_t& // assert(stream.i == stream.b.end()); stream.i = stream.b.begin() + 8; - Byte messageType; + uint8_t messageType; stream.read(messageType); stream.read(compress); @@ -3383,7 +3383,7 @@ Ice::ConnectionI::parseMessage(InputStream& stream, int32_t& invokeNum, int32_t& } void -Ice::ConnectionI::invokeAll(InputStream& stream, int32_t invokeNum, int32_t requestId, Byte compress, +Ice::ConnectionI::invokeAll(InputStream& stream, int32_t invokeNum, int32_t requestId, uint8_t compress, const ServantManagerPtr& servantManager, const ObjectAdapterPtr& adapter) { // diff --git a/cpp/src/Ice/ConnectionI.h b/cpp/src/Ice/ConnectionI.h index 1f30c228248..7c9fb2b0132 100644 --- a/cpp/src/Ice/ConnectionI.h +++ b/cpp/src/Ice/ConnectionI.h @@ -72,8 +72,8 @@ class ConnectionI : public Connection, private: - Ice::Byte* _readStreamPos; - Ice::Byte* _writeStreamPos; + std::uint8_t* _readStreamPos; + std::uint8_t* _writeStreamPos; }; public: @@ -169,7 +169,7 @@ class ConnectionI : public Connection, virtual void asyncRequestCanceled(const IceInternal::OutgoingAsyncBasePtr&, std::exception_ptr); - virtual void sendResponse(std::int32_t, Ice::OutputStream*, Byte, bool); + virtual void sendResponse(std::int32_t, Ice::OutputStream*, std::uint8_t, bool); virtual void sendNoResponse(); virtual bool systemException(std::int32_t, std::exception_ptr, bool); virtual void invokeException(std::int32_t, std::exception_ptr, int, bool); @@ -209,7 +209,7 @@ class ConnectionI : public Connection, void dispatch(std::function, const std::vector&, - Byte, + std::uint8_t, std::int32_t, std::int32_t, const IceInternal::ServantManagerPtr&, @@ -265,11 +265,11 @@ class ConnectionI : public Connection, void doUncompress(Ice::InputStream&, Ice::InputStream&); #endif - IceInternal::SocketOperation parseMessage(Ice::InputStream&, std::int32_t&, std::int32_t&, Byte&, + IceInternal::SocketOperation parseMessage(Ice::InputStream&, std::int32_t&, std::int32_t&, std::uint8_t&, IceInternal::ServantManagerPtr&, ObjectAdapterPtr&, IceInternal::OutgoingAsyncBasePtr&, HeartbeatCallback&, int&); - void invokeAll(Ice::InputStream&, std::int32_t, std::int32_t, Byte, + void invokeAll(Ice::InputStream&, std::int32_t, std::int32_t, std::uint8_t, const IceInternal::ServantManagerPtr&, const ObjectAdapterPtr&); void scheduleTimeout(IceInternal::SocketOperation status); diff --git a/cpp/src/Ice/HttpParser.cpp b/cpp/src/Ice/HttpParser.cpp index 1553d7e7d26..d23f19e0680 100644 --- a/cpp/src/Ice/HttpParser.cpp +++ b/cpp/src/Ice/HttpParser.cpp @@ -25,10 +25,10 @@ IceInternal::HttpParser::HttpParser() : { } -const Ice::Byte* -IceInternal::HttpParser::isCompleteMessage(const Ice::Byte* begin, const Ice::Byte* end) const +const uint8_t* +IceInternal::HttpParser::isCompleteMessage(const uint8_t* begin, const uint8_t* end) const { - const Ice::Byte* p = begin; + const uint8_t* p = begin; // // Skip any leading CR-LF characters. @@ -71,10 +71,10 @@ IceInternal::HttpParser::isCompleteMessage(const Ice::Byte* begin, const Ice::By } bool -IceInternal::HttpParser::parse(const Ice::Byte* begin, const Ice::Byte* end) +IceInternal::HttpParser::parse(const uint8_t* begin, const uint8_t* end) { - const Ice::Byte* p = begin; - const Ice::Byte* start = 0; + const uint8_t* p = begin; + const uint8_t* start = 0; const string::value_type CR = '\r'; const string::value_type LF = '\n'; diff --git a/cpp/src/Ice/HttpParser.h b/cpp/src/Ice/HttpParser.h index f60247e23b7..3547673b8c1 100644 --- a/cpp/src/Ice/HttpParser.h +++ b/cpp/src/Ice/HttpParser.h @@ -40,9 +40,9 @@ class HttpParser TypeResponse }; - const Ice::Byte* isCompleteMessage(const Ice::Byte*, const Ice::Byte*) const; + const std::uint8_t* isCompleteMessage(const std::uint8_t*, const std::uint8_t*) const; - bool parse(const Ice::Byte*, const Ice::Byte*); + bool parse(const std::uint8_t*, const std::uint8_t*); Type type() const; diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp index 1c4c260a777..8cda0749ae7 100644 --- a/cpp/src/Ice/Incoming.cpp +++ b/cpp/src/Ice/Incoming.cpp @@ -41,7 +41,7 @@ Ice::MarshaledResult::MarshaledResult(const Ice::Current& current) : IceInternal::IncomingBase::IncomingBase(Instance* instance, ResponseHandler* responseHandler, Ice::Connection* connection, const ObjectAdapterPtr& adapter, - bool response, Byte compress, int32_t requestId) : + bool response, uint8_t compress, int32_t requestId) : _response(response), _compress(compress), _format(Ice::FormatType::DefaultFormat), @@ -111,7 +111,7 @@ IncomingBase::writeEmptyParams() } void -IncomingBase::writeParamEncaps(const Byte* v, int32_t sz, bool ok) +IncomingBase::writeParamEncaps(const uint8_t* v, int32_t sz, bool ok) { if(!ok) { @@ -504,7 +504,7 @@ IceInternal::IncomingBase::handleException(std::exception_ptr exc, bool amd) } IceInternal::Incoming::Incoming(Instance* instance, ResponseHandler* responseHandler, Ice::Connection* connection, - const ObjectAdapterPtr& adapter, bool response, Byte compress, int32_t requestId) : + const ObjectAdapterPtr& adapter, bool response, uint8_t compress, int32_t requestId) : IncomingBase(instance, responseHandler, connection, adapter, response, compress, requestId), _inParamPos(0) { @@ -579,7 +579,7 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager, InputStre _is->read(_current.operation, false); - Byte b; + uint8_t b; _is->read(b); _current.mode = static_cast(b); diff --git a/cpp/src/Ice/InputStream.cpp b/cpp/src/Ice/InputStream.cpp index 76181859113..54b4ded0c2e 100644 --- a/cpp/src/Ice/InputStream.cpp +++ b/cpp/src/Ice/InputStream.cpp @@ -37,13 +37,13 @@ Ice::InputStream::InputStream() initialize(currentEncoding); } -Ice::InputStream::InputStream(const vector& v) : +Ice::InputStream::InputStream(const vector& v) : Buffer(v) { initialize(currentEncoding); } -Ice::InputStream::InputStream(const pair& p) : +Ice::InputStream::InputStream(const pair& p) : Buffer(p.first, p.second) { initialize(currentEncoding); @@ -60,13 +60,13 @@ Ice::InputStream::InputStream(const CommunicatorPtr& communicator) initialize(communicator); } -Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const vector& v) : +Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const vector& v) : Buffer(v) { initialize(communicator); } -Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const pair& p) : +Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const pair& p) : Buffer(p.first, p.second) { initialize(communicator); @@ -83,13 +83,13 @@ Ice::InputStream::InputStream(const EncodingVersion& encoding) initialize(encoding); } -Ice::InputStream::InputStream(const EncodingVersion& encoding, const vector& v) : +Ice::InputStream::InputStream(const EncodingVersion& encoding, const vector& v) : Buffer(v) { initialize(encoding); } -Ice::InputStream::InputStream(const EncodingVersion& encoding, const pair& p) : +Ice::InputStream::InputStream(const EncodingVersion& encoding, const pair& p) : Buffer(p.first, p.second) { initialize(encoding); @@ -107,14 +107,14 @@ Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const Encodin } Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const EncodingVersion& encoding, - const vector& v) : + const vector& v) : Buffer(v) { initialize(communicator, encoding); } Ice::InputStream::InputStream(const CommunicatorPtr& communicator, const EncodingVersion& encoding, - const pair& p) : + const pair& p) : Buffer(p.first, p.second) { initialize(communicator, encoding); @@ -387,7 +387,7 @@ Ice::InputStream::readAndCheckSeqSize(int minSize) } void -Ice::InputStream::readBlob(vector& v, int32_t sz) +Ice::InputStream::readBlob(vector& v, int32_t sz) { if(sz > 0) { @@ -395,7 +395,7 @@ Ice::InputStream::readBlob(vector& v, int32_t sz) { throw UnmarshalOutOfBoundsException(__FILE__, __LINE__); } - vector(i, i + sz).swap(v); + vector(i, i + sz).swap(v); i += sz; } else @@ -405,9 +405,9 @@ Ice::InputStream::readBlob(vector& v, int32_t sz) } void -Ice::InputStream::read(std::vector& v) +Ice::InputStream::read(std::vector& v) { - std::pair p; + std::pair p; read(p); if(p.first != p.second) { @@ -421,7 +421,7 @@ Ice::InputStream::read(std::vector& v) } void -Ice::InputStream::read(pair& v) +Ice::InputStream::read(pair& v) { int32_t sz = readAndCheckSeqSize(1); if(sz > 0) @@ -510,14 +510,14 @@ Ice::InputStream::read(int16_t& v) { throw UnmarshalOutOfBoundsException(__FILE__, __LINE__); } - const Byte* src = &(*i); + const uint8_t* src = &(*i); i += sizeof(int16_t); #ifdef ICE_BIG_ENDIAN - Byte* dest = reinterpret_cast(&v) + sizeof(int16_t) - 1; + uint8_t* dest = reinterpret_cast(&v) + sizeof(int16_t) - 1; *dest-- = *src++; *dest = *src; #else - Byte* dest = reinterpret_cast(&v); + uint8_t* dest = reinterpret_cast(&v); *dest++ = *src++; *dest = *src; #endif @@ -533,8 +533,8 @@ Ice::InputStream::read(vector& v) i += sz * static_cast(sizeof(int16_t)); v.resize(static_cast(sz)); #ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast(&v[0]) + sizeof(int16_t) - 1; + const uint8_t* src = &(*begin); + uint8_t* dest = reinterpret_cast(&v[0]) + sizeof(int16_t) - 1; for(int j = 0 ; j < sz ; ++j) { *dest-- = *src++; @@ -542,7 +542,7 @@ Ice::InputStream::read(vector& v) dest += 2 * sizeof(int16_t); } #else - copy(begin, i, reinterpret_cast(&v[0])); + copy(begin, i, reinterpret_cast(&v[0])); #endif } else @@ -570,8 +570,8 @@ Ice::InputStream::read(pair& v) Container::iterator begin = i; i += sz * static_cast(sizeof(int16_t)); # ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast(&result[0]) + sizeof(int16_t) - 1; + const uint8_t* src = &(*begin); + uint8_t* dest = reinterpret_cast(&result[0]) + sizeof(int16_t) - 1; for(int j = 0 ; j < sz ; ++j) { *dest-- = *src++; @@ -579,7 +579,7 @@ Ice::InputStream::read(pair& v) dest += 2 * sizeof(int16_t); } # else - copy(begin, i, reinterpret_cast(&result[0])); + copy(begin, i, reinterpret_cast(&result[0])); # endif #endif } @@ -599,8 +599,8 @@ Ice::InputStream::read(vector& v) i += sz * static_cast(sizeof(int32_t)); v.resize(static_cast(sz)); #ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast(&v[0]) + sizeof(int32_t) - 1; + const uint8_t* src = &(*begin); + uint8_t* dest = reinterpret_cast(&v[0]) + sizeof(int32_t) - 1; for(int j = 0 ; j < sz ; ++j) { *dest-- = *src++; @@ -610,7 +610,7 @@ Ice::InputStream::read(vector& v) dest += 2 * sizeof(int32_t); } #else - copy(begin, i, reinterpret_cast(&v[0])); + copy(begin, i, reinterpret_cast(&v[0])); #endif } else @@ -639,8 +639,8 @@ Ice::InputStream::read(pair& v) Container::iterator begin = i; i += sz * static_cast(sizeof(int32_t)); # ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast(&result[0]) + sizeof(int32_t) - 1; + const uint8_t* src = &(*begin); + uint8_t* dest = reinterpret_cast(&result[0]) + sizeof(int32_t) - 1; for(int j = 0 ; j < sz ; ++j) { *dest-- = *src++; @@ -650,7 +650,7 @@ Ice::InputStream::read(pair& v) dest += 2 * sizeof(int32_t); } # else - copy(begin, i, reinterpret_cast(&result[0])); + copy(begin, i, reinterpret_cast(&result[0])); # endif #endif } @@ -667,10 +667,10 @@ Ice::InputStream::read(int64_t& v) { throw UnmarshalOutOfBoundsException(__FILE__, __LINE__); } - const Byte* src = &(*i); + const uint8_t* src = &(*i); i += sizeof(int64_t); #ifdef ICE_BIG_ENDIAN - Byte* dest = reinterpret_cast(&v) + sizeof(int64_t) - 1; + uint8_t* dest = reinterpret_cast(&v) + sizeof(int64_t) - 1; *dest-- = *src++; *dest-- = *src++; *dest-- = *src++; @@ -680,7 +680,7 @@ Ice::InputStream::read(int64_t& v) *dest-- = *src++; *dest = *src; #else - Byte* dest = reinterpret_cast(&v); + uint8_t* dest = reinterpret_cast(&v); *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; @@ -702,8 +702,8 @@ Ice::InputStream::read(vector& v) i += sz * static_cast(sizeof(int64_t)); v.resize(static_cast(sz)); #ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast(&v[0]) + sizeof(int64_t) - 1; + const uint8_t* src = &(*begin); + uint8_t* dest = reinterpret_cast(&v[0]) + sizeof(int64_t) - 1; for(int j = 0 ; j < sz ; ++j) { *dest-- = *src++; @@ -717,7 +717,7 @@ Ice::InputStream::read(vector& v) dest += 2 * sizeof(int64_t); } #else - copy(begin, i, reinterpret_cast(&v[0])); + copy(begin, i, reinterpret_cast(&v[0])); #endif } else @@ -746,8 +746,8 @@ Ice::InputStream::read(pair& v) Container::iterator begin = i; i += sz * static_cast(sizeof(int64_t)); # ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast(&result[0]) + sizeof(int64_t) - 1; + const uint8_t* src = &(*begin); + uint8_t* dest = reinterpret_cast(&result[0]) + sizeof(int64_t) - 1; for(int j = 0 ; j < sz ; ++j) { *dest-- = *src++; @@ -761,7 +761,7 @@ Ice::InputStream::read(pair& v) dest += 2 * sizeof(int64_t); } # else - copy(begin, i, reinterpret_cast(&result[0])); + copy(begin, i, reinterpret_cast(&result[0])); # endif #endif } @@ -778,16 +778,16 @@ Ice::InputStream::read(float& v) { throw UnmarshalOutOfBoundsException(__FILE__, __LINE__); } - const Byte* src = &(*i); + const uint8_t* src = &(*i); i += sizeof(float); #ifdef ICE_BIG_ENDIAN - Byte* dest = reinterpret_cast(&v) + sizeof(float) - 1; + uint8_t* dest = reinterpret_cast(&v) + sizeof(float) - 1; *dest-- = *src++; *dest-- = *src++; *dest-- = *src++; *dest = *src; #else - Byte* dest = reinterpret_cast(&v); + uint8_t* dest = reinterpret_cast(&v); *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; @@ -805,8 +805,8 @@ Ice::InputStream::read(vector& v) i += sz * static_cast(sizeof(float)); v.resize(static_cast(sz)); #ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast(&v[0]) + sizeof(float) - 1; + const uint8_t* src = &(*begin); + uint8_t* dest = reinterpret_cast(&v[0]) + sizeof(float) - 1; for(int j = 0 ; j < sz ; ++j) { *dest-- = *src++; @@ -816,7 +816,7 @@ Ice::InputStream::read(vector& v) dest += 2 * sizeof(float); } #else - copy(begin, i, reinterpret_cast(&v[0])); + copy(begin, i, reinterpret_cast(&v[0])); #endif } else @@ -845,8 +845,8 @@ Ice::InputStream::read(pair& v) Container::iterator begin = i; i += sz * static_cast(sizeof(float)); # ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast(&result[0]) + sizeof(float) - 1; + const uint8_t* src = &(*begin); + uint8_t* dest = reinterpret_cast(&result[0]) + sizeof(float) - 1; for(int j = 0 ; j < sz ; ++j) { *dest-- = *src++; @@ -856,7 +856,7 @@ Ice::InputStream::read(pair& v) dest += 2 * sizeof(float); } # else - copy(begin, i, reinterpret_cast(&result[0])); + copy(begin, i, reinterpret_cast(&result[0])); # endif #endif } @@ -873,10 +873,10 @@ Ice::InputStream::read(double& v) { throw UnmarshalOutOfBoundsException(__FILE__, __LINE__); } - const Byte* src = &(*i); + const uint8_t* src = &(*i); i += sizeof(double); #ifdef ICE_BIG_ENDIAN - Byte* dest = reinterpret_cast(&v) + sizeof(double) - 1; + uint8_t* dest = reinterpret_cast(&v) + sizeof(double) - 1; *dest-- = *src++; *dest-- = *src++; *dest-- = *src++; @@ -886,7 +886,7 @@ Ice::InputStream::read(double& v) *dest-- = *src++; *dest = *src; #else - Byte* dest = reinterpret_cast(&v); + uint8_t* dest = reinterpret_cast(&v); *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; @@ -908,8 +908,8 @@ Ice::InputStream::read(vector& v) i += sz * static_cast(sizeof(double)); v.resize(static_cast(sz)); #ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast(&v[0]) + sizeof(double) - 1; + const uint8_t* src = &(*begin); + uint8_t* dest = reinterpret_cast(&v[0]) + sizeof(double) - 1; for(int j = 0 ; j < sz ; ++j) { *dest-- = *src++; @@ -923,7 +923,7 @@ Ice::InputStream::read(vector& v) dest += 2 * sizeof(double); } #else - copy(begin, i, reinterpret_cast(&v[0])); + copy(begin, i, reinterpret_cast(&v[0])); #endif } else @@ -952,8 +952,8 @@ Ice::InputStream::read(pair& v) Container::iterator begin = i; i += sz * static_cast(sizeof(double)); # ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast(&result[0]) + sizeof(double) - 1; + const uint8_t* src = &(*begin); + uint8_t* dest = reinterpret_cast(&result[0]) + sizeof(double) - 1; for(int j = 0 ; j < sz ; ++j) { *dest-- = *src++; @@ -967,7 +967,7 @@ Ice::InputStream::read(pair& v) dest += 2 * sizeof(double); } # else - copy(begin, i, reinterpret_cast(&result[0])); + copy(begin, i, reinterpret_cast(&result[0])); # endif #endif } @@ -1193,7 +1193,7 @@ Ice::InputStream::readEnum(int32_t maxValue) { if(maxValue < 127) { - Byte value; + uint8_t value; read(value); return value; } @@ -1238,7 +1238,7 @@ Ice::InputStream::readOptImpl(int32_t readTag, OptionalFormat expectedFormat) return false; // End of encapsulation also indicates end of optionals. } - Byte v; + uint8_t v; read(v); if(v == OPTIONAL_END_MARKER) { @@ -1343,7 +1343,7 @@ Ice::InputStream::skipOptionals() return; // End of encapsulation also indicates end of optionals. } - Byte v; + uint8_t v; read(v); if(v == OPTIONAL_END_MARKER) { @@ -2300,11 +2300,11 @@ Ice::InputStream::EncapsDecoder11::skipSlice() // Don't include the optional member end marker. It will be re-written by // endSlice when the sliced data is re-written. // - vector(start, _stream->i - 1).swap(info->bytes); + vector(start, _stream->i - 1).swap(info->bytes); } else { - vector(start, _stream->i).swap(info->bytes); + vector(start, _stream->i).swap(info->bytes); } _current->indirectionTables.push_back(IndexList()); diff --git a/cpp/src/Ice/NetworkProxy.cpp b/cpp/src/Ice/NetworkProxy.cpp index 193a2689b0e..2afee14c967 100644 --- a/cpp/src/Ice/NetworkProxy.cpp +++ b/cpp/src/Ice/NetworkProxy.cpp @@ -86,23 +86,23 @@ SOCKSNetworkProxy::beginWrite(const Address& addr, Buffer& buf) // buf.b.resize(9); buf.i = buf.b.begin(); - Ice::Byte* dest = &buf.b[0]; + uint8_t* dest = &buf.b[0]; *dest++ = 0x04; // SOCKS version 4. *dest++ = 0x01; // Command, establish a TCP/IP stream connection - const Ice::Byte* src; + const uint8_t* src; // // Port (already in big-endian order) // - src = reinterpret_cast(&addr.saIn.sin_port); + src = reinterpret_cast(&addr.saIn.sin_port); *dest++ = *src++; *dest++ = *src; // // IPv4 address (already in big-endian order) // - src = reinterpret_cast(&addr.saIn.sin_addr.s_addr); + src = reinterpret_cast(&addr.saIn.sin_addr.s_addr); *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; @@ -145,9 +145,9 @@ SOCKSNetworkProxy::finish(Buffer& readBuffer, Buffer&) throw Ice::UnmarshalOutOfBoundsException(__FILE__, __LINE__); } - const Ice::Byte* src = &(*readBuffer.i); - const Ice::Byte b1 = *src++; - const Ice::Byte b2 = *src++; + const uint8_t* src = &(*readBuffer.i); + const uint8_t b1 = *src++; + const uint8_t b2 = *src++; if(b1 != 0x00 || b2 != 0x5a) { throw Ice::ConnectFailedException(__FILE__, __LINE__); @@ -229,7 +229,7 @@ HTTPNetworkProxy::endRead(Buffer& buf) // Check if we received the full HTTP response, if not, continue // reading otherwise we're done. // - const Ice::Byte* end = HttpParser().isCompleteMessage(buf.b.begin(), buf.i); + const uint8_t* end = HttpParser().isCompleteMessage(buf.b.begin(), buf.i); if(!end && buf.i == buf.b.end()) { // diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp index 31c14731743..f0317b0b1d9 100644 --- a/cpp/src/Ice/Object.cpp +++ b/cpp/src/Ice/Object.cpp @@ -231,11 +231,11 @@ Ice::Object::_iceCheckMode(OperationMode expected, OperationMode received) bool Ice::Blobject::_iceDispatch(Incoming& in, const Current& current) { - const Byte* inEncaps; + const uint8_t* inEncaps; int32_t sz; in.readParamEncaps(inEncaps, sz); - vector outEncaps; - bool ok = ice_invoke(vector(inEncaps, inEncaps + sz), outEncaps, current); + vector outEncaps; + bool ok = ice_invoke(vector(inEncaps, inEncaps + sz), outEncaps, current); if(outEncaps.empty()) { in.writeParamEncaps(0, 0, ok); @@ -250,11 +250,11 @@ Ice::Blobject::_iceDispatch(Incoming& in, const Current& current) bool Ice::BlobjectArray::_iceDispatch(Incoming& in, const Current& current) { - pair inEncaps; + pair inEncaps; int32_t sz; in.readParamEncaps(inEncaps.first, sz); inEncaps.second = inEncaps.first + sz; - vector outEncaps; + vector outEncaps; bool ok = ice_invoke(inEncaps, outEncaps, current); if(outEncaps.empty()) { @@ -270,12 +270,12 @@ Ice::BlobjectArray::_iceDispatch(Incoming& in, const Current& current) bool Ice::BlobjectAsync::_iceDispatch(Incoming& in, const Current& current) { - const Byte* inEncaps; + const uint8_t* inEncaps; int32_t sz; in.readParamEncaps(inEncaps, sz); auto async = IncomingAsync::create(in); - ice_invokeAsync(vector(inEncaps, inEncaps + sz), - [async](bool ok, const vector& outEncaps) + ice_invokeAsync(vector(inEncaps, inEncaps + sz), + [async](bool ok, const vector& outEncaps) { if(outEncaps.empty()) { @@ -294,13 +294,13 @@ Ice::BlobjectAsync::_iceDispatch(Incoming& in, const Current& current) bool Ice::BlobjectArrayAsync::_iceDispatch(Incoming& in, const Current& current) { - pair inEncaps; + pair inEncaps; int32_t sz; in.readParamEncaps(inEncaps.first, sz); inEncaps.second = inEncaps.first + sz; auto async = IncomingAsync::create(in); ice_invokeAsync(inEncaps, - [async](bool ok, const pair& outE) + [async](bool ok, const pair& outE) { async->writeParamEncaps(outE.first, static_cast(outE.second - outE.first), ok); async->completed(); diff --git a/cpp/src/Ice/OpaqueEndpointI.cpp b/cpp/src/Ice/OpaqueEndpointI.cpp index 90b6e57573a..40aa2cb4ae0 100644 --- a/cpp/src/Ice/OpaqueEndpointI.cpp +++ b/cpp/src/Ice/OpaqueEndpointI.cpp @@ -42,7 +42,7 @@ IceInternal::OpaqueEndpointI::OpaqueEndpointI(int16_t type, InputStream* s) : _t { _rawEncoding = s->getEncoding(); int32_t sz = s->getEncapsulationSize(); - s->readBlob(const_cast&>(_rawBytes), sz); + s->readBlob(const_cast&>(_rawBytes), sz); } namespace @@ -371,7 +371,7 @@ IceInternal::OpaqueEndpointI::checkOption(const string& option, const string& ar throw EndpointParseException(__FILE__, __LINE__, os.str()); } } - const_cast&>(_rawBytes) = Base64::decode(argument); + const_cast&>(_rawBytes) = Base64::decode(argument); return true; } diff --git a/cpp/src/Ice/OpaqueEndpointI.h b/cpp/src/Ice/OpaqueEndpointI.h index 96d42ccb5d2..5a2c95242e5 100644 --- a/cpp/src/Ice/OpaqueEndpointI.h +++ b/cpp/src/Ice/OpaqueEndpointI.h @@ -61,7 +61,7 @@ class OpaqueEndpointI : public EndpointI, public std::enable_shared_from_this _rawBytes; + const std::vector _rawBytes; }; } diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp index 9948dd5b5f0..a75e7ae864e 100644 --- a/cpp/src/Ice/OutgoingAsync.cpp +++ b/cpp/src/Ice/OutgoingAsync.cpp @@ -676,7 +676,7 @@ OutgoingAsync::prepare(string_view operation, OperationMode mode, const Context& _os.write(operation, false); - _os.write(static_cast(_mode)); + _os.write(static_cast(_mode)); if(&context != &Ice::noExplicitContext) { @@ -725,7 +725,7 @@ OutgoingAsync::response() _childObserver.detach(); } - Byte replyStatus; + uint8_t replyStatus; try { _is.read(replyStatus); diff --git a/cpp/src/Ice/OutputStream.cpp b/cpp/src/Ice/OutputStream.cpp index 6034abf676d..00d52bb7309 100644 --- a/cpp/src/Ice/OutputStream.cpp +++ b/cpp/src/Ice/OutputStream.cpp @@ -33,7 +33,7 @@ class StreamUTF8BufferI : public IceUtil::UTF8Buffer { } - Ice::Byte* getMoreBytes(size_t howMany, Ice::Byte* firstUnused) + uint8_t* getMoreBytes(size_t howMany, uint8_t* firstUnused) { assert(howMany > 0); @@ -90,7 +90,7 @@ Ice::OutputStream::OutputStream(const CommunicatorPtr& communicator, const Encod } Ice::OutputStream::OutputStream(const CommunicatorPtr& communicator, const EncodingVersion& encoding, - const pair& buf) : + const pair& buf) : Buffer(buf.first, buf.second), _closure(0), _currentEncaps(0) @@ -237,7 +237,7 @@ Ice::OutputStream::writePendingValues() } void -Ice::OutputStream::writeBlob(const vector& v) +Ice::OutputStream::writeBlob(const vector& v) { if(!v.empty()) { @@ -248,7 +248,7 @@ Ice::OutputStream::writeBlob(const vector& v) } void -Ice::OutputStream::write(const Byte* begin, const Byte* end) +Ice::OutputStream::write(const uint8_t* begin, const uint8_t* end) { int32_t sz = static_cast(end - begin); writeSize(sz); @@ -283,7 +283,7 @@ struct WriteBoolHelper { for(size_t idx = 0; idx < static_cast(sz); ++idx) { - b[pos + idx] = static_cast(*(begin + idx)); + b[pos + idx] = static_cast(*(begin + idx)); } } }; @@ -317,13 +317,13 @@ Ice::OutputStream::write(int16_t v) { Container::size_type pos = b.size(); resize(pos + sizeof(int16_t)); - Byte* dest = &b[pos]; + uint8_t* dest = &b[pos]; #ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast(&v) + sizeof(int16_t) - 1; + const uint8_t* src = reinterpret_cast(&v) + sizeof(int16_t) - 1; *dest++ = *src--; *dest = *src; #else - const Byte* src = reinterpret_cast(&v); + const uint8_t* src = reinterpret_cast(&v); *dest++ = *src++; *dest = *src; #endif @@ -339,8 +339,8 @@ Ice::OutputStream::write(const int16_t* begin, const int16_t* end) Container::size_type pos = b.size(); resize(pos + static_cast(sz) * sizeof(int16_t)); #ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast(begin) + sizeof(int16_t) - 1; - Byte* dest = &(*(b.begin() + pos)); + const uint8_t* src = reinterpret_cast(begin) + sizeof(int16_t) - 1; + uint8_t* dest = &(*(b.begin() + pos)); for(int j = 0 ; j < sz ; ++j) { *dest++ = *src--; @@ -348,7 +348,7 @@ Ice::OutputStream::write(const int16_t* begin, const int16_t* end) src += 2 * sizeof(int16_t); } #else - memcpy(&b[pos], reinterpret_cast(begin), static_cast(sz) * sizeof(int16_t)); + memcpy(&b[pos], reinterpret_cast(begin), static_cast(sz) * sizeof(int16_t)); #endif } } @@ -363,8 +363,8 @@ Ice::OutputStream::write(const int32_t* begin, const int32_t* end) Container::size_type pos = b.size(); resize(pos + static_cast(sz) * sizeof(int32_t)); #ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast(begin) + sizeof(int32_t) - 1; - Byte* dest = &(*(b.begin() + pos)); + const uint8_t* src = reinterpret_cast(begin) + sizeof(int32_t) - 1; + uint8_t* dest = &(*(b.begin() + pos)); for(int j = 0 ; j < sz ; ++j) { *dest++ = *src--; @@ -374,7 +374,7 @@ Ice::OutputStream::write(const int32_t* begin, const int32_t* end) src += 2 * sizeof(int32_t); } #else - memcpy(&b[pos], reinterpret_cast(begin), static_cast(sz) * sizeof(int32_t)); + memcpy(&b[pos], reinterpret_cast(begin), static_cast(sz) * sizeof(int32_t)); #endif } } @@ -384,9 +384,9 @@ Ice::OutputStream::write(int64_t v) { Container::size_type pos = b.size(); resize(pos + sizeof(int64_t)); - Byte* dest = &b[pos]; + uint8_t* dest = &b[pos]; #ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast(&v) + sizeof(Long) - 1; + const uint8_t* src = reinterpret_cast(&v) + sizeof(Long) - 1; *dest++ = *src--; *dest++ = *src--; *dest++ = *src--; @@ -396,7 +396,7 @@ Ice::OutputStream::write(int64_t v) *dest++ = *src--; *dest = *src; #else - const Byte* src = reinterpret_cast(&v); + const uint8_t* src = reinterpret_cast(&v); *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; @@ -418,8 +418,8 @@ Ice::OutputStream::write(const int64_t* begin, const int64_t* end) Container::size_type pos = b.size(); resize(pos + static_cast(sz) * sizeof(int64_t)); #ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast(begin) + sizeof(int64_t) - 1; - Byte* dest = &(*(b.begin() + pos)); + const uint8_t* src = reinterpret_cast(begin) + sizeof(int64_t) - 1; + uint8_t* dest = &(*(b.begin() + pos)); for(int j = 0 ; j < sz ; ++j) { *dest++ = *src--; @@ -433,7 +433,7 @@ Ice::OutputStream::write(const int64_t* begin, const int64_t* end) src += 2 * sizeof(int64_t); } #else - memcpy(&b[pos], reinterpret_cast(begin), static_cast(sz) * sizeof(int64_t)); + memcpy(&b[pos], reinterpret_cast(begin), static_cast(sz) * sizeof(int64_t)); #endif } } @@ -443,15 +443,15 @@ Ice::OutputStream::write(float v) { Container::size_type pos = b.size(); resize(pos + sizeof(float)); - Byte* dest = &b[pos]; + uint8_t* dest = &b[pos]; #ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast(&v) + sizeof(float) - 1; + const uint8_t* src = reinterpret_cast(&v) + sizeof(float) - 1; *dest++ = *src--; *dest++ = *src--; *dest++ = *src--; *dest = *src; #else - const Byte* src = reinterpret_cast(&v); + const uint8_t* src = reinterpret_cast(&v); *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; @@ -469,8 +469,8 @@ Ice::OutputStream::write(const float* begin, const float* end) Container::size_type pos = b.size(); resize(pos + static_cast(sz) * sizeof(float)); #ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast(begin) + sizeof(float) - 1; - Byte* dest = &(*(b.begin() + pos)); + const uint8_t* src = reinterpret_cast(begin) + sizeof(float) - 1; + uint8_t* dest = &(*(b.begin() + pos)); for(int j = 0 ; j < sz ; ++j) { *dest++ = *src--; @@ -480,7 +480,7 @@ Ice::OutputStream::write(const float* begin, const float* end) src += 2 * sizeof(float); } #else - memcpy(&b[pos], reinterpret_cast(begin), static_cast(sz) * sizeof(float)); + memcpy(&b[pos], reinterpret_cast(begin), static_cast(sz) * sizeof(float)); #endif } } @@ -490,9 +490,9 @@ Ice::OutputStream::write(double v) { Container::size_type pos = b.size(); resize(pos + sizeof(double)); - Byte* dest = &b[pos]; + uint8_t* dest = &b[pos]; #ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast(&v) + sizeof(double) - 1; + const uint8_t* src = reinterpret_cast(&v) + sizeof(double) - 1; *dest++ = *src--; *dest++ = *src--; *dest++ = *src--; @@ -502,7 +502,7 @@ Ice::OutputStream::write(double v) *dest++ = *src--; *dest = *src; #else - const Byte* src = reinterpret_cast(&v); + const uint8_t* src = reinterpret_cast(&v); *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; @@ -524,8 +524,8 @@ Ice::OutputStream::write(const double* begin, const double* end) Container::size_type pos = b.size(); resize(pos + static_cast(sz) * sizeof(double)); #ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast(begin) + sizeof(double) - 1; - Byte* dest = &(*(b.begin() + pos)); + const uint8_t* src = reinterpret_cast(begin) + sizeof(double) - 1; + uint8_t* dest = &(*(b.begin() + pos)); for(int j = 0 ; j < sz ; ++j) { *dest++ = *src--; @@ -539,7 +539,7 @@ Ice::OutputStream::write(const double* begin, const double* end) src += 2 * sizeof(double); } #else - memcpy(&b[pos], reinterpret_cast(begin), static_cast(sz) * sizeof(double)); + memcpy(&b[pos], reinterpret_cast(begin), static_cast(sz) * sizeof(double)); #endif } } @@ -574,7 +574,7 @@ Ice::OutputStream::writeConverted(const char* vdata, size_t vsize) size_t firstIndex = b.size(); StreamUTF8BufferI buffer(*this); - Byte* lastByte = nullptr; + uint8_t* lastByte = nullptr; bool converted = false; if(_instance) { @@ -686,7 +686,7 @@ Ice::OutputStream::write(wstring_view v) size_t firstIndex = b.size(); StreamUTF8BufferI buffer(*this); - Byte* lastByte = nullptr; + uint8_t* lastByte = nullptr; // Note: wstringConverter is never null; when set to null, get returns the default unicode wstring converter if(_instance) @@ -779,7 +779,7 @@ Ice::OutputStream::writeEnum(int32_t v, int32_t maxValue) { if(maxValue < 127) { - write(static_cast(v)); + write(static_cast(v)); } else if(maxValue < 32767) { @@ -811,10 +811,10 @@ Ice::OutputStream::writeOptImpl(int32_t tag, OptionalFormat type) return false; // Optional members aren't supported with the 1.0 encoding. } - Byte v = static_cast(type); + uint8_t v = static_cast(type); if(tag < 30) { - v |= static_cast(tag << 3); + v |= static_cast(tag << 3); write(v); } else @@ -827,21 +827,21 @@ Ice::OutputStream::writeOptImpl(int32_t tag, OptionalFormat type) } void -Ice::OutputStream::finished(vector& bytes) +Ice::OutputStream::finished(vector& bytes) { - vector(b.begin(), b.end()).swap(bytes); + vector(b.begin(), b.end()).swap(bytes); } -pair +pair Ice::OutputStream::finished() { if(b.empty()) { - return pair(reinterpret_cast(0), reinterpret_cast(0)); + return pair(reinterpret_cast(0), reinterpret_cast(0)); } else { - return pair(&b[0], &b[0] + b.size()); + return pair(&b[0], &b[0] + b.size()); } } @@ -995,7 +995,7 @@ Ice::OutputStream::EncapsEncoder10::endSlice() // Write the slice length. // int32_t sz = static_cast(_stream->b.size() - _writeSlice + sizeof(int32_t)); - Byte* dest = &(*(_stream->b.begin() + _writeSlice - sizeof(int32_t))); + uint8_t* dest = &(*(_stream->b.begin() + _writeSlice - sizeof(int32_t))); _stream->write(sz, dest); } @@ -1160,7 +1160,7 @@ Ice::OutputStream::EncapsEncoder11::startSlice(string_view typeId, int compactId _current->sliceFlags |= FLAG_IS_LAST_SLICE; // This is the last slice. } - _stream->write(Byte(0)); // Placeholder for the slice flags + _stream->write(std::uint8_t(0)); // Placeholder for the slice flags // // For instance slices, encode the flag and the type ID either as a @@ -1229,7 +1229,7 @@ Ice::OutputStream::EncapsEncoder11::endSlice() if(_current->sliceFlags & FLAG_HAS_SLICE_SIZE) { int32_t sz = static_cast(_stream->b.size() - _current->writeSlice + sizeof(int32_t)); - Byte* dest = &(*(_stream->b.begin() + _current->writeSlice - sizeof(int32_t))); + uint8_t* dest = &(*(_stream->b.begin() + _current->writeSlice - sizeof(int32_t))); _stream->write(sz, dest); } @@ -1257,7 +1257,7 @@ Ice::OutputStream::EncapsEncoder11::endSlice() // // Finally, update the slice flags. // - Byte* dest = &(*(_stream->b.begin() + _current->sliceFlagsPos)); + uint8_t* dest = &(*(_stream->b.begin() + _current->sliceFlagsPos)); *dest = _current->sliceFlags; } diff --git a/cpp/src/Ice/Protocol.cpp b/cpp/src/Ice/Protocol.cpp index 95a9a12395f..3e4931c4b23 100644 --- a/cpp/src/Ice/Protocol.cpp +++ b/cpp/src/Ice/Protocol.cpp @@ -8,9 +8,9 @@ namespace IceInternal { -const Ice::Byte magic[] = { 0x49, 0x63, 0x65, 0x50 }; // 'I', 'c', 'e', 'P' +const uint8_t magic[] = { 0x49, 0x63, 0x65, 0x50 }; // 'I', 'c', 'e', 'P' -const Ice::Byte requestHdr[] = +const uint8_t requestHdr[] = { magic[0], magic[1], @@ -26,7 +26,7 @@ const Ice::Byte requestHdr[] = 0, 0, 0, 0 // Request id (placeholder) }; -const Ice::Byte requestBatchHdr[] = +const uint8_t requestBatchHdr[] = { magic[0], magic[1], @@ -42,7 +42,7 @@ const Ice::Byte requestBatchHdr[] = 0, 0, 0, 0 // Number of requests in batch (placeholder) }; -const Ice::Byte replyHdr[] = +const uint8_t replyHdr[] = { magic[0], magic[1], @@ -58,7 +58,7 @@ const Ice::Byte replyHdr[] = }; void -stringToMajorMinor(const std::string& str, Ice::Byte& major, Ice::Byte& minor) +stringToMajorMinor(const std::string& str, uint8_t& major, uint8_t& minor) { std::string::size_type pos = str.find_first_of("."); if(pos == std::string::npos) @@ -85,8 +85,8 @@ stringToMajorMinor(const std::string& str, Ice::Byte& major, Ice::Byte& minor) throw Ice::VersionParseException(__FILE__, __LINE__, "range error in version `" + str + "'"); } - major = static_cast(majVersion); - minor = static_cast(minVersion); + major = static_cast(majVersion); + minor = static_cast(minVersion); } void diff --git a/cpp/src/Ice/ProxyAsync.cpp b/cpp/src/Ice/ProxyAsync.cpp index 72e37e08240..263261e05f7 100644 --- a/cpp/src/Ice/ProxyAsync.cpp +++ b/cpp/src/Ice/ProxyAsync.cpp @@ -20,7 +20,7 @@ using namespace IceInternal; namespace IceInternal { -inline std::pair +inline std::pair makePair(const Ice::ByteSeq& seq) { if(seq.empty()) @@ -134,12 +134,12 @@ class InvokeOutgoingAsyncT : public OutgoingAsync void invoke(string_view operation, Ice::OperationMode mode, - const std::pair& inParams, + const std::pair& inParams, const Ice::Context& context) { _read = [](bool ok, Ice::InputStream* stream) { - const Ice::Byte* encaps; + const uint8_t* encaps; std::int32_t sz; stream->readEncapsulation(encaps, sz); return R { ok, { encaps, encaps + sz } }; @@ -462,17 +462,17 @@ Ice::ObjectPrx::_iceI_id(const shared_ptr>& outAsync, con bool Ice::ObjectPrx::ice_invoke(string_view operation, Ice::OperationMode mode, - const vector &inParams, - vector &outParams, + const vector &inParams, + vector &outParams, const Ice::Context &context) const { return ice_invoke(operation, mode, makePair(inParams), outParams, context); } -std::future>> -Ice::ObjectPrx::ice_invokeAsync(string_view operation, +std::future>> +Ice::ObjectPrx::ice_invokeAsync(const string &operation, Ice::OperationMode mode, - const vector &inParams, + const vector &inParams, const Ice::Context &context) const { return ice_invokeAsync(operation, mode, makePair(inParams), context); @@ -481,17 +481,17 @@ Ice::ObjectPrx::ice_invokeAsync(string_view operation, std::function Ice::ObjectPrx::ice_invokeAsync(string_view operation, Ice::OperationMode mode, - const vector &inParams, - std::function)> response, + const vector &inParams, + std::function)> response, std::function ex, std::function sent, const Ice::Context &context) const { - using Outgoing = InvokeLambdaOutgoing>>; - std::function> &&)> r; + using Outgoing = InvokeLambdaOutgoing>>; + std::function> &&)> r; if (response) { - r = [response = std::move(response)](std::tuple>&& result) + r = [response = std::move(response)](std::tuple>&& result) { auto [success, outParams] = std::move(result); response(success, std::move(outParams)); @@ -505,11 +505,11 @@ Ice::ObjectPrx::ice_invokeAsync(string_view operation, bool Ice::ObjectPrx::ice_invoke(string_view operation, Ice::OperationMode mode, - const std::pair &inParams, - vector &outParams, + const std::pair &inParams, + vector &outParams, const Ice::Context &context) const { - using Outgoing = InvokePromiseOutgoing>>; + using Outgoing = InvokePromiseOutgoing>>; auto outAsync = std::make_shared(*this, true); outAsync->invoke(operation, mode, inParams, context); auto result = outAsync->getFuture().get(); @@ -518,14 +518,14 @@ bool Ice::ObjectPrx::ice_invoke(string_view operation, return success; } -std::future>> -Ice::ObjectPrx::ice_invokeAsync(string_view operation, +std::future>> +Ice::ObjectPrx::ice_invokeAsync(const string &operation, Ice::OperationMode mode, - const std::pair &inParams, + const std::pair &inParams, const Ice::Context &context) const { using Outgoing = - ::IceInternal::InvokePromiseOutgoing<::std::tuple>>; + ::IceInternal::InvokePromiseOutgoing<::std::tuple>>; auto outAsync = ::std::make_shared(*this, false); outAsync->invoke(operation, mode, inParams, context); return outAsync->getFuture(); @@ -534,13 +534,13 @@ Ice::ObjectPrx::ice_invokeAsync(string_view operation, std::function Ice::ObjectPrx::ice_invokeAsync(string_view operation, Ice::OperationMode mode, - const std::pair &inParams, - std::function)> response, + const std::pair &inParams, + std::function)> response, std::function ex, std::function sent, const Ice::Context &context) const { - using Result = ::std::tuple>; + using Result = ::std::tuple>; using Outgoing = ::IceInternal::InvokeLambdaOutgoing; ::std::function r; diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 5677f9b4be2..260f996dc41 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -157,7 +157,7 @@ IceInternal::Reference::streamWrite(OutputStream* s) const s->write(&_facet, &_facet + 1); } - s->write(static_cast(_mode)); + s->write(static_cast(_mode)); s->write(_secure); diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp index 725e9fdc655..ca49fe48c4b 100644 --- a/cpp/src/Ice/ReferenceFactory.cpp +++ b/cpp/src/Ice/ReferenceFactory.cpp @@ -533,7 +533,7 @@ IceInternal::ReferenceFactory::create(const Identity& ident, InputStream* s) facet.swap(facetPath[0]); } - Byte modeAsByte; + uint8_t modeAsByte; s->read(modeAsByte); Reference::Mode mode = static_cast(modeAsByte); if(mode < 0 || mode > Reference::ModeLast) diff --git a/cpp/src/Ice/ReplyStatus.h b/cpp/src/Ice/ReplyStatus.h index 8eeac4cb717..3ba84840f53 100644 --- a/cpp/src/Ice/ReplyStatus.h +++ b/cpp/src/Ice/ReplyStatus.h @@ -10,14 +10,14 @@ namespace IceInternal { -static const Ice::Byte replyOK = 0; -static const Ice::Byte replyUserException = 1; -static const Ice::Byte replyObjectNotExist = 2; -static const Ice::Byte replyFacetNotExist = 3; -static const Ice::Byte replyOperationNotExist = 4; -static const Ice::Byte replyUnknownLocalException = 5; -static const Ice::Byte replyUnknownUserException = 6; -static const Ice::Byte replyUnknownException = 7; +static const std::uint8_t replyOK = 0; +static const std::uint8_t replyUserException = 1; +static const std::uint8_t replyObjectNotExist = 2; +static const std::uint8_t replyFacetNotExist = 3; +static const std::uint8_t replyOperationNotExist = 4; +static const std::uint8_t replyUnknownLocalException = 5; +static const std::uint8_t replyUnknownUserException = 6; +static const std::uint8_t replyUnknownException = 7; } diff --git a/cpp/src/Ice/ResponseHandler.h b/cpp/src/Ice/ResponseHandler.h index 17a95d0ce6a..2a1cdfa8ae2 100644 --- a/cpp/src/Ice/ResponseHandler.h +++ b/cpp/src/Ice/ResponseHandler.h @@ -24,7 +24,7 @@ class ResponseHandler : public EnableSharedFromThis { public: - virtual void sendResponse(std::int32_t, Ice::OutputStream*, Ice::Byte, bool) = 0; + virtual void sendResponse(std::int32_t, Ice::OutputStream*, std::uint8_t, bool) = 0; virtual void sendNoResponse() = 0; virtual bool systemException(std::int32_t, std::exception_ptr, bool) = 0; virtual void invokeException(std::int32_t, std::exception_ptr, int, bool) = 0; diff --git a/cpp/src/Ice/TraceUtil.cpp b/cpp/src/Ice/TraceUtil.cpp index 9a8ab48a987..1e630e76529 100644 --- a/cpp/src/Ice/TraceUtil.cpp +++ b/cpp/src/Ice/TraceUtil.cpp @@ -48,7 +48,7 @@ printIdentityFacetOperation(ostream& s, InputStream& stream) } static string -getMessageTypeAsString(Byte type) +getMessageTypeAsString(uint8_t type) { switch(type) { @@ -72,7 +72,7 @@ printRequestHeader(ostream& s, InputStream& stream) { printIdentityFacetOperation(s, stream); - Byte mode; + uint8_t mode; stream.read(mode); s << "\nmode = " << static_cast(mode) << ' '; switch(static_cast(mode)) @@ -123,34 +123,34 @@ printRequestHeader(ostream& s, InputStream& stream) } } -static Byte +static uint8_t printHeader(ostream& s, InputStream& stream) { - Byte magicNumber; + uint8_t magicNumber; stream.read(magicNumber); // Don't bother printing the magic number stream.read(magicNumber); stream.read(magicNumber); stream.read(magicNumber); - Byte pMajor; - Byte pMinor; + uint8_t pMajor; + uint8_t pMinor; stream.read(pMajor); stream.read(pMinor); // s << "\nprotocol version = " << static_cast(pMajor) // << "." << static_cast(pMinor); - Byte eMajor; - Byte eMinor; + uint8_t eMajor; + uint8_t eMinor; stream.read(eMajor); stream.read(eMinor); // s << "\nencoding version = " << static_cast(eMajor) // << "." << static_cast(eMinor); - Byte type; + uint8_t type; stream.read(type); s << "\nmessage type = " << static_cast(type) << " (" << getMessageTypeAsString(type) << ')'; - Byte compress; + uint8_t compress; stream.read(compress); s << "\ncompression status = " << static_cast(compress) << ' '; @@ -223,7 +223,7 @@ printReply(ostream& s, InputStream& stream) stream.read(requestId); s << "\nrequest id = " << requestId; - Byte replyStatus; + uint8_t replyStatus; stream.read(replyStatus); s << "\nreply status = " << static_cast(replyStatus) << ' '; switch(replyStatus) @@ -329,10 +329,10 @@ printReply(ostream& s, InputStream& stream) } } -static Byte +static uint8_t printMessage(ostream& s, InputStream& stream) { - Byte type = printHeader(s, stream); + uint8_t type = printHeader(s, stream); switch(type) { @@ -403,7 +403,7 @@ IceInternal::traceSend(const OutputStream& str, const LoggerPtr& logger, const T is.i = is.b.begin(); ostringstream s; - Byte type = printMessage(s, is); + uint8_t type = printMessage(s, is); logger->trace(tl->protocolCat, "sending " + getMessageTypeAsString(type) + " " + s.str()); } @@ -419,7 +419,7 @@ IceInternal::traceRecv(const InputStream& str, const LoggerPtr& logger, const Tr stream.i = stream.b.begin(); ostringstream s; - Byte type = printMessage(s, stream); + uint8_t type = printMessage(s, stream); logger->trace(tl->protocolCat, "received " + getMessageTypeAsString(type) + " " + s.str()); stream.i = p; diff --git a/cpp/src/Ice/UdpEndpointI.cpp b/cpp/src/Ice/UdpEndpointI.cpp index c177ca5ec98..d85f015e9d5 100644 --- a/cpp/src/Ice/UdpEndpointI.cpp +++ b/cpp/src/Ice/UdpEndpointI.cpp @@ -69,7 +69,7 @@ IceInternal::UdpEndpointI::UdpEndpointI(const ProtocolInstancePtr& instance, Inp { if(s->getEncoding() == Ice::Encoding_1_0) { - Ice::Byte b; + uint8_t b; s->read(b); s->read(b); s->read(b); @@ -398,7 +398,7 @@ IceInternal::UdpEndpointI::checkOption(const string& option, const string& argum } try { - Ice::Byte major, minor; + uint8_t major, minor; IceInternal::stringToMajorMinor(argument, major, minor); if(major != 1 || minor != 0) { diff --git a/cpp/src/Ice/WSTransceiver.cpp b/cpp/src/Ice/WSTransceiver.cpp index 07c9d7008de..335d60846ee 100644 --- a/cpp/src/Ice/WSTransceiver.cpp +++ b/cpp/src/Ice/WSTransceiver.cpp @@ -59,13 +59,13 @@ const string _wsUUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; // // Rename to avoid conflict with OS 10.10 htonll // -void ice_htonll(int64_t v, Byte* dest) +void ice_htonll(int64_t v, uint8_t* dest) { // // Transfer a 64-bit integer in network (big-endian) order. // #ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast(&v); + const uint8_t* src = reinterpret_cast(&v); *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; @@ -75,7 +75,7 @@ void ice_htonll(int64_t v, Byte* dest) *dest++ = *src++; *dest = *src; #else - const Byte* src = reinterpret_cast(&v) + sizeof(int64_t) - 1; + const uint8_t* src = reinterpret_cast(&v) + sizeof(int64_t) - 1; *dest++ = *src--; *dest++ = *src--; *dest++ = *src--; @@ -90,7 +90,7 @@ void ice_htonll(int64_t v, Byte* dest) // // Rename to avoid conflict with OS 10.10 nlltoh // -int64_t ice_nlltoh(const Byte* src) +int64_t ice_nlltoh(const uint8_t* src) { int64_t v; @@ -98,7 +98,7 @@ int64_t ice_nlltoh(const Byte* src) // Extract a 64-bit integer in network (big-endian) order. // #ifdef ICE_BIG_ENDIAN - Byte* dest = reinterpret_cast(&v); + uint8_t* dest = reinterpret_cast(&v); *dest++ = *src++; *dest++ = *src++; *dest++ = *src++; @@ -108,7 +108,7 @@ int64_t ice_nlltoh(const Byte* src) *dest++ = *src++; *dest = *src; #else - Byte* dest = reinterpret_cast(&v) + sizeof(int64_t) - 1; + uint8_t* dest = reinterpret_cast(&v) + sizeof(int64_t) - 1; *dest-- = *src++; *dest-- = *src++; *dest-- = *src++; @@ -236,7 +236,7 @@ IceInternal::WSTransceiver::initialize(Buffer& readBuffer, Buffer& writeBuffer) // // Check if we have enough data for a complete message. // - const Ice::Byte* p = _parser->isCompleteMessage(&_readBuffer.b[0], _readBuffer.i); + const uint8_t* p = _parser->isCompleteMessage(&_readBuffer.b[0], _readBuffer.i); if(!p) { if(_readBuffer.i < _readBuffer.b.end()) @@ -1656,7 +1656,7 @@ IceInternal::WSTransceiver::readBuffered(IceInternal::Buffer::Container::size_ty } void -IceInternal::WSTransceiver::prepareWriteHeader(Byte opCode, IceInternal::Buffer::Container::size_type payloadLength) +IceInternal::WSTransceiver::prepareWriteHeader(uint8_t opCode, IceInternal::Buffer::Container::size_type payloadLength) { // // We need to prepare the frame header. @@ -1667,21 +1667,21 @@ IceInternal::WSTransceiver::prepareWriteHeader(Byte opCode, IceInternal::Buffer: // // Set the opcode - this is the one and only data frame. // - *_writeBuffer.i++ = static_cast(opCode | FLAG_FINAL); + *_writeBuffer.i++ = static_cast(opCode | FLAG_FINAL); // // Set the payload length. // if(payloadLength <= 125) { - *_writeBuffer.i++ = static_cast(payloadLength); + *_writeBuffer.i++ = static_cast(payloadLength); } else if(payloadLength > 125 && payloadLength <= USHRT_MAX) { // // Use an extra 16 bits to encode the payload length. // - *_writeBuffer.i++ = static_cast(126); + *_writeBuffer.i++ = static_cast(126); *reinterpret_cast(_writeBuffer.i) = htons(static_cast(payloadLength)); _writeBuffer.i += 2; } @@ -1690,7 +1690,7 @@ IceInternal::WSTransceiver::prepareWriteHeader(Byte opCode, IceInternal::Buffer: // // Use an extra 64 bits to encode the payload length. // - *_writeBuffer.i++ = static_cast(127); + *_writeBuffer.i++ = static_cast(127); ice_htonll(static_cast(payloadLength), _writeBuffer.i); _writeBuffer.i += 8; } diff --git a/cpp/src/Ice/WSTransceiver.h b/cpp/src/Ice/WSTransceiver.h index 8886c5e61ff..a173c309d0f 100644 --- a/cpp/src/Ice/WSTransceiver.h +++ b/cpp/src/Ice/WSTransceiver.h @@ -62,7 +62,7 @@ class WSTransceiver final : public Transceiver bool postWrite(Buffer&); bool readBuffered(Buffer::Container::size_type); - void prepareWriteHeader(Ice::Byte, Buffer::Container::size_type); + void prepareWriteHeader(std::uint8_t, Buffer::Container::size_type); friend class WSConnector; friend class WSAcceptor; @@ -133,7 +133,7 @@ class WSTransceiver final : public Transceiver bool _closingInitiator; int _closingReason; - std::vector _pingPayload; + std::vector _pingPayload; }; } diff --git a/cpp/src/IceBridge/IceBridge.cpp b/cpp/src/IceBridge/IceBridge.cpp index a82fad680e6..0502f80c60d 100644 --- a/cpp/src/IceBridge/IceBridge.cpp +++ b/cpp/src/IceBridge/IceBridge.cpp @@ -24,8 +24,8 @@ struct QueuedDispatch final // The pointers in p refer to the Ice marshaling buffer and won't remain valid after // ice_invokeAsync completes, so we have to make a copy of the in parameters // - QueuedDispatch(pair p, - function&)>&& r, + QueuedDispatch(pair p, + function&)>&& r, function&& e, const Current& c) : inParams(p.first, p.second), response(std::move(r)), error(std::move(e)), current(c) @@ -37,8 +37,8 @@ struct QueuedDispatch final // Make sure we don't copy this struct by accident QueuedDispatch(const QueuedDispatch&) = delete; - const vector inParams; - function&)> response; + const vector inParams; + function&)> response; function error; const Current current; }; @@ -103,15 +103,15 @@ class BridgeConnection final void outgoingException(exception_ptr); void closed(const shared_ptr&); - void dispatch(pair, - function&)>, + void dispatch(pair, + function&)>, function, const Current&); private: void send(const shared_ptr&, - pair, - function&)>, + pair, + function&)>, function, const Current& current); @@ -141,8 +141,8 @@ class BridgeI final : public Ice::BlobjectArrayAsync, public enable_shared_from_ BridgeI(shared_ptr adapter, ObjectPrxPtr target); - void ice_invokeAsync(pair inEncaps, - function&)> response, + void ice_invokeAsync(pair inEncaps, + function&)> response, function error, const Current& current) override; @@ -312,8 +312,8 @@ BridgeConnection::closed(const shared_ptr& con) } void -BridgeConnection::dispatch(pair inParams, - function&)> response, +BridgeConnection::dispatch(pair inParams, + function&)> response, function error, const Current& current) { @@ -343,8 +343,8 @@ BridgeConnection::dispatch(pair inParams, void BridgeConnection::send(const shared_ptr& dest, - pair inParams, - function&)> response, + pair inParams, + function&)> response, function error, const Current& current) { @@ -386,8 +386,8 @@ BridgeI::BridgeI(shared_ptr adapter, ObjectPrxPtr target) : } void -BridgeI::ice_invokeAsync(pair inParams, - function&)> response, +BridgeI::ice_invokeAsync(pair inParams, + function&)> response, function error, const Current& current) { diff --git a/cpp/src/IceDB/IceDB.h b/cpp/src/IceDB/IceDB.h index f8af947b4b6..82d2285e0cb 100644 --- a/cpp/src/IceDB/IceDB.h +++ b/cpp/src/IceDB/IceDB.h @@ -478,8 +478,8 @@ struct Codec { static void read(T& t, const MDB_val& val, const IceContext& ctx) { - std::pair p(static_cast(val.mv_data), - static_cast(val.mv_data) + val.mv_size); + std::pair p(static_cast(val.mv_data), + static_cast(val.mv_data) + val.mv_size); Ice::InputStream in(ctx.communicator, ctx.encoding, p); in.read(t); } @@ -495,8 +495,8 @@ struct Codec static bool write(const T& t, MDB_val& val, const IceContext& ctx) { const size_t limit = val.mv_size; - std::pair p(reinterpret_cast(val.mv_data), - reinterpret_cast(val.mv_data) + limit); + std::pair p(reinterpret_cast(val.mv_data), + reinterpret_cast(val.mv_data) + limit); Ice::OutputStream stream(ctx.communicator, ctx.encoding, p); stream.write(t); val.mv_size = stream.b.size(); diff --git a/cpp/src/IceGrid/AdminCallbackRouter.cpp b/cpp/src/IceGrid/AdminCallbackRouter.cpp index f5e439c7185..844151d0929 100644 --- a/cpp/src/IceGrid/AdminCallbackRouter.cpp +++ b/cpp/src/IceGrid/AdminCallbackRouter.cpp @@ -34,8 +34,8 @@ AdminCallbackRouter::removeMapping(const string& category) } void -AdminCallbackRouter::ice_invokeAsync(pair inParams, - function&)> response, +AdminCallbackRouter::ice_invokeAsync(pair inParams, + function&)> response, function exception, const Ice::Current& current) { diff --git a/cpp/src/IceGrid/AdminCallbackRouter.h b/cpp/src/IceGrid/AdminCallbackRouter.h index 7e8184408c7..db5e8c83c8a 100644 --- a/cpp/src/IceGrid/AdminCallbackRouter.h +++ b/cpp/src/IceGrid/AdminCallbackRouter.h @@ -24,8 +24,8 @@ class AdminCallbackRouter : public Ice::BlobjectArrayAsync void addMapping(const std::string&, const std::shared_ptr&); void removeMapping(const std::string&); - void ice_invokeAsync(std::pair, - std::function&)>, + void ice_invokeAsync(std::pair, + std::function&)>, std::function, const Ice::Current& current) override; diff --git a/cpp/src/IceGrid/AdminRouter.cpp b/cpp/src/IceGrid/AdminRouter.cpp index b6c2c8c731f..0a8465643e2 100644 --- a/cpp/src/IceGrid/AdminRouter.cpp +++ b/cpp/src/IceGrid/AdminRouter.cpp @@ -14,8 +14,8 @@ IceGrid::AdminRouter::AdminRouter(const shared_ptr& traceLevels) : void IceGrid::AdminRouter::invokeOnTarget(const Ice::ObjectPrxPtr& target, - const pair& inParams, - function&)>&& response, + const pair& inParams, + function&)>&& response, function&& exception, const Ice::Current& current) { diff --git a/cpp/src/IceGrid/AdminRouter.h b/cpp/src/IceGrid/AdminRouter.h index 6535bf64707..d8851c204fd 100644 --- a/cpp/src/IceGrid/AdminRouter.h +++ b/cpp/src/IceGrid/AdminRouter.h @@ -21,8 +21,8 @@ class AdminRouter : public Ice::BlobjectArrayAsync AdminRouter(const std::shared_ptr&); void invokeOnTarget(const Ice::ObjectPrxPtr&, - const std::pair&, - std::function&)>&&, + const std::pair&, + std::function&)>&&, std::function&&, const Ice::Current&); diff --git a/cpp/src/IceGrid/AdminSessionI.cpp b/cpp/src/IceGrid/AdminSessionI.cpp index 08c33928923..96dabb3a42e 100644 --- a/cpp/src/IceGrid/AdminSessionI.cpp +++ b/cpp/src/IceGrid/AdminSessionI.cpp @@ -29,8 +29,8 @@ class SubscriberForwarderI : public Ice::BlobjectArrayAsync } void - ice_invokeAsync(pair inParams, - function&)> response, + ice_invokeAsync(pair inParams, + function&)> response, function exception, const Ice::Current& current) override { _proxy->ice_invokeAsync(current.operation, current.mode, inParams, diff --git a/cpp/src/IceGrid/NodeAdminRouter.cpp b/cpp/src/IceGrid/NodeAdminRouter.cpp index 5c6e9ba358f..c27e7cb9671 100644 --- a/cpp/src/IceGrid/NodeAdminRouter.cpp +++ b/cpp/src/IceGrid/NodeAdminRouter.cpp @@ -18,8 +18,8 @@ NodeServerAdminRouter::NodeServerAdminRouter(const shared_ptr& node) : } void -NodeServerAdminRouter::ice_invokeAsync(pair inParams, - function&)> response, +NodeServerAdminRouter::ice_invokeAsync(pair inParams, + function&)> response, function exception, const Ice::Current& current) { diff --git a/cpp/src/IceGrid/NodeAdminRouter.h b/cpp/src/IceGrid/NodeAdminRouter.h index b32f0f6011c..41a3265f025 100644 --- a/cpp/src/IceGrid/NodeAdminRouter.h +++ b/cpp/src/IceGrid/NodeAdminRouter.h @@ -20,8 +20,8 @@ class NodeServerAdminRouter final : public AdminRouter NodeServerAdminRouter(const std::shared_ptr&); - void ice_invokeAsync(std::pair, - std::function&)>, + void ice_invokeAsync(std::pair, + std::function&)>, std::function, const Ice::Current& current) override; diff --git a/cpp/src/IceGrid/RegistryAdminRouter.cpp b/cpp/src/IceGrid/RegistryAdminRouter.cpp index f5006983be3..81eccece250 100644 --- a/cpp/src/IceGrid/RegistryAdminRouter.cpp +++ b/cpp/src/IceGrid/RegistryAdminRouter.cpp @@ -19,8 +19,8 @@ class SynchronizationCallbackI final : public SynchronizationCallback public: SynchronizationCallbackI(const shared_ptr& adminRouter, - const pair& inParams, - function&)> response, + const pair& inParams, + function&)> response, function exception, const Current& current) : _adminRouter(adminRouter), @@ -48,9 +48,9 @@ class SynchronizationCallbackI final : public SynchronizationCallback private: const shared_ptr _adminRouter; - function&)> _response; + function&)> _response; function _exception; - const vector _inParams; + const vector _inParams; const Current _current; }; @@ -63,8 +63,8 @@ RegistryServerAdminRouter::RegistryServerAdminRouter(const shared_ptr& } void -RegistryServerAdminRouter::ice_invokeAsync(pair inParams, - function&)> response, +RegistryServerAdminRouter::ice_invokeAsync(pair inParams, + function&)> response, function exception, const Ice::Current& current) { @@ -112,8 +112,8 @@ RegistryNodeAdminRouter::RegistryNodeAdminRouter(const string& collocNodeName, c } void -RegistryNodeAdminRouter::ice_invokeAsync(pair inParams, - function&)> response, +RegistryNodeAdminRouter::ice_invokeAsync(pair inParams, + function&)> response, function exception, const Ice::Current& current) { @@ -163,8 +163,8 @@ RegistryReplicaAdminRouter::RegistryReplicaAdminRouter(const string& name, } void -RegistryReplicaAdminRouter::ice_invokeAsync(pair inParams, - function&)> response, +RegistryReplicaAdminRouter::ice_invokeAsync(pair inParams, + function&)> response, function exception, const Ice::Current& current) { diff --git a/cpp/src/IceGrid/RegistryAdminRouter.h b/cpp/src/IceGrid/RegistryAdminRouter.h index 3e214c21cee..9ab5c1600c4 100644 --- a/cpp/src/IceGrid/RegistryAdminRouter.h +++ b/cpp/src/IceGrid/RegistryAdminRouter.h @@ -18,8 +18,8 @@ class RegistryServerAdminRouter final : public AdminRouter, RegistryServerAdminRouter(const std::shared_ptr&); - void ice_invokeAsync(std::pair, - std::function&)>, + void ice_invokeAsync(std::pair, + std::function&)>, std::function, const Ice::Current& current) override; @@ -34,8 +34,8 @@ class RegistryNodeAdminRouter final : public AdminRouter RegistryNodeAdminRouter(const std::string&, const std::shared_ptr&); - void ice_invokeAsync(std::pair, - std::function&)>, + void ice_invokeAsync(std::pair, + std::function&)>, std::function, const Ice::Current& current) override; @@ -51,8 +51,8 @@ class RegistryReplicaAdminRouter final : public AdminRouter RegistryReplicaAdminRouter(const std::string&, const std::shared_ptr&); - void ice_invokeAsync(std::pair, - std::function&)>, + void ice_invokeAsync(std::pair, + std::function&)>, std::function, const Ice::Current& current) override; diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index b270ae3b46e..45943c31b66 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -41,7 +41,7 @@ namespace IceGrid void chownRecursive(const string& path, uid_t uid, gid_t gid) { - vector > namelist; + vector > namelist; DIR* d; if((d = opendir(path.c_str())) == 0) { diff --git a/cpp/src/IceLocatorDiscovery/PluginI.cpp b/cpp/src/IceLocatorDiscovery/PluginI.cpp index 25c818c5455..f6e3739d816 100644 --- a/cpp/src/IceLocatorDiscovery/PluginI.cpp +++ b/cpp/src/IceLocatorDiscovery/PluginI.cpp @@ -19,7 +19,7 @@ namespace { class LocatorI; // Forward declaration -typedef std::pair&)>, +typedef std::pair&)>, function> AMDCallback; class Request : public std::enable_shared_from_this @@ -29,7 +29,7 @@ class Request : public std::enable_shared_from_this Request(LocatorI* locator, const string& operation, Ice::OperationMode mode, - const pair& inParams, + const pair& inParams, const Ice::Context& ctx, const AMDCallback& amdCB) : _locator(locator), @@ -42,7 +42,7 @@ class Request : public std::enable_shared_from_this } void invoke(const Ice::LocatorPrxPtr&); - void response(bool, const pair&); + void response(bool, const pair&); void exception(std::exception_ptr); protected: @@ -68,8 +68,8 @@ class LocatorI : public Ice::BlobjectArrayAsync, LocatorI(const string&, const LookupPrxPtr&, const Ice::PropertiesPtr&, const string&, const Ice::LocatorPrxPtr&); void setLookupReply(const LookupReplyPrxPtr&); - virtual void ice_invokeAsync(pair, - function&)>, + virtual void ice_invokeAsync(pair, + function&)>, function, const Ice::Current&); @@ -325,9 +325,9 @@ Request::invoke(const Ice::LocatorPrxPtr& l) { auto self = shared_from_this(); l->ice_invokeAsync(_operation, _mode, _inParams, - [self](bool ok, vector outParams) + [self](bool ok, vector outParams) { - pair outPair; + pair outPair; if(outParams.empty()) { outPair.first = outPair.second = 0; @@ -359,7 +359,7 @@ Request::invoke(const Ice::LocatorPrxPtr& l) } void -Request::response(bool ok, const pair& outParams) +Request::response(bool ok, const pair& outParams) { _amdCB.first(ok, outParams); } @@ -477,8 +477,8 @@ LocatorI::setLookupReply(const LookupReplyPrxPtr& lookupReply) } void -LocatorI::ice_invokeAsync(pair inParams, - function&)> responseCB, +LocatorI::ice_invokeAsync(pair inParams, + function&)> responseCB, function exceptionCB, const Ice::Current& current) { diff --git a/cpp/src/IcePatch2/FileServerI.cpp b/cpp/src/IcePatch2/FileServerI.cpp index ecd42a8f26a..7b385e18a00 100644 --- a/cpp/src/IcePatch2/FileServerI.cpp +++ b/cpp/src/IcePatch2/FileServerI.cpp @@ -70,21 +70,21 @@ IcePatch2::FileServerI::getFileCompressedAsync( string pa, int32_t pos, int32_t num, - function& returnValue)> response, + function& returnValue)> response, function exception, const Current&) const { try { - vector buffer; + vector buffer; getFileCompressedInternal(std::move(pa), pos, num, buffer, false); if(buffer.empty()) { - response(make_pair(0, 0)); + response(make_pair(0, 0)); } else { - response(make_pair(&buffer[0], &buffer[0] + buffer.size())); + response(make_pair(&buffer[0], &buffer[0] + buffer.size())); } } catch(const std::exception&) @@ -98,21 +98,21 @@ IcePatch2::FileServerI::getLargeFileCompressedAsync( string pa, int64_t pos, int32_t num, - function& returnValue)> response, + function& returnValue)> response, function exception, const Current&) const { try { - vector buffer; + vector buffer; getFileCompressedInternal(std::move(pa), pos, num, buffer, true); if(buffer.empty()) { - response(make_pair(0, 0)); + response(make_pair(0, 0)); } else { - response(make_pair(&buffer[0], &buffer[0] + buffer.size())); + response(make_pair(&buffer[0], &buffer[0] + buffer.size())); } } @@ -127,7 +127,7 @@ IcePatch2::FileServerI::getFileCompressedInternal( std::string pa, int64_t pos, int32_t num, - vector& buffer, + vector& buffer, bool largeFile) const { if(IceUtilInternal::isAbsolutePath(pa)) diff --git a/cpp/src/IcePatch2/FileServerI.h b/cpp/src/IcePatch2/FileServerI.h index bb6bc137209..8e79eb66c89 100644 --- a/cpp/src/IcePatch2/FileServerI.h +++ b/cpp/src/IcePatch2/FileServerI.h @@ -30,7 +30,7 @@ class FileServerI : public FileServer std::string, std::int32_t, std::int32_t, - std::function& returnValue)>, + std::function& returnValue)>, std::function, const Ice::Current&) const; @@ -38,7 +38,7 @@ class FileServerI : public FileServer std::string, std::int64_t, std::int32_t, - std::function& returnValue)>, + std::function& returnValue)>, std::function, const Ice::Current&) const; @@ -49,7 +49,7 @@ class FileServerI : public FileServer std::string, std::int64_t, std::int32_t, - std::vector&, + std::vector&, bool) const; const std::string _dataDir; diff --git a/cpp/src/IcePatch2Lib/ClientUtil.cpp b/cpp/src/IcePatch2Lib/ClientUtil.cpp index 52a95868b25..3a213973da0 100644 --- a/cpp/src/IcePatch2Lib/ClientUtil.cpp +++ b/cpp/src/IcePatch2Lib/ClientUtil.cpp @@ -848,7 +848,7 @@ void getFileCompressed( path, static_cast(pos), chunkSize, - [cb](std::pair result) { cb->complete(ByteSeq(result.first, result.second)); }, + [cb](std::pair result) { cb->complete(ByteSeq(result.first, result.second)); }, [cb](exception_ptr exception) { cb->exception(exception); }); } else @@ -857,7 +857,7 @@ void getFileCompressed( path, pos, chunkSize, - [cb](std::pair result) { cb->complete(ByteSeq(result.first, result.second)); }, + [cb](std::pair result) { cb->complete(ByteSeq(result.first, result.second)); }, [cb](exception_ptr exception) { cb->exception(exception); }); } } diff --git a/cpp/src/IcePatch2Lib/Util.cpp b/cpp/src/IcePatch2Lib/Util.cpp index 4df0273e6b2..80cac642366 100644 --- a/cpp/src/IcePatch2Lib/Util.cpp +++ b/cpp/src/IcePatch2Lib/Util.cpp @@ -196,7 +196,7 @@ IcePatch2Internal::stringToBytes(const string& str) } } - bytes.push_back(static_cast(byte)); + bytes.push_back(static_cast(byte)); } return bytes; @@ -596,7 +596,7 @@ IcePatch2Internal::compressBytesToFile(const string& pa, const ByteSeq& bytes, i throw runtime_error(reason); } - BZ2_bzWrite(&bzError, bzFile, const_cast(&bytes[static_cast(pos)]), + BZ2_bzWrite(&bzError, bzFile, const_cast(&bytes[static_cast(pos)]), static_cast(bytes.size()) - pos); if(bzError != BZ_OK) { @@ -662,7 +662,7 @@ IcePatch2Internal::decompressFile(const string& pa) } const int32_t numBZ2 = 64 * 1024; - Byte bytesBZ2[numBZ2]; + uint8_t bytesBZ2[numBZ2]; while(bzError != BZ_STREAM_END) { @@ -827,7 +827,7 @@ getFileInfoSeqInternal(const string& basePath, const string& relPath, int compre } else { - fill(bytesSHA.begin(), bytesSHA.end(), Byte(0)); + fill(bytesSHA.begin(), bytesSHA.end(), uint8_t(0)); } info.checksum.swap(bytesSHA); @@ -888,14 +888,14 @@ getFileInfoSeqInternal(const string& basePath, const string& relPath, int compre if(relPath.size() == 0 && buf.st_size == 0) { bytesSHA.resize(20); - fill(bytesSHA.begin(), bytesSHA.end(), Byte(0)); + fill(bytesSHA.begin(), bytesSHA.end(), uint8_t(0)); } else { IceInternal::SHA1 hasher; if(relPath.size() != 0) { - hasher.update(reinterpret_cast(relPath.c_str()), relPath.size()); + hasher.update(reinterpret_cast(relPath.c_str()), relPath.size()); } if(buf.st_size != 0) @@ -956,7 +956,7 @@ getFileInfoSeqInternal(const string& basePath, const string& relPath, int compre bytesLeft -= static_cast(bytes.size()); if(doCompress) { - BZ2_bzWrite(&bzError, bzFile, const_cast(&bytes[0]), static_cast(bytes.size())); + BZ2_bzWrite(&bzError, bzFile, const_cast(&bytes[0]), static_cast(bytes.size())); if(bzError != BZ_OK) { string reason = "BZ2_bzWrite failed"; @@ -971,7 +971,7 @@ getFileInfoSeqInternal(const string& basePath, const string& relPath, int compre } } - hasher.update(reinterpret_cast(&bytes[0]), bytes.size()); + hasher.update(reinterpret_cast(&bytes[0]), bytes.size()); } IceUtilInternal::close(fd); @@ -1227,7 +1227,7 @@ IcePatch2Internal::getFileTree0(const LargeFileInfoSeq& infoSeq, FileTree0& tree } else { - fill(tree1.checksum.begin(), tree1.checksum.end(), Byte(0)); + fill(tree1.checksum.begin(), tree1.checksum.end(), uint8_t(0)); } copy(tree1.checksum.begin(), tree1.checksum.end(), c0); @@ -1239,6 +1239,6 @@ IcePatch2Internal::getFileTree0(const LargeFileInfoSeq& infoSeq, FileTree0& tree } else { - fill(tree0.checksum.begin(), tree0.checksum.end(), Byte(0)); + fill(tree0.checksum.begin(), tree0.checksum.end(), uint8_t(0)); } } diff --git a/cpp/src/IceSSL/OpenSSLCertificateI.cpp b/cpp/src/IceSSL/OpenSSLCertificateI.cpp index 641ceeaef1b..80a24b71a3c 100644 --- a/cpp/src/IceSSL/OpenSSLCertificateI.cpp +++ b/cpp/src/IceSSL/OpenSSLCertificateI.cpp @@ -207,7 +207,7 @@ class OpenSSLX509ExtensionI : public IceSSL::X509Extension ~OpenSSLX509ExtensionI(); virtual bool isCritical() const; virtual string getOID() const; - virtual vector getData() const; + virtual vector getData() const; private: @@ -227,8 +227,8 @@ class OpenSSLCertificateI : public IceSSL::OpenSSL::Certificate, virtual bool operator==(const IceSSL::Certificate&) const; - virtual vector getAuthorityKeyIdentifier() const; - virtual vector getSubjectKeyIdentifier() const; + virtual vector getAuthorityKeyIdentifier() const; + virtual vector getSubjectKeyIdentifier() const; virtual bool verify(const IceSSL::CertificatePtr&) const; virtual string encode() const; @@ -285,10 +285,10 @@ OpenSSLX509ExtensionI::getOID() const return _oid; } -vector +vector OpenSSLX509ExtensionI::getData() const { - vector data; + vector data; ASN1_OCTET_STRING* buffer = X509_EXTENSION_get_data(_extension); assert(buffer); data.resize(buffer->length); @@ -327,10 +327,10 @@ OpenSSLCertificateI::operator==(const IceSSL::Certificate& r) const return X509_cmp(_cert, p->_cert) == 0; } -vector +vector OpenSSLCertificateI::getAuthorityKeyIdentifier() const { - vector keyid; + vector keyid; int index = X509_get_ext_by_NID(_cert, NID_authority_key_identifier, -1); if(index >= 0) { @@ -350,10 +350,10 @@ OpenSSLCertificateI::getAuthorityKeyIdentifier() const return keyid; } -vector +vector OpenSSLCertificateI::getSubjectKeyIdentifier() const { - vector keyid; + vector keyid; int index = X509_get_ext_by_NID(_cert, NID_subject_key_identifier, -1); if(index >= 0) { diff --git a/cpp/src/IceSSL/SChannelCertificateI.cpp b/cpp/src/IceSSL/SChannelCertificateI.cpp index 65bc44fa062..e59c3fb4d48 100644 --- a/cpp/src/IceSSL/SChannelCertificateI.cpp +++ b/cpp/src/IceSSL/SChannelCertificateI.cpp @@ -48,7 +48,7 @@ class SCHannelX509ExtensionI : public X509Extension SCHannelX509ExtensionI(CERT_EXTENSION , const string&, const CertInfoHolderPtr&); virtual bool isCritical() const; virtual string getOID() const; - virtual vector getData() const; + virtual vector getData() const; private: @@ -68,8 +68,8 @@ class SChannelCertificateI : public SChannel::Certificate, virtual bool operator==(const IceSSL::Certificate&) const; - virtual vector getAuthorityKeyIdentifier() const; - virtual vector getSubjectKeyIdentifier() const; + virtual vector getAuthorityKeyIdentifier() const; + virtual vector getSubjectKeyIdentifier() const; virtual bool verify(const CertificatePtr&) const; virtual string encode() const; @@ -230,11 +230,11 @@ certificateAltNames(CERT_INFO* certInfo, LPCSTR altNameOID) // IPv4 address // ostringstream os; - Byte* src = reinterpret_cast(entry->IPAddress.pbData); + uint8_t* src = reinterpret_cast(entry->IPAddress.pbData); for(int j = 0; j < 4;) { int value = 0; - Byte* dest = reinterpret_cast(&value); + uint8_t* dest = reinterpret_cast(&value); *dest = *src++; os << value; if(++j < 4) @@ -282,10 +282,10 @@ SCHannelX509ExtensionI::getOID() const return _oid; } -vector +vector SCHannelX509ExtensionI::getData() const { - vector data; + vector data; data.resize(_extension.Value.cbData); memcpy(&data[0], _extension.Value.pbData, _extension.Value.cbData); return data; @@ -340,10 +340,10 @@ SChannelCertificateI::operator==(const IceSSL::Certificate& r) const return CertCompareCertificate(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, _certInfo, p->_certInfo) != 0; } -vector +vector SChannelCertificateI::getAuthorityKeyIdentifier() const { - vector keyid; + vector keyid; PCERT_EXTENSION extension = CertFindExtension(szOID_AUTHORITY_KEY_IDENTIFIER2, _certInfo->cExtension, _certInfo->rgExtension); if(extension) @@ -366,10 +366,10 @@ SChannelCertificateI::getAuthorityKeyIdentifier() const return keyid; } -vector +vector SChannelCertificateI::getSubjectKeyIdentifier() const { - vector keyid; + vector keyid; PCERT_EXTENSION extension = CertFindExtension(szOID_SUBJECT_KEY_IDENTIFIER, _certInfo->cExtension, _certInfo->rgExtension); if(extension) diff --git a/cpp/src/IceSSL/SChannelTransceiverI.cpp b/cpp/src/IceSSL/SChannelTransceiverI.cpp index 697749b6861..095f3a6019b 100644 --- a/cpp/src/IceSSL/SChannelTransceiverI.cpp +++ b/cpp/src/IceSSL/SChannelTransceiverI.cpp @@ -597,7 +597,7 @@ SChannel::TransceiverI::decryptMessage(IceInternal::Buffer& buffer) // If we have filled the buffer or if nothing left to read from // the read buffer, we're done. // - Byte* i = buffer.i + length; + uint8_t* i = buffer.i + length; if(i == buffer.b.end() || _readBuffer.i == _readBuffer.b.begin()) { break; @@ -654,7 +654,7 @@ SChannel::TransceiverI::decryptMessage(IceInternal::Buffer& buffer) if(dataBuffer->cbBuffer > remaining) { _readUnprocessed.b.resize(dataBuffer->cbBuffer - remaining); - memcpy(_readUnprocessed.b.begin(), reinterpret_cast(dataBuffer->pvBuffer) + remaining, + memcpy(_readUnprocessed.b.begin(), reinterpret_cast(dataBuffer->pvBuffer) + remaining, dataBuffer->cbBuffer - remaining); } } diff --git a/cpp/src/IceSSL/SecureTransportCertificateI.cpp b/cpp/src/IceSSL/SecureTransportCertificateI.cpp index 5b3da11b41b..a33d7203f26 100644 --- a/cpp/src/IceSSL/SecureTransportCertificateI.cpp +++ b/cpp/src/IceSSL/SecureTransportCertificateI.cpp @@ -258,8 +258,8 @@ class SecureTransportCertificateI final : public IceSSL::SecureTransport::Certif virtual bool operator==(const IceSSL::Certificate&) const; - virtual vector getAuthorityKeyIdentifier() const; - virtual vector getSubjectKeyIdentifier() const; + virtual vector getAuthorityKeyIdentifier() const; + virtual vector getSubjectKeyIdentifier() const; virtual bool verify(const IceSSL::CertificatePtr&) const; virtual string encode() const; @@ -439,13 +439,13 @@ SecureTransportCertificateI::operator==(const IceSSL::Certificate& r) const return CFEqual(_cert.get(), p->_cert.get()); } -vector +vector SecureTransportCertificateI::getAuthorityKeyIdentifier() const { #ifdef ICE_USE_SECURE_TRANSPORT_IOS throw Ice::FeatureNotSupportedException(__FILE__, __LINE__); #else // macOS - vector keyid; + vector keyid; UniqueRef property(getCertificateProperty(_cert.get(), kSecOIDAuthorityKeyIdentifier)); if(property) @@ -479,13 +479,13 @@ SecureTransportCertificateI::getAuthorityKeyIdentifier() const #endif } -vector +vector SecureTransportCertificateI::getSubjectKeyIdentifier() const { #ifdef ICE_USE_SECURE_TRANSPORT_IOS throw Ice::FeatureNotSupportedException(__FILE__, __LINE__); #else // macOS - vector keyid; + vector keyid; UniqueRef property(getCertificateProperty(_cert.get(), kSecOIDSubjectKeyIdentifier)); if(property) { diff --git a/cpp/src/IceSSL/SecureTransportTransceiverI.cpp b/cpp/src/IceSSL/SecureTransportTransceiverI.cpp index 2fbc790b4c8..0579233e092 100644 --- a/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +++ b/cpp/src/IceSSL/SecureTransportTransceiverI.cpp @@ -659,7 +659,7 @@ IceSSL::SecureTransport::TransceiverI::writeRaw(const char* data, size_t* length try { - IceInternal::Buffer buf(reinterpret_cast(data), reinterpret_cast(data) + *length); + IceInternal::Buffer buf(reinterpret_cast(data), reinterpret_cast(data) + *length); IceInternal::SocketOperation op = _delegate->write(buf); if(op == IceInternal::SocketOperationWrite) { @@ -692,7 +692,7 @@ IceSSL::SecureTransport::TransceiverI::readRaw(char* data, size_t* length) const try { - IceInternal::Buffer buf(reinterpret_cast(data), reinterpret_cast(data) + *length); + IceInternal::Buffer buf(reinterpret_cast(data), reinterpret_cast(data) + *length); IceInternal::SocketOperation op = _delegate->read(buf); if(op == IceInternal::SocketOperationRead) { diff --git a/cpp/src/IceSSL/SecureTransportTransceiverI.h b/cpp/src/IceSSL/SecureTransportTransceiverI.h index 703335bb9b9..60b37864dec 100644 --- a/cpp/src/IceSSL/SecureTransportTransceiverI.h +++ b/cpp/src/IceSSL/SecureTransportTransceiverI.h @@ -69,7 +69,7 @@ class TransceiverI final : public IceInternal::Transceiver SSLWantWrite = 0x2 }; - mutable Ice::Byte _tflags; + mutable std::uint8_t _tflags; size_t _maxSendPacketSize; size_t _maxRecvPacketSize; std::string _cipher; diff --git a/cpp/src/IceStorm/IceStormDB.cpp b/cpp/src/IceStorm/IceStormDB.cpp index 2b4b9d23570..37ee10c3ea4 100644 --- a/cpp/src/IceStorm/IceStormDB.cpp +++ b/cpp/src/IceStorm/IceStormDB.cpp @@ -174,9 +174,9 @@ run(const shared_ptr& communicator, const Ice::StringSeq& arg fs.seekg(0, ios::beg); - vector buf; + vector buf; buf.reserve(static_cast(fileSize)); - buf.insert(buf.begin(), istream_iterator(fs), istream_iterator()); + buf.insert(buf.begin(), istream_iterator(fs), istream_iterator()); fs.close(); diff --git a/cpp/src/IceStorm/Subscriber.cpp b/cpp/src/IceStorm/Subscriber.cpp index 3912230337a..6f2b7386cee 100644 --- a/cpp/src/IceStorm/Subscriber.cpp +++ b/cpp/src/IceStorm/Subscriber.cpp @@ -47,8 +47,8 @@ class PerSubscriberPublisherI final : public Ice::BlobjectArray } bool - ice_invoke(pair inParams, - vector&, + ice_invoke(pair inParams, + vector&, const Ice::Current& current) override { // Use cached reads. @@ -296,7 +296,7 @@ SubscriberTwoway::flush() { auto self = static_pointer_cast(shared_from_this()); _obj->ice_invokeAsync(e.op, e.mode, e.data, - [self](bool, vector) + [self](bool, vector) { self->completed(); }, diff --git a/cpp/src/IceStorm/TopicI.cpp b/cpp/src/IceStorm/TopicI.cpp index c64fa09debe..b9a7a76aa3f 100644 --- a/cpp/src/IceStorm/TopicI.cpp +++ b/cpp/src/IceStorm/TopicI.cpp @@ -41,7 +41,7 @@ class PublisherI : public Ice::BlobjectArray } bool - ice_invoke(pair inParams, + ice_invoke(pair inParams, Ice::ByteSeq&, const Ice::Current& current) override { diff --git a/cpp/src/IceStorm/TransientTopicI.cpp b/cpp/src/IceStorm/TransientTopicI.cpp index 59ac32c9cfd..d8245fc0810 100644 --- a/cpp/src/IceStorm/TransientTopicI.cpp +++ b/cpp/src/IceStorm/TransientTopicI.cpp @@ -33,7 +33,7 @@ class TransientPublisherI : public Ice::BlobjectArray } bool - ice_invoke(pair inParams, Ice::ByteSeq&, const Ice::Current& current) override + ice_invoke(pair inParams, Ice::ByteSeq&, const Ice::Current& current) override { // Use cached reads. EventData event = { current.operation, current.mode, Ice::ByteSeq(), current.ctx }; diff --git a/cpp/src/IceUtil/ConsoleUtil.cpp b/cpp/src/IceUtil/ConsoleUtil.cpp index 1fecf0609ba..ab67cce93e6 100644 --- a/cpp/src/IceUtil/ConsoleUtil.cpp +++ b/cpp/src/IceUtil/ConsoleUtil.cpp @@ -49,8 +49,8 @@ ConsoleUtil::toConsoleEncoding(const string& message) const // Then from UTF-8 to console CP string consoleString; - _consoleConverter->fromUTF8(reinterpret_cast (u8s.data()), - reinterpret_cast(u8s.data() + u8s.size()), + _consoleConverter->fromUTF8(reinterpret_cast (u8s.data()), + reinterpret_cast(u8s.data() + u8s.size()), consoleString); return consoleString; diff --git a/cpp/src/IceUtil/StringConverter.cpp b/cpp/src/IceUtil/StringConverter.cpp index f380d4f1fc0..ff3e5c3d91c 100644 --- a/cpp/src/IceUtil/StringConverter.cpp +++ b/cpp/src/IceUtil/StringConverter.cpp @@ -47,7 +47,7 @@ class UnicodeWstringConverter : public WstringConverter { public: - virtual Byte* toUTF8(const wchar_t* sourceStart, const wchar_t* sourceEnd, UTF8Buffer& buffer) const + virtual uint8_t* toUTF8(const wchar_t* sourceStart, const wchar_t* sourceEnd, UTF8Buffer& buffer) const { // // Max bytes for a character encoding in UTF-8 is 4, @@ -83,7 +83,7 @@ class UnicodeWstringConverter : public WstringConverter const size_t chunkSize = std::max(static_cast(sourceEnd - sourceStart) * factor, 4); ++factor; // at the next round, we'll allocate more bytes per remaining source character - targetStart = reinterpret_cast(buffer.getMoreBytes(chunkSize, reinterpret_cast(targetNext))); + targetStart = reinterpret_cast(buffer.getMoreBytes(chunkSize, reinterpret_cast(targetNext))); targetEnd = targetStart + chunkSize; targetNext = targetStart; @@ -128,10 +128,10 @@ class UnicodeWstringConverter : public WstringConverter sourceStart = sourceNext; } while (more); - return reinterpret_cast(targetNext); + return reinterpret_cast(targetNext); } - virtual void fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, wstring& target) const + virtual void fromUTF8(const uint8_t* sourceStart, const uint8_t* sourceEnd, wstring& target) const { const size_t sourceSize = static_cast(sourceEnd - sourceStart); @@ -185,12 +185,12 @@ class UTF8BufferI : public UTF8Buffer // // Returns the first unused byte in the resized buffer // - Byte* getMoreBytes(size_t howMany, Byte* firstUnused) + uint8_t* getMoreBytes(size_t howMany, uint8_t* firstUnused) { size_t bytesUsed = 0; if(firstUnused != 0) { - bytesUsed = static_cast(firstUnused - reinterpret_cast(_buffer.data())); + bytesUsed = static_cast(firstUnused - reinterpret_cast(_buffer.data())); } if(_buffer.size() < howMany + bytesUsed) @@ -198,13 +198,13 @@ class UTF8BufferI : public UTF8Buffer _buffer.resize(bytesUsed + howMany); } - return const_cast(reinterpret_cast(_buffer.data())) + bytesUsed; + return const_cast(reinterpret_cast(_buffer.data())) + bytesUsed; } - void swap(string& other, const Byte* tail) + void swap(string& other, const uint8_t* tail) { - assert(tail >= reinterpret_cast(_buffer.data())); - _buffer.resize(static_cast(tail - reinterpret_cast(_buffer.data()))); + assert(tail >= reinterpret_cast(_buffer.data())); + _buffer.resize(static_cast(tail - reinterpret_cast(_buffer.data()))); other.swap(_buffer); } @@ -272,7 +272,7 @@ IceUtil::wstringToString(const wstring& v, const StringConverterPtr& converter, // First convert to UTF-8 narrow string. // UTF8BufferI buffer; - Byte* last = wConverterWithDefault->toUTF8(v.data(), v.data() + v.size(), buffer); + uint8_t* last = wConverterWithDefault->toUTF8(v.data(), v.data() + v.size(), buffer); buffer.swap(target, last); // @@ -282,8 +282,8 @@ IceUtil::wstringToString(const wstring& v, const StringConverterPtr& converter, if(converter) { string tmp; - converter->fromUTF8(reinterpret_cast(target.data()), - reinterpret_cast(target.data() + target.size()), tmp); + converter->fromUTF8(reinterpret_cast(target.data()), + reinterpret_cast(target.data() + target.size()), tmp); tmp.swap(target); } } @@ -304,7 +304,7 @@ IceUtil::stringToWstring(const string& v, const StringConverterPtr& converter, c if(converter) { UTF8BufferI buffer; - Byte* last = converter->toUTF8(v.data(), v.data() + v.size(), buffer); + uint8_t* last = converter->toUTF8(v.data(), v.data() + v.size(), buffer); buffer.swap(tmp, last); } else @@ -317,8 +317,8 @@ IceUtil::stringToWstring(const string& v, const StringConverterPtr& converter, c // // Convert from UTF-8 to the wide string encoding // - wConverterWithDefault->fromUTF8(reinterpret_cast(tmp.data()), - reinterpret_cast(tmp.data() + tmp.size()), target); + wConverterWithDefault->fromUTF8(reinterpret_cast(tmp.data()), + reinterpret_cast(tmp.data() + tmp.size()), target); } return target; @@ -332,7 +332,7 @@ IceUtil::nativeToUTF8(const string& str, const IceUtil::StringConverterPtr& conv return str; } UTF8BufferI buffer; - Byte* last = converter->toUTF8(str.data(), str.data() + str.size(), buffer); + uint8_t* last = converter->toUTF8(str.data(), str.data() + str.size(), buffer); string result; buffer.swap(result, last); return result; @@ -346,8 +346,8 @@ IceUtil::UTF8ToNative(const string& str, const IceUtil::StringConverterPtr& conv return str; } string tmp; - converter->fromUTF8(reinterpret_cast(str.data()), - reinterpret_cast(str.data() + str.size()), tmp); + converter->fromUTF8(reinterpret_cast(str.data()), + reinterpret_cast(str.data() + str.size()), tmp); return tmp; } @@ -355,7 +355,7 @@ typedef char16_t Char16T; typedef char32_t Char32T; vector -IceUtilInternal::toUTF16(const vector& source) +IceUtilInternal::toUTF16(const vector& source) { vector result; if(!source.empty()) @@ -383,7 +383,7 @@ IceUtilInternal::toUTF16(const vector& source) } vector -IceUtilInternal::toUTF32(const vector& source) +IceUtilInternal::toUTF32(const vector& source) { vector result; if(!source.empty()) @@ -409,10 +409,10 @@ IceUtilInternal::toUTF32(const vector& source) return result; } -vector +vector IceUtilInternal::fromUTF32(const vector& source) { - vector result; + vector result; if(!source.empty()) { assert(sizeof(Char32T) == sizeof(unsigned int)); @@ -425,8 +425,8 @@ IceUtilInternal::fromUTF32(const vector& source) Convert::byte_string bs = convert.to_bytes(reinterpret_cast(&source.front()), reinterpret_cast(&source.front() + source.size())); - result = vector(reinterpret_cast(bs.data()), - reinterpret_cast(bs.data()) + bs.length()); + result = vector(reinterpret_cast(bs.data()), + reinterpret_cast(bs.data()) + bs.length()); } catch(const std::range_error& ex) { @@ -449,9 +449,9 @@ class WindowsStringConverter : public StringConverter explicit WindowsStringConverter(unsigned int); - virtual Byte* toUTF8(const char*, const char*, UTF8Buffer&) const; + virtual uint8_t* toUTF8(const char*, const char*, UTF8Buffer&) const; - virtual void fromUTF8(const Byte*, const Byte*, string& target) const; + virtual void fromUTF8(const uint8_t*, const uint8_t*, string& target) const; private: unsigned int _cp; @@ -462,7 +462,7 @@ WindowsStringConverter::WindowsStringConverter(unsigned int cp) : { } -Byte* +uint8_t* WindowsStringConverter::toUTF8(const char* sourceStart, const char* sourceEnd, UTF8Buffer& buffer) const { // @@ -507,7 +507,7 @@ WindowsStringConverter::toUTF8(const char* sourceStart, const char* sourceEnd, U } void -WindowsStringConverter::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, string& target) const +WindowsStringConverter::fromUTF8(const uint8_t* sourceStart, const uint8_t* sourceEnd, string& target) const { if(sourceStart == sourceEnd) { diff --git a/cpp/src/IceUtil/StringUtil.cpp b/cpp/src/IceUtil/StringUtil.cpp index 0bd289ddb0a..237071cb2fa 100644 --- a/cpp/src/IceUtil/StringUtil.cpp +++ b/cpp/src/IceUtil/StringUtil.cpp @@ -17,7 +17,7 @@ namespace { char -toHexDigit(Byte b) +toHexDigit(uint8_t b) { assert(b < 16); if(b < 10) @@ -38,7 +38,7 @@ addContinuationByte(string::iterator& p, string::iterator end, unsigned int code throw IllegalArgumentException(__FILE__, __LINE__, "UTF-8 sequence too short"); } - Byte b = static_cast(*p++); + uint8_t b = static_cast(*p++); if((b >> 6) != 2) { @@ -55,7 +55,7 @@ appendUniversalName(char c, string::iterator& p, string::iterator end, string& r { unsigned int codePoint; - Byte b = static_cast(c); + uint8_t b = static_cast(c); if((b >> 5) == 0x06) { // 2 bytes @@ -89,7 +89,7 @@ appendUniversalName(char c, string::iterator& p, string::iterator end, string& r result.append("\\U"); for(int j = 7; j >= 0; j--) { - result.push_back(toHexDigit(static_cast((codePoint >> (j * 4)) & 0x0F))); + result.push_back(toHexDigit(static_cast((codePoint >> (j * 4)) & 0x0F))); } } else @@ -97,7 +97,7 @@ appendUniversalName(char c, string::iterator& p, string::iterator end, string& r result.append("\\u"); for(int j = 3; j >= 0; j--) { - result.push_back(toHexDigit(static_cast((codePoint >> (j * 4)) & 0x0F))); + result.push_back(toHexDigit(static_cast((codePoint >> (j * 4)) & 0x0F))); } } } diff --git a/cpp/src/icegriddb/IceGridDB.cpp b/cpp/src/icegriddb/IceGridDB.cpp index 5f20adc8b5b..eabc14de5e1 100644 --- a/cpp/src/icegriddb/IceGridDB.cpp +++ b/cpp/src/icegriddb/IceGridDB.cpp @@ -267,9 +267,9 @@ run(const Ice::StringSeq& args) fs.seekg(0, ios::beg); - vector buf; + vector buf; buf.reserve(static_cast(fileSize)); - buf.insert(buf.begin(), istream_iterator(fs), istream_iterator()); + buf.insert(buf.begin(), istream_iterator(fs), istream_iterator()); fs.close(); diff --git a/cpp/src/iceserviceinstall/ServiceInstaller.h b/cpp/src/iceserviceinstall/ServiceInstaller.h index f9e498c5326..0a8ec75aab7 100644 --- a/cpp/src/iceserviceinstall/ServiceInstaller.h +++ b/cpp/src/iceserviceinstall/ServiceInstaller.h @@ -61,7 +61,7 @@ class IceServiceInstaller std::string _glacier2InstanceName; SID* _sid; - std::vector _sidBuffer; + std::vector _sidBuffer; std::string _sidName; diff --git a/cpp/test/Ice/ami/AllTests.cpp b/cpp/test/Ice/ami/AllTests.cpp index 5679786bae7..15cbecce0c6 100644 --- a/cpp/test/Ice/ami/AllTests.cpp +++ b/cpp/test/Ice/ami/AllTests.cpp @@ -1421,7 +1421,7 @@ allTests(Test::TestHelper* helper, bool collocated) seq.resize(1024 * 10); for(Ice::ByteSeq::iterator q = seq.begin(); q != seq.end(); ++q) { - *q = static_cast(IceUtilInternal::random(255)); + *q = static_cast(IceUtilInternal::random(255)); } // diff --git a/cpp/test/Ice/background/AllTests.cpp b/cpp/test/Ice/background/AllTests.cpp index 131931a0afb..68a8f57829d 100644 --- a/cpp/test/Ice/background/AllTests.cpp +++ b/cpp/test/Ice/background/AllTests.cpp @@ -1248,7 +1248,7 @@ readWriteTests(const ConfigurationPtr& configuration, seq.resize(10024); // Make sure the request doesn't compress too well. for(Ice::ByteSeq::iterator p = seq.begin(); p != seq.end(); ++p) { - *p = static_cast(IceUtilInternal::random(255)); + *p = static_cast(IceUtilInternal::random(255)); } // Fill up the receive and send buffers diff --git a/cpp/test/Ice/custom/AllTests.cpp b/cpp/test/Ice/custom/AllTests.cpp index 4972726a5c4..99692a974df 100644 --- a/cpp/test/Ice/custom/AllTests.cpp +++ b/cpp/test/Ice/custom/AllTests.cpp @@ -107,7 +107,7 @@ allTests(Test::TestHelper* helper) { Test::ByteList in; - Ice::Byte inArray[5]; + uint8_t inArray[5]; inArray[0] = '1'; in.push_back(inArray[0]); inArray[1] = '2'; @@ -118,7 +118,7 @@ allTests(Test::TestHelper* helper) in.push_back(inArray[3]); inArray[4] = '5'; in.push_back(inArray[4]); - pair inPair(inArray, inArray + 5); + pair inPair(inArray, inArray + 5); Test::ByteList out; Test::ByteList ret = t->opByteArray(inPair, out); @@ -177,29 +177,29 @@ allTests(Test::TestHelper* helper) } { - deque< ::Ice::Byte> in(5); + deque in(5); in[0] = '1'; in[1] = '2'; in[2] = '3'; in[3] = '4'; in[4] = '5'; - deque< ::Ice::Byte> out; - deque< ::Ice::Byte> ret = t->opByteSeq(in, out); + deque out; + deque ret = t->opByteSeq(in, out); test(out == in); test(ret == in); } { - list< ::Ice::Byte> in; + list in; in.push_back('1'); in.push_back('2'); in.push_back('3'); in.push_back('4'); in.push_back('5'); - list< ::Ice::Byte> out; - list< ::Ice::Byte> ret = t->opByteList(in, out); + list out; + list ret = t->opByteList(in, out); test(out == in); test(ret == in); } @@ -209,7 +209,7 @@ allTests(Test::TestHelper* helper) int i = 0; for(MyByteSeq::iterator p = in.begin(); p != in.end(); ++p) { - *p = static_cast('1' + i++); + *p = static_cast('1' + i++); } MyByteSeq out; @@ -515,7 +515,7 @@ allTests(Test::TestHelper* helper) test(retBS == inBS); Test::BufferStruct bs; - bs.byteBuf.setAndInit(new Ice::Byte[10], 10); + bs.byteBuf.setAndInit(new uint8_t[10], 10); bs.boolBuf.setAndInit(new bool[10], 10); bs.shortBuf.setAndInit(new int16_t[10], 10); bs.intBuf.setAndInit(new int32_t[10], 10); @@ -579,7 +579,7 @@ allTests(Test::TestHelper* helper) { Test::ByteList in; - Ice::Byte inArray[5]; + uint8_t inArray[5]; inArray[0] = '1'; in.push_back(inArray[0]); inArray[1] = '2'; @@ -590,7 +590,7 @@ allTests(Test::TestHelper* helper) in.push_back(inArray[3]); inArray[4] = '5'; in.push_back(inArray[4]); - pair inPair(inArray, inArray + 5); + pair inPair(inArray, inArray + 5); auto r = t->opByteArrayAsync(inPair).get(); test(std::get<1>(r) == in); @@ -644,7 +644,7 @@ allTests(Test::TestHelper* helper) } { - deque< ::Ice::Byte> in(5); + deque in(5); in[0] = '1'; in[1] = '2'; in[2] = '3'; @@ -657,7 +657,7 @@ allTests(Test::TestHelper* helper) } { - list< ::Ice::Byte> in; + list in; in.push_back('1'); in.push_back('2'); in.push_back('3'); @@ -674,7 +674,7 @@ allTests(Test::TestHelper* helper) int i = 0; for(MyByteSeq::iterator p = in.begin(); p != in.end(); ++p) { - *p = static_cast('1' + i++); + *p = static_cast('1' + i++); } auto r = t->opMyByteSeqAsync(in).get(); @@ -985,22 +985,22 @@ allTests(Test::TestHelper* helper) } { - Ice::Byte in[5]; + uint8_t in[5]; in[0] = '1'; in[1] = '2'; in[2] = '3'; in[3] = '4'; in[4] = '5'; - pair inPair(in, in + 5); + pair inPair(in, in + 5); promise done; t->opByteArrayAsync(inPair, - [&](pair ret, - pair out) + [&](pair ret, + pair out) { - test(arrayRangeEquals(out, inPair)); - test(arrayRangeEquals(ret, inPair)); + test(arrayRangeEquals(out, inPair)); + test(arrayRangeEquals(ret, inPair)); done.set_value(true); }, [&](std::exception_ptr) @@ -1095,7 +1095,7 @@ allTests(Test::TestHelper* helper) } { - deque< ::Ice::Byte> in(5); + deque in(5); in[0] = '1'; in[1] = '2'; in[2] = '3'; @@ -1105,7 +1105,7 @@ allTests(Test::TestHelper* helper) promise done; t->opByteSeqAsync(in, - [&](deque ret, deque out) + [&](deque ret, deque out) { test(ret == out); test(ret == in); @@ -1120,7 +1120,7 @@ allTests(Test::TestHelper* helper) } { - list< ::Ice::Byte> in; + list in; in.push_back('1'); in.push_back('2'); in.push_back('3'); @@ -1130,7 +1130,7 @@ allTests(Test::TestHelper* helper) promise done; t->opByteListAsync(in, - [&](list ret, list out) + [&](list ret, list out) { test(ret == out); test(ret == in); @@ -1149,7 +1149,7 @@ allTests(Test::TestHelper* helper) int i = 0; for(MyByteSeq::iterator p = in.begin(); p != in.end(); ++p) { - *p = static_cast('1' + i++); + *p = static_cast('1' + i++); } promise done; @@ -1553,10 +1553,10 @@ allTests(Test::TestHelper* helper) promise done; t->opOutArrayByteSeqAsync(in, - [&](pair out) + [&](pair out) { - test(arrayRangeEquals( - make_pair(&in[0], &in[0] + in.size()), out)); + test(arrayRangeEquals( + make_pair(&in[0], &in[0] + in.size()), out)); done.set_value(true); }, [&](std::exception_ptr) diff --git a/cpp/test/Ice/custom/MyByteSeq.cpp b/cpp/test/Ice/custom/MyByteSeq.cpp index 5e81f8121fa..ca060f94482 100644 --- a/cpp/test/Ice/custom/MyByteSeq.cpp +++ b/cpp/test/Ice/custom/MyByteSeq.cpp @@ -16,7 +16,7 @@ MyByteSeq::MyByteSeq(size_t size) { if(_size != 0) { - _data = new Ice::Byte[_size]; + _data = new uint8_t[_size]; } } @@ -25,7 +25,7 @@ MyByteSeq::MyByteSeq(const MyByteSeq& seq) _size = seq._size; if(_size != 0) { - _data = new Ice::Byte[_size]; + _data = new uint8_t[_size]; memcpy(_data, seq._data, _size); } else @@ -49,7 +49,7 @@ void MyByteSeq::swap(MyByteSeq& seq) { size_t tmpSize = seq._size; - Ice::Byte* tmpData = seq._data; + uint8_t* tmpData = seq._data; seq._size = _size; seq._data = _data; _size = tmpSize; @@ -77,7 +77,7 @@ MyByteSeq::operator=(const MyByteSeq& rhs) _size = rhs._size; if(_size != 0) { - _data = new Ice::Byte[_size]; + _data = new uint8_t[_size]; memcpy(_data, rhs._data, _size); } } diff --git a/cpp/test/Ice/custom/MyByteSeq.h b/cpp/test/Ice/custom/MyByteSeq.h index ff0df591517..79d4581f53c 100644 --- a/cpp/test/Ice/custom/MyByteSeq.h +++ b/cpp/test/Ice/custom/MyByteSeq.h @@ -11,10 +11,10 @@ class MyByteSeq { public: - typedef Ice::Byte* iterator; - typedef Ice::Byte* const_iterator; + typedef std::uint8_t* iterator; + typedef std::uint8_t* const_iterator; - typedef Ice::Byte value_type; + typedef std::uint8_t value_type; MyByteSeq(); MyByteSeq(size_t); @@ -31,7 +31,7 @@ class MyByteSeq private: size_t _size; - Ice::Byte* _data; + std::uint8_t* _data; }; #endif diff --git a/cpp/test/Ice/custom/StringConverterI.cpp b/cpp/test/Ice/custom/StringConverterI.cpp index a436bb6508b..2bf467e0636 100644 --- a/cpp/test/Ice/custom/StringConverterI.cpp +++ b/cpp/test/Ice/custom/StringConverterI.cpp @@ -7,23 +7,23 @@ using namespace std; using namespace Ice; -Byte* +uint8_t* Test::StringConverterI::toUTF8(const char* sourceStart, const char* sourceEnd, UTF8Buffer& buffer) const { size_t size = static_cast(sourceEnd - sourceStart); - Byte* targetStart = buffer.getMoreBytes(size, 0); - Byte* targetEnd = targetStart + size; + uint8_t* targetStart = buffer.getMoreBytes(size, 0); + uint8_t* targetEnd = targetStart + size; for(size_t i = 0; i < size; ++i) { - targetStart[i] = static_cast(tolower(sourceStart[i])); + targetStart[i] = static_cast(tolower(sourceStart[i])); } return targetEnd; } void -Test::StringConverterI::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, +Test::StringConverterI::fromUTF8(const uint8_t* sourceStart, const uint8_t* sourceEnd, string& target) const { size_t size = static_cast(sourceEnd - sourceStart); @@ -34,25 +34,25 @@ Test::StringConverterI::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, } } -Byte* +uint8_t* Test::WstringConverterI::toUTF8(const wchar_t* sourceStart, const wchar_t* sourceEnd, UTF8Buffer& buffer) const { wstring ws(sourceStart, sourceEnd); string s = wstringToString(ws); size_t size = s.size(); - Byte* targetStart = buffer.getMoreBytes(size, 0); - Byte* targetEnd = targetStart + size; + uint8_t* targetStart = buffer.getMoreBytes(size, 0); + uint8_t* targetEnd = targetStart + size; for(size_t i = 0; i < size; ++i) { - targetStart[i] = static_cast(tolower(s[i])); + targetStart[i] = static_cast(tolower(s[i])); } return targetEnd; } void -Test::WstringConverterI::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, +Test::WstringConverterI::fromUTF8(const uint8_t* sourceStart, const uint8_t* sourceEnd, wstring& target) const { string s(sourceStart, sourceEnd); diff --git a/cpp/test/Ice/custom/StringConverterI.h b/cpp/test/Ice/custom/StringConverterI.h index 626c5fc428c..b670aa60f5a 100644 --- a/cpp/test/Ice/custom/StringConverterI.h +++ b/cpp/test/Ice/custom/StringConverterI.h @@ -19,8 +19,8 @@ class StringConverterI : public Ice::StringConverter { public: - virtual Ice::Byte* toUTF8(const char*, const char*, Ice::UTF8Buffer&) const; - virtual void fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd, + virtual std::uint8_t* toUTF8(const char*, const char*, Ice::UTF8Buffer&) const; + virtual void fromUTF8(const std::uint8_t* sourceStart, const std::uint8_t* sourceEnd, std::string& target) const; }; @@ -28,8 +28,8 @@ class WstringConverterI : public Ice::WstringConverter { public: - virtual Ice::Byte* toUTF8(const wchar_t*, const wchar_t*, Ice::UTF8Buffer&) const; - virtual void fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd, + virtual std::uint8_t* toUTF8(const wchar_t*, const wchar_t*, Ice::UTF8Buffer&) const; + virtual void fromUTF8(const std::uint8_t* sourceStart, const std::uint8_t* sourceEnd, std::wstring& target) const; }; diff --git a/cpp/test/Ice/custom/Test.ice b/cpp/test/Ice/custom/Test.ice index 72a50747990..ad2bc079d94 100644 --- a/cpp/test/Ice/custom/Test.ice +++ b/cpp/test/Ice/custom/Test.ice @@ -20,7 +20,7 @@ sequence BoolListSeq; ["cpp:type:std::list >"] sequence<["cpp:type:std::deque"] BoolSeq> BoolDequeList; sequence ByteSeq; -["cpp:type:std::list< ::Ice::Byte>"] sequence ByteList; +["cpp:type:std::list"] sequence ByteList; ["cpp:type:std::list< ::Test::ByteList>"] sequence ByteListList; sequence ByteListSeq; @@ -108,7 +108,7 @@ class DictClass ["cpp:type:Test::CustomBuffer"] sequence LongBuffer; ["cpp:type:Test::CustomBuffer"] sequence FloatBuffer; ["cpp:type:Test::CustomBuffer"] sequence DoubleBuffer; -["cpp:type:Test::CustomBuffer"] sequence ByteBuffer; +["cpp:type:Test::CustomBuffer"] sequence ByteBuffer; struct BufferStruct { ByteBuffer byteBuf; @@ -139,9 +139,9 @@ interface TestIntf ["cpp:array"] BoolDequeList opBoolDequeListArray(["cpp:array"] BoolDequeList inSeq, out ["cpp:array"] BoolDequeList outSeq); - ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq - opByteSeq(["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq inSeq, - out ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq outSeq); + ["cpp:type:std::deque"] ByteSeq + opByteSeq(["cpp:type:std::deque"] ByteSeq inSeq, + out ["cpp:type:std::deque"] ByteSeq outSeq); ByteList opByteList(ByteList inSeq, out ByteList outSeq); diff --git a/cpp/test/Ice/custom/TestAMD.ice b/cpp/test/Ice/custom/TestAMD.ice index 7643eb14980..8092308068d 100644 --- a/cpp/test/Ice/custom/TestAMD.ice +++ b/cpp/test/Ice/custom/TestAMD.ice @@ -18,7 +18,7 @@ sequence BoolListSeq; ["cpp:type:std::list< ::Test::BoolSeq>"] sequence BoolSeqList; sequence ByteSeq; -["cpp:type:std::list< ::Ice::Byte>"] sequence ByteList; +["cpp:type:std::list"] sequence ByteList; ["cpp:type:std::list< ::Test::ByteList>"] sequence ByteListList; sequence ByteListSeq; @@ -106,7 +106,7 @@ class DictClass ["cpp:type:Test::CustomBuffer"] sequence LongBuffer; ["cpp:type:Test::CustomBuffer"] sequence FloatBuffer; ["cpp:type:Test::CustomBuffer"] sequence DoubleBuffer; -["cpp:type:Test::CustomBuffer"] sequence ByteBuffer; +["cpp:type:Test::CustomBuffer"] sequence ByteBuffer; struct BufferStruct { ByteBuffer byteBuf; @@ -133,9 +133,9 @@ struct BufferStruct BoolList opBoolList(BoolList inSeq, out BoolList outSeq); - ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq - opByteSeq(["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq inSeq, - out ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq outSeq); + ["cpp:type:std::deque"] ByteSeq + opByteSeq(["cpp:type:std::deque"] ByteSeq inSeq, + out ["cpp:type:std::deque"] ByteSeq outSeq); ByteList opByteList(ByteList inSeq, out ByteList outSeq); diff --git a/cpp/test/Ice/custom/TestAMDI.cpp b/cpp/test/Ice/custom/TestAMDI.cpp index c2d38d943ee..483d1477056 100644 --- a/cpp/test/Ice/custom/TestAMDI.cpp +++ b/cpp/test/Ice/custom/TestAMDI.cpp @@ -24,9 +24,9 @@ TestIntfI::opBoolArrayAsync(std::pair in, } void -TestIntfI::opByteArrayAsync(std::pair in, - std::function&, - const std::pair&)> response, +TestIntfI::opByteArrayAsync(std::pair in, + std::function&, + const std::pair&)> response, std::function, const Ice::Current&) { response(in, in); @@ -58,8 +58,8 @@ TestIntfI::opBoolListAsync(Test::BoolList in, } void -TestIntfI::opByteSeqAsync(std::deque in, - std::function&, const std::deque&)> response, +TestIntfI::opByteSeqAsync(std::deque in, + std::function&, const std::deque&)> response, std::function, const Ice::Current&) { response(in, in); @@ -201,7 +201,7 @@ TestIntfI::opCListAsync(Test::CList in, void TestIntfI::opOutArrayByteSeqAsync(Test::ByteSeq in, - std::function&)> response, + std::function&)> response, std::function, const Ice::Current&) { response(std::make_pair(in.data(), in.data() + in.size())); diff --git a/cpp/test/Ice/custom/TestAMDI.h b/cpp/test/Ice/custom/TestAMDI.h index 4705011d4b5..08d69866342 100644 --- a/cpp/test/Ice/custom/TestAMDI.h +++ b/cpp/test/Ice/custom/TestAMDI.h @@ -18,9 +18,9 @@ class TestIntfI : public virtual Test::TestIntf std::function, std::function, const Ice::Current&) override; - void opByteArrayAsync(std::pair, - std::function&, - const std::pair&)>, + void opByteArrayAsync(std::pair, + std::function&, + const std::pair&)>, std::function, const Ice::Current&) override; void opVariableArrayAsync(std::pair, @@ -35,8 +35,8 @@ class TestIntfI : public virtual Test::TestIntf std::function, std::function, const Ice::Current&) override; - void opByteSeqAsync(std::deque< ::Ice::Byte>, - std::function&, const std::deque< ::Ice::Byte>&)>, + void opByteSeqAsync(std::deque< std::uint8_t>, + std::function&, const std::deque< std::uint8_t>&)>, std::function, const Ice::Current&) override; void opByteListAsync(::Test::ByteList, @@ -110,7 +110,7 @@ class TestIntfI : public virtual Test::TestIntf std::function, const Ice::Current&) override; void opOutArrayByteSeqAsync(::Test::ByteSeq, - std::function&)>, + std::function&)>, std::function, const Ice::Current&) override; void opIntStringDictAsync(::Test::IntStringDict, diff --git a/cpp/test/Ice/custom/TestI.cpp b/cpp/test/Ice/custom/TestI.cpp index 5844a01d03d..e615a68694a 100644 --- a/cpp/test/Ice/custom/TestI.cpp +++ b/cpp/test/Ice/custom/TestI.cpp @@ -24,7 +24,7 @@ TestIntfI::opBoolArray(std::pair inSeq, } Test::ByteList -TestIntfI::opByteArray(std::pair inSeq, +TestIntfI::opByteArray(std::pair inSeq, Test::ByteList& outSeq, const Ice::Current&) { @@ -113,18 +113,18 @@ TestIntfI::opBoolDequeListRange(Test::BoolDequeList inSeq, Test::BoolDequeList& return outSeq; } -std::deque< ::Ice::Byte> -TestIntfI::opByteSeq(std::deque< ::Ice::Byte> inSeq, - std::deque< ::Ice::Byte>& outSeq, +std::deque< uint8_t> +TestIntfI::opByteSeq(std::deque< uint8_t> inSeq, + std::deque< uint8_t>& outSeq, const Ice::Current&) { outSeq = inSeq; return inSeq; } -std::list< ::Ice::Byte> -TestIntfI::opByteList(std::list< ::Ice::Byte> inSeq, - std::list< ::Ice::Byte>& outSeq, +std::list< uint8_t> +TestIntfI::opByteList(std::list< uint8_t> inSeq, + std::list< uint8_t>& outSeq, const Ice::Current&) { outSeq = inSeq; diff --git a/cpp/test/Ice/custom/TestI.h b/cpp/test/Ice/custom/TestI.h index edd163d4a7e..91a04013f3b 100644 --- a/cpp/test/Ice/custom/TestI.h +++ b/cpp/test/Ice/custom/TestI.h @@ -19,7 +19,7 @@ class TestIntfI : public virtual Test::TestIntf Test::BoolSeq&, const Ice::Current&); - virtual Test::ByteList opByteArray(std::pair, + virtual Test::ByteList opByteArray(std::pair, Test::ByteList&, const Ice::Current&); @@ -56,12 +56,12 @@ class TestIntfI : public virtual Test::TestIntf virtual ::Test::BoolDequeList opBoolDequeListRange(::Test::BoolDequeList, ::Test::BoolDequeList&, const ::Ice::Current&); - virtual std::deque< ::Ice::Byte> opByteSeq(std::deque< ::Ice::Byte>, - std::deque< ::Ice::Byte>&, + virtual std::deque< std::uint8_t> opByteSeq(std::deque< std::uint8_t>, + std::deque< std::uint8_t>&, const Ice::Current&); - virtual std::list< ::Ice::Byte> opByteList(std::list< ::Ice::Byte>, - std::list< ::Ice::Byte>&, + virtual std::list< std::uint8_t> opByteList(std::list< std::uint8_t>, + std::list< std::uint8_t>&, const Ice::Current&); virtual MyByteSeq opMyByteSeq(MyByteSeq, diff --git a/cpp/test/Ice/dispatcher/AllTests.cpp b/cpp/test/Ice/dispatcher/AllTests.cpp index f14f62bf83a..55821ee7847 100644 --- a/cpp/test/Ice/dispatcher/AllTests.cpp +++ b/cpp/test/Ice/dispatcher/AllTests.cpp @@ -192,7 +192,7 @@ allTests(Test::TestHelper* helper) seq.resize(1024); // Make sure the request doesn't compress too well. for(Ice::ByteSeq::iterator q = seq.begin(); q != seq.end(); ++q) { - *q = static_cast(IceUtilInternal::random(255)); + *q = static_cast(IceUtilInternal::random(255)); } vector>> completed; diff --git a/cpp/test/Ice/echo/BlobjectI.cpp b/cpp/test/Ice/echo/BlobjectI.cpp index eb6848b743f..2681fd44dc4 100644 --- a/cpp/test/Ice/echo/BlobjectI.cpp +++ b/cpp/test/Ice/echo/BlobjectI.cpp @@ -36,8 +36,8 @@ BlobjectI::flushBatch() } void -BlobjectI::ice_invokeAsync(std::vector inEncaps, - std::function&)> response, +BlobjectI::ice_invokeAsync(std::vector inEncaps, + std::function&)> response, std::function ex, const Ice::Current& current) { @@ -63,16 +63,16 @@ BlobjectI::ice_invokeAsync(std::vector inEncaps, if(_batchProxy) { - vector out; + vector out; obj->ice_invoke(current.operation, current.mode, inEncaps, out, current.ctx); - response(true, vector()); + response(true, vector()); } else { obj->ice_oneway()->ice_invokeAsync(current.operation, current.mode, inEncaps, - [](bool, const std::vector&) { assert(0); }, + [](bool, const std::vector&) { assert(0); }, ex, - [&](bool) { response(true, vector()); }, + [&](bool) { response(true, vector()); }, current.ctx); } } diff --git a/cpp/test/Ice/echo/BlobjectI.h b/cpp/test/Ice/echo/BlobjectI.h index d0363eb31b1..f5802f6ef31 100644 --- a/cpp/test/Ice/echo/BlobjectI.h +++ b/cpp/test/Ice/echo/BlobjectI.h @@ -17,8 +17,8 @@ class BlobjectI : public Ice::BlobjectAsync void flushBatch(); void setConnection(const Ice::ConnectionPtr&); - virtual void ice_invokeAsync(std::vector, - std::function&)>, + virtual void ice_invokeAsync(std::vector, + std::function&)>, std::function, const Ice::Current&) override; diff --git a/cpp/test/Ice/invoke/AllTests.cpp b/cpp/test/Ice/invoke/AllTests.cpp index c0cc86e1f50..388597b2da4 100644 --- a/cpp/test/Ice/invoke/AllTests.cpp +++ b/cpp/test/Ice/invoke/AllTests.cpp @@ -63,7 +63,7 @@ allTests(Test::TestHelper* helper) } // ice_invoke with array mapping - pair inPair(&inEncaps[0], &inEncaps[0] + inEncaps.size()); + pair inPair(&inEncaps[0], &inEncaps[0] + inEncaps.size()); if(cl->ice_invoke("opString", Ice::OperationMode::Normal, inPair, outEncaps)) { Ice::InputStream in(communicator, out.getEncoding(), outEncaps); @@ -118,7 +118,7 @@ allTests(Test::TestHelper* helper) { Ice::ByteSeq inEncaps; batchOneway->ice_invokeAsync("opOneway", Ice::OperationMode::Normal, inEncaps, - [](bool, const vector) + [](bool, const vector) { test(false); }, @@ -198,7 +198,7 @@ allTests(Test::TestHelper* helper) out.finished(inEncaps); cl->ice_invokeAsync("opString", Ice::OperationMode::Normal, inEncaps, - [&](bool ok, vector outParams) + [&](bool ok, vector outParams) { outEncaps = std::move(outParams); completed.set_value(ok); @@ -255,9 +255,9 @@ allTests(Test::TestHelper* helper) auto inPair = make_pair(inEncaps.data(), inEncaps.data() + inEncaps.size()); cl->ice_invokeAsync("opString", Ice::OperationMode::Normal, inPair, - [&](bool ok, pair outParams) + [&](bool ok, pair outParams) { - vector(outParams.first, outParams.second).swap(outEncaps); + vector(outParams.first, outParams.second).swap(outEncaps); completed.set_value(ok); }, [&](exception_ptr ex) @@ -313,7 +313,7 @@ allTests(Test::TestHelper* helper) Ice::ByteSeq inEncaps, outEncaps; cl->ice_invokeAsync("opException", Ice::OperationMode::Normal, inEncaps, - [&](bool ok, vector outParams) + [&](bool ok, vector outParams) { outEncaps = std::move(outParams); completed.set_value(ok); diff --git a/cpp/test/Ice/invoke/BlobjectI.cpp b/cpp/test/Ice/invoke/BlobjectI.cpp index 5098fa49006..0fe898e90e7 100644 --- a/cpp/test/Ice/invoke/BlobjectI.cpp +++ b/cpp/test/Ice/invoke/BlobjectI.cpp @@ -10,7 +10,7 @@ using namespace std; bool -invokeInternal(Ice::InputStream& in, vector& outEncaps, const Ice::Current& current) +invokeInternal(Ice::InputStream& in, vector& outEncaps, const Ice::Current& current) { Ice::CommunicatorPtr communicator = current.adapter->getCommunicator(); Ice::OutputStream out(communicator); @@ -79,14 +79,14 @@ invokeInternal(Ice::InputStream& in, vector& outEncaps, const Ice::Cu } bool -BlobjectI::ice_invoke(vector inEncaps, vector& outEncaps, const Ice::Current& current) +BlobjectI::ice_invoke(vector inEncaps, vector& outEncaps, const Ice::Current& current) { Ice::InputStream in(current.adapter->getCommunicator(), current.encoding, inEncaps); return invokeInternal(in, outEncaps, current); } bool -BlobjectArrayI::ice_invoke(pair inEncaps, vector& outEncaps, +BlobjectArrayI::ice_invoke(pair inEncaps, vector& outEncaps, const Ice::Current& current) { Ice::InputStream in(current.adapter->getCommunicator(), current.encoding, inEncaps); @@ -94,27 +94,27 @@ BlobjectArrayI::ice_invoke(pair inEncaps, ve } void -BlobjectAsyncI::ice_invokeAsync(vector inEncaps, - function&)> response, +BlobjectAsyncI::ice_invokeAsync(vector inEncaps, + function&)> response, function, const Ice::Current& current) { Ice::InputStream in(current.adapter->getCommunicator(), inEncaps); - vector outEncaps; + vector outEncaps; bool ok = invokeInternal(in, outEncaps, current); response(ok, outEncaps); } void -BlobjectArrayAsyncI::ice_invokeAsync(pair inEncaps, - function&)> response, +BlobjectArrayAsyncI::ice_invokeAsync(pair inEncaps, + function&)> response, function, const Ice::Current& current) { Ice::InputStream in(current.adapter->getCommunicator(), inEncaps); - vector outEncaps; + vector outEncaps; bool ok = invokeInternal(in, outEncaps, current); - pair outPair(static_cast(nullptr), static_cast(nullptr)); + pair outPair(static_cast(nullptr), static_cast(nullptr)); if(outEncaps.size() != 0) { outPair.first = &outEncaps[0]; diff --git a/cpp/test/Ice/invoke/BlobjectI.h b/cpp/test/Ice/invoke/BlobjectI.h index 265d55724be..5fe431e37e1 100644 --- a/cpp/test/Ice/invoke/BlobjectI.h +++ b/cpp/test/Ice/invoke/BlobjectI.h @@ -11,14 +11,14 @@ class BlobjectI : public Ice::Blobject { public: - virtual bool ice_invoke(std::vector, std::vector&, const Ice::Current&); + virtual bool ice_invoke(std::vector, std::vector&, const Ice::Current&); }; class BlobjectArrayI : public Ice::BlobjectArray { public: - virtual bool ice_invoke(std::pair, std::vector&, + virtual bool ice_invoke(std::pair, std::vector&, const Ice::Current&); }; @@ -26,8 +26,8 @@ class BlobjectAsyncI : public Ice::BlobjectAsync { public: - virtual void ice_invokeAsync(std::vector, - std::function&)>, + virtual void ice_invokeAsync(std::vector, + std::function&)>, std::function, const Ice::Current&); }; @@ -36,8 +36,8 @@ class BlobjectArrayAsyncI : public Ice::BlobjectArrayAsync { public: - virtual void ice_invokeAsync(std::pair, - std::function&)>, + virtual void ice_invokeAsync(std::pair, + std::function&)>, std::function, const Ice::Current&); }; diff --git a/cpp/test/Ice/objects/TestI.cpp b/cpp/test/Ice/objects/TestI.cpp index c3ab59da77c..7298dead50e 100644 --- a/cpp/test/Ice/objects/TestI.cpp +++ b/cpp/test/Ice/objects/TestI.cpp @@ -314,8 +314,8 @@ InitialI::opM(Test::MPtr v1, Test::MPtr& v2, const Ice::Current&) } bool -UnexpectedObjectExceptionTestI::ice_invoke(std::vector, - std::vector& outParams, +UnexpectedObjectExceptionTestI::ice_invoke(std::vector, + std::vector& outParams, const Ice::Current& current) { Ice::CommunicatorPtr communicator = current.adapter->getCommunicator(); diff --git a/cpp/test/Ice/objects/TestI.h b/cpp/test/Ice/objects/TestI.h index 0500733a21d..3b7afc6d2ef 100644 --- a/cpp/test/Ice/objects/TestI.h +++ b/cpp/test/Ice/objects/TestI.h @@ -124,7 +124,7 @@ class UnexpectedObjectExceptionTestI : public Ice::Blobject { public: - virtual bool ice_invoke(std::vector, std::vector&, const Ice::Current&); + virtual bool ice_invoke(std::vector, std::vector&, const Ice::Current&); }; using UnexpectedObjectExceptionTestIPtr = std::shared_ptr; diff --git a/cpp/test/Ice/operations/Oneways.cpp b/cpp/test/Ice/operations/Oneways.cpp index b66f1f25e38..a0a3c121521 100644 --- a/cpp/test/Ice/operations/Oneways.cpp +++ b/cpp/test/Ice/operations/Oneways.cpp @@ -63,11 +63,11 @@ oneways(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) } { - Ice::Byte b; + uint8_t b; try { - p->opByte(Ice::Byte(0xff), Ice::Byte(0x0f), b); + p->opByte(uint8_t(0xff), uint8_t(0x0f), b); test(false); } catch(const Ice::TwowayOnlyException&) diff --git a/cpp/test/Ice/operations/OnewaysAMI.cpp b/cpp/test/Ice/operations/OnewaysAMI.cpp index a7d22840ef1..6b39f6d46c2 100644 --- a/cpp/test/Ice/operations/OnewaysAMI.cpp +++ b/cpp/test/Ice/operations/OnewaysAMI.cpp @@ -182,8 +182,8 @@ onewaysAMI(const Ice::CommunicatorPtr&, const Test::MyClassPrxPtr& proxy) { try { - p->opByteAsync(Ice::Byte(0xff), Ice::Byte(0x0f), - [](Ice::Byte, Ice::Byte) + p->opByteAsync(uint8_t(0xff), uint8_t(0x0f), + [](uint8_t, uint8_t) { test(false); }); diff --git a/cpp/test/Ice/operations/TestAMDI.cpp b/cpp/test/Ice/operations/TestAMDI.cpp index 5de53f8bf0f..22425716e46 100644 --- a/cpp/test/Ice/operations/TestAMDI.cpp +++ b/cpp/test/Ice/operations/TestAMDI.cpp @@ -91,9 +91,9 @@ MyDerivedClassI::opVoidAsync(function response, } void -MyDerivedClassI::opByteAsync(Ice::Byte p1, - Ice::Byte p2, - function response, +MyDerivedClassI::opByteAsync(uint8_t p1, + uint8_t p2, + function response, function, const Ice::Current&) { @@ -751,8 +751,8 @@ MyDerivedClassI::opDerivedAsync(function response, } void -MyDerivedClassI::opByte1Async(Ice::Byte b, - function response, +MyDerivedClassI::opByte1Async(uint8_t b, + function response, function, const Ice::Current&) { diff --git a/cpp/test/Ice/operations/TestAMDI.h b/cpp/test/Ice/operations/TestAMDI.h index a7c937ba49e..fb70b7afd54 100644 --- a/cpp/test/Ice/operations/TestAMDI.h +++ b/cpp/test/Ice/operations/TestAMDI.h @@ -33,8 +33,8 @@ class MyDerivedClassI : public Test::MyDerivedClass ::std::function, const Ice::Current&); - virtual void opByteAsync(Ice::Byte, Ice::Byte, - ::std::function, + virtual void opByteAsync(std::uint8_t, std::uint8_t, + ::std::function, ::std::function, const Ice::Current&); @@ -297,8 +297,8 @@ class MyDerivedClassI : public Test::MyDerivedClass ::std::function, const Ice::Current&); - virtual void opByte1Async(Ice::Byte, - ::std::function, + virtual void opByte1Async(std::uint8_t, + ::std::function, ::std::function, const Ice::Current&); diff --git a/cpp/test/Ice/operations/TestI.cpp b/cpp/test/Ice/operations/TestI.cpp index 21b21e298f0..8f0d71198b9 100644 --- a/cpp/test/Ice/operations/TestI.cpp +++ b/cpp/test/Ice/operations/TestI.cpp @@ -63,10 +63,10 @@ MyDerivedClassI::opVoid(const Ice::Current& current) test(current.mode == OperationMode::Normal); } -Ice::Byte -MyDerivedClassI::opByte(Ice::Byte p1, - Ice::Byte p2, - Ice::Byte& p3, +uint8_t +MyDerivedClassI::opByte(uint8_t p1, + uint8_t p2, + uint8_t& p3, const Ice::Current&) { p3 = p1 ^ p2; @@ -659,8 +659,8 @@ MyDerivedClassI::opDerived(const Ice::Current&) { } -Ice::Byte -MyDerivedClassI::opByte1(Ice::Byte b, const Ice::Current&) +uint8_t +MyDerivedClassI::opByte1(uint8_t b, const Ice::Current&) { return b; } diff --git a/cpp/test/Ice/operations/TestI.h b/cpp/test/Ice/operations/TestI.h index 22d2b04a6ee..ecb6c6c5a78 100644 --- a/cpp/test/Ice/operations/TestI.h +++ b/cpp/test/Ice/operations/TestI.h @@ -27,9 +27,9 @@ class MyDerivedClassI : public Test::MyDerivedClass virtual void opVoid(const Ice::Current&); - virtual Ice::Byte opByte(Ice::Byte, - Ice::Byte, - Ice::Byte&, + virtual std::uint8_t opByte(std::uint8_t, + std::uint8_t, + std::uint8_t&, const Ice::Current&); virtual bool opBool(bool, @@ -262,7 +262,7 @@ class MyDerivedClassI : public Test::MyDerivedClass virtual void opDerived(const Ice::Current&); - virtual Ice::Byte opByte1(Ice::Byte, const Ice::Current&); + virtual std::uint8_t opByte1(std::uint8_t, const Ice::Current&); virtual std::int16_t opShort1(std::int16_t, const Ice::Current&); diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index 2bac1c6c2a4..519d4bc8056 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -252,12 +252,12 @@ twoways(const Ice::CommunicatorPtr& communicator, Test::TestHelper*, const Test: } { - Ice::Byte b; - Ice::Byte r; + uint8_t b; + uint8_t r; - r = p->opByte(Ice::Byte(0xff), Ice::Byte(0x0f), b); - test(b == Ice::Byte(0xf0)); - test(r == Ice::Byte(0xff)); + r = p->opByte(uint8_t(0xff), uint8_t(0x0f), b); + test(b == uint8_t(0xf0)); + test(r == uint8_t(0xff)); } { @@ -390,34 +390,34 @@ twoways(const Ice::CommunicatorPtr& communicator, Test::TestHelper*, const Test: Test::ByteS bsi1; Test::ByteS bsi2; - bsi1.push_back(Ice::Byte(0x01)); - bsi1.push_back(Ice::Byte(0x11)); - bsi1.push_back(Ice::Byte(0x12)); - bsi1.push_back(Ice::Byte(0x22)); + bsi1.push_back(uint8_t(0x01)); + bsi1.push_back(uint8_t(0x11)); + bsi1.push_back(uint8_t(0x12)); + bsi1.push_back(uint8_t(0x22)); - bsi2.push_back(Ice::Byte(0xf1)); - bsi2.push_back(Ice::Byte(0xf2)); - bsi2.push_back(Ice::Byte(0xf3)); - bsi2.push_back(Ice::Byte(0xf4)); + bsi2.push_back(uint8_t(0xf1)); + bsi2.push_back(uint8_t(0xf2)); + bsi2.push_back(uint8_t(0xf3)); + bsi2.push_back(uint8_t(0xf4)); Test::ByteS bso; Test::ByteS rso; rso = p->opByteS(bsi1, bsi2, bso); test(bso.size() == 4); - test(bso[0] == Ice::Byte(0x22)); - test(bso[1] == Ice::Byte(0x12)); - test(bso[2] == Ice::Byte(0x11)); - test(bso[3] == Ice::Byte(0x01)); + test(bso[0] == uint8_t(0x22)); + test(bso[1] == uint8_t(0x12)); + test(bso[2] == uint8_t(0x11)); + test(bso[3] == uint8_t(0x01)); test(rso.size() == 8); - test(rso[0] == Ice::Byte(0x01)); - test(rso[1] == Ice::Byte(0x11)); - test(rso[2] == Ice::Byte(0x12)); - test(rso[3] == Ice::Byte(0x22)); - test(rso[4] == Ice::Byte(0xf1)); - test(rso[5] == Ice::Byte(0xf2)); - test(rso[6] == Ice::Byte(0xf3)); - test(rso[7] == Ice::Byte(0xf4)); + test(rso[0] == uint8_t(0x01)); + test(rso[1] == uint8_t(0x11)); + test(rso[2] == uint8_t(0x12)); + test(rso[3] == uint8_t(0x22)); + test(rso[4] == uint8_t(0xf1)); + test(rso[5] == uint8_t(0xf2)); + test(rso[6] == uint8_t(0xf3)); + test(rso[7] == uint8_t(0xf4)); } { @@ -553,14 +553,14 @@ twoways(const Ice::CommunicatorPtr& communicator, Test::TestHelper*, const Test: Test::ByteSS bsi2; bsi2.resize(2); - bsi1[0].push_back(Ice::Byte(0x01)); - bsi1[0].push_back(Ice::Byte(0x11)); - bsi1[0].push_back(Ice::Byte(0x12)); - bsi1[1].push_back(Ice::Byte(0xff)); + bsi1[0].push_back(uint8_t(0x01)); + bsi1[0].push_back(uint8_t(0x11)); + bsi1[0].push_back(uint8_t(0x12)); + bsi1[1].push_back(uint8_t(0xff)); - bsi2[0].push_back(Ice::Byte(0x0e)); - bsi2[1].push_back(Ice::Byte(0xf2)); - bsi2[1].push_back(Ice::Byte(0xf1)); + bsi2[0].push_back(uint8_t(0x0e)); + bsi2[1].push_back(uint8_t(0xf2)); + bsi2[1].push_back(uint8_t(0xf1)); Test::ByteSS bso; Test::ByteSS rso; @@ -568,23 +568,23 @@ twoways(const Ice::CommunicatorPtr& communicator, Test::TestHelper*, const Test: rso = p->opByteSS(bsi1, bsi2, bso); test(bso.size() == 2); test(bso[0].size() == 1); - test(bso[0][0] == Ice::Byte(0xff)); + test(bso[0][0] == uint8_t(0xff)); test(bso[1].size() == 3); - test(bso[1][0] == Ice::Byte(0x01)); - test(bso[1][1] == Ice::Byte(0x11)); - test(bso[1][2] == Ice::Byte(0x12)); + test(bso[1][0] == uint8_t(0x01)); + test(bso[1][1] == uint8_t(0x11)); + test(bso[1][2] == uint8_t(0x12)); test(rso.size() == 4); test(rso[0].size() == 3); - test(rso[0][0] == Ice::Byte(0x01)); - test(rso[0][1] == Ice::Byte(0x11)); - test(rso[0][2] == Ice::Byte(0x12)); + test(rso[0][0] == uint8_t(0x01)); + test(rso[0][1] == uint8_t(0x11)); + test(rso[0][2] == uint8_t(0x12)); test(rso[1].size() == 1); - test(rso[1][0] == Ice::Byte(0xff)); + test(rso[1][0] == uint8_t(0xff)); test(rso[2].size() == 1); - test(rso[2][0] == Ice::Byte(0x0e)); + test(rso[2][0] == uint8_t(0x0e)); test(rso[3].size() == 2); - test(rso[3][0] == Ice::Byte(0xf2)); - test(rso[3][1] == Ice::Byte(0xf1)); + test(rso[3][0] == uint8_t(0xf2)); + test(rso[3][1] == uint8_t(0xf1)); } { @@ -1309,15 +1309,15 @@ twoways(const Ice::CommunicatorPtr& communicator, Test::TestHelper*, const Test: Test::ByteS si2; Test::ByteS si3; - si1.push_back(Ice::Byte(0x01)); - si1.push_back(Ice::Byte(0x11)); - si2.push_back(Ice::Byte(0x12)); - si3.push_back(Ice::Byte(0xf2)); - si3.push_back(Ice::Byte(0xf3)); + si1.push_back(uint8_t(0x01)); + si1.push_back(uint8_t(0x11)); + si2.push_back(uint8_t(0x12)); + si3.push_back(uint8_t(0xf2)); + si3.push_back(uint8_t(0xf3)); - sdi1[Ice::Byte(0x01)] = si1; - sdi1[Ice::Byte(0x22)] = si2; - sdi2[Ice::Byte(0xf1)] = si3; + sdi1[uint8_t(0x01)] = si1; + sdi1[uint8_t(0x22)] = si2; + sdi2[uint8_t(0xf1)] = si3; try { @@ -1326,14 +1326,14 @@ twoways(const Ice::CommunicatorPtr& communicator, Test::TestHelper*, const Test: test(_do == sdi2); test(ro.size() == 3); - test(ro[Ice::Byte(0x01)].size() == 2); - test(ro[Ice::Byte(0x01)][0] == Ice::Byte(0x01)); - test(ro[Ice::Byte(0x01)][1] == Ice::Byte(0x11)); - test(ro[Ice::Byte(0x22)].size() == 1); - test(ro[Ice::Byte(0x22)][0] == Ice::Byte(0x12)); - test(ro[Ice::Byte(0xf1)].size() == 2); - test(ro[Ice::Byte(0xf1)][0] == Ice::Byte(0xf2)); - test(ro[Ice::Byte(0xf1)][1] == Ice::Byte(0xf3)); + test(ro[uint8_t(0x01)].size() == 2); + test(ro[uint8_t(0x01)][0] == uint8_t(0x01)); + test(ro[uint8_t(0x01)][1] == uint8_t(0x11)); + test(ro[uint8_t(0x22)].size() == 1); + test(ro[uint8_t(0x22)][0] == uint8_t(0x12)); + test(ro[uint8_t(0xf1)].size() == 2); + test(ro[uint8_t(0xf1)][0] == uint8_t(0xf2)); + test(ro[uint8_t(0xf1)][1] == uint8_t(0xf3)); } catch(const Ice::OperationNotExistException&) { diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index c982f04ff02..75dfba702de 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -112,10 +112,10 @@ class Callback : public CallbackBase called(); } - void opByte(Ice::Byte r, Ice::Byte b) + void opByte(uint8_t r, uint8_t b) { - test(b == Ice::Byte(0xf0)); - test(r == Ice::Byte(0xff)); + test(b == uint8_t(0xf0)); + test(r == uint8_t(0xff)); called(); } @@ -203,19 +203,19 @@ class Callback : public CallbackBase void opByteS(const Test::ByteS& rso, const Test::ByteS& bso) { test(bso.size() == 4); - test(bso[0] == Ice::Byte(0x22)); - test(bso[1] == Ice::Byte(0x12)); - test(bso[2] == Ice::Byte(0x11)); - test(bso[3] == Ice::Byte(0x01)); + test(bso[0] == uint8_t(0x22)); + test(bso[1] == uint8_t(0x12)); + test(bso[2] == uint8_t(0x11)); + test(bso[3] == uint8_t(0x01)); test(rso.size() == 8); - test(rso[0] == Ice::Byte(0x01)); - test(rso[1] == Ice::Byte(0x11)); - test(rso[2] == Ice::Byte(0x12)); - test(rso[3] == Ice::Byte(0x22)); - test(rso[4] == Ice::Byte(0xf1)); - test(rso[5] == Ice::Byte(0xf2)); - test(rso[6] == Ice::Byte(0xf3)); - test(rso[7] == Ice::Byte(0xf4)); + test(rso[0] == uint8_t(0x01)); + test(rso[1] == uint8_t(0x11)); + test(rso[2] == uint8_t(0x12)); + test(rso[3] == uint8_t(0x22)); + test(rso[4] == uint8_t(0xf1)); + test(rso[5] == uint8_t(0xf2)); + test(rso[6] == uint8_t(0xf3)); + test(rso[7] == uint8_t(0xf4)); called(); } @@ -294,23 +294,23 @@ class Callback : public CallbackBase { test(bso.size() == 2); test(bso[0].size() == 1); - test(bso[0][0] == Ice::Byte(0xff)); + test(bso[0][0] == uint8_t(0xff)); test(bso[1].size() == 3); - test(bso[1][0] == Ice::Byte(0x01)); - test(bso[1][1] == Ice::Byte(0x11)); - test(bso[1][2] == Ice::Byte(0x12)); + test(bso[1][0] == uint8_t(0x01)); + test(bso[1][1] == uint8_t(0x11)); + test(bso[1][2] == uint8_t(0x12)); test(rso.size() == 4); test(rso[0].size() == 3); - test(rso[0][0] == Ice::Byte(0x01)); - test(rso[0][1] == Ice::Byte(0x11)); - test(rso[0][2] == Ice::Byte(0x12)); + test(rso[0][0] == uint8_t(0x01)); + test(rso[0][1] == uint8_t(0x11)); + test(rso[0][2] == uint8_t(0x12)); test(rso[1].size() == 1); - test(rso[1][0] == Ice::Byte(0xff)); + test(rso[1][0] == uint8_t(0xff)); test(rso[2].size() == 1); - test(rso[2][0] == Ice::Byte(0x0e)); + test(rso[2][0] == uint8_t(0x0e)); test(rso[3].size() == 2); - test(rso[3][0] == Ice::Byte(0xf2)); - test(rso[3][1] == Ice::Byte(0xf1)); + test(rso[3][0] == uint8_t(0xf2)); + test(rso[3][1] == uint8_t(0xf1)); called(); } @@ -767,22 +767,22 @@ class Callback : public CallbackBase void opByteByteSD(const Test::ByteByteSD& ro, const Test::ByteByteSD& _do) { test(_do.size() == 1); - test(_do.find(Ice::Byte(0xf1)) != _do.end()); - test(_do.find(Ice::Byte(0xf1))->second.size() == 2); - test(_do.find(Ice::Byte(0xf1))->second[0] == 0xf2); - test(_do.find(Ice::Byte(0xf1))->second[1] == 0xf3); + test(_do.find(uint8_t(0xf1)) != _do.end()); + test(_do.find(uint8_t(0xf1))->second.size() == 2); + test(_do.find(uint8_t(0xf1))->second[0] == 0xf2); + test(_do.find(uint8_t(0xf1))->second[1] == 0xf3); test(ro.size() == 3); - test(ro.find(Ice::Byte(0x01)) != ro.end()); - test(ro.find(Ice::Byte(0x01))->second.size() == 2); - test(ro.find(Ice::Byte(0x01))->second[0] == Ice::Byte(0x01)); - test(ro.find(Ice::Byte(0x01))->second[1] == Ice::Byte(0x11)); - test(ro.find(Ice::Byte(0x22)) != ro.end()); - test(ro.find(Ice::Byte(0x22))->second.size() == 1); - test(ro.find(Ice::Byte(0x22))->second[0] == Ice::Byte(0x12)); - test(ro.find(Ice::Byte(0xf1)) != ro.end()); - test(ro.find(Ice::Byte(0xf1))->second.size() == 2); - test(ro.find(Ice::Byte(0xf1))->second[0] == Ice::Byte(0xf2)); - test(ro.find(Ice::Byte(0xf1))->second[1] == Ice::Byte(0xf3)); + test(ro.find(uint8_t(0x01)) != ro.end()); + test(ro.find(uint8_t(0x01))->second.size() == 2); + test(ro.find(uint8_t(0x01))->second[0] == uint8_t(0x01)); + test(ro.find(uint8_t(0x01))->second[1] == uint8_t(0x11)); + test(ro.find(uint8_t(0x22)) != ro.end()); + test(ro.find(uint8_t(0x22))->second.size() == 1); + test(ro.find(uint8_t(0x22))->second[0] == uint8_t(0x12)); + test(ro.find(uint8_t(0xf1)) != ro.end()); + test(ro.find(uint8_t(0xf1))->second.size() == 2); + test(ro.find(uint8_t(0xf1))->second[0] == uint8_t(0xf2)); + test(ro.find(uint8_t(0xf1))->second[1] == uint8_t(0xf3)); called(); } @@ -1104,8 +1104,8 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { CallbackPtr cb = make_shared(); - p->opByteAsync(Ice::Byte(0xff), Ice::Byte(0x0f), - [&](Ice::Byte b1, Ice::Byte b2) + p->opByteAsync(uint8_t(0xff), uint8_t(0x0f), + [&](uint8_t b1, uint8_t b2) { cb->opByte(b1, b2); }, @@ -1203,15 +1203,15 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::ByteS bsi1; Test::ByteS bsi2; - bsi1.push_back(Ice::Byte(0x01)); - bsi1.push_back(Ice::Byte(0x11)); - bsi1.push_back(Ice::Byte(0x12)); - bsi1.push_back(Ice::Byte(0x22)); + bsi1.push_back(uint8_t(0x01)); + bsi1.push_back(uint8_t(0x11)); + bsi1.push_back(uint8_t(0x12)); + bsi1.push_back(uint8_t(0x22)); - bsi2.push_back(Ice::Byte(0xf1)); - bsi2.push_back(Ice::Byte(0xf2)); - bsi2.push_back(Ice::Byte(0xf3)); - bsi2.push_back(Ice::Byte(0xf4)); + bsi2.push_back(uint8_t(0xf1)); + bsi2.push_back(uint8_t(0xf2)); + bsi2.push_back(uint8_t(0xf3)); + bsi2.push_back(uint8_t(0xf4)); CallbackPtr cb = make_shared(); p->opByteSAsync(bsi1, bsi2, @@ -1318,14 +1318,14 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::ByteSS bsi2; bsi2.resize(2); - bsi1[0].push_back(Ice::Byte(0x01)); - bsi1[0].push_back(Ice::Byte(0x11)); - bsi1[0].push_back(Ice::Byte(0x12)); - bsi1[1].push_back(Ice::Byte(0xff)); + bsi1[0].push_back(uint8_t(0x01)); + bsi1[0].push_back(uint8_t(0x11)); + bsi1[0].push_back(uint8_t(0x12)); + bsi1[1].push_back(uint8_t(0xff)); - bsi2[0].push_back(Ice::Byte(0x0e)); - bsi2[1].push_back(Ice::Byte(0xf2)); - bsi2[1].push_back(Ice::Byte(0xf1)); + bsi2[0].push_back(uint8_t(0x0e)); + bsi2[1].push_back(uint8_t(0xf2)); + bsi2[1].push_back(uint8_t(0xf1)); CallbackPtr cb = make_shared(); p->opByteSSAsync(bsi1, bsi2, @@ -1776,15 +1776,15 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::ByteS si2; Test::ByteS si3; - si1.push_back(Ice::Byte(0x01)); - si1.push_back(Ice::Byte(0x11)); - si2.push_back(Ice::Byte(0x12)); - si3.push_back(Ice::Byte(0xf2)); - si3.push_back(Ice::Byte(0xf3)); + si1.push_back(uint8_t(0x01)); + si1.push_back(uint8_t(0x11)); + si2.push_back(uint8_t(0x12)); + si3.push_back(uint8_t(0xf2)); + si3.push_back(uint8_t(0xf3)); - sdi1[Ice::Byte(0x01)] = si1; - sdi1[Ice::Byte(0x22)] = si2; - sdi2[Ice::Byte(0xf1)] = si3; + sdi1[uint8_t(0x01)] = si1; + sdi1[uint8_t(0x22)] = si2; + sdi2[uint8_t(0xf1)] = si3; CallbackPtr cb = make_shared(); p->opByteByteSDAsync(sdi1, sdi2, @@ -2382,7 +2382,7 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& { CallbackPtr cb = make_shared(); - auto f = p->opByteAsync(Ice::Byte(0xff), Ice::Byte(0x0f)); + auto f = p->opByteAsync(uint8_t(0xff), uint8_t(0x0f)); try { auto r = f.get(); @@ -2545,15 +2545,15 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::ByteS bsi1; Test::ByteS bsi2; - bsi1.push_back(Ice::Byte(0x01)); - bsi1.push_back(Ice::Byte(0x11)); - bsi1.push_back(Ice::Byte(0x12)); - bsi1.push_back(Ice::Byte(0x22)); + bsi1.push_back(uint8_t(0x01)); + bsi1.push_back(uint8_t(0x11)); + bsi1.push_back(uint8_t(0x12)); + bsi1.push_back(uint8_t(0x22)); - bsi2.push_back(Ice::Byte(0xf1)); - bsi2.push_back(Ice::Byte(0xf2)); - bsi2.push_back(Ice::Byte(0xf3)); - bsi2.push_back(Ice::Byte(0xf4)); + bsi2.push_back(uint8_t(0xf1)); + bsi2.push_back(uint8_t(0xf2)); + bsi2.push_back(uint8_t(0xf3)); + bsi2.push_back(uint8_t(0xf4)); CallbackPtr cb = make_shared(); auto f = p->opByteSAsync(bsi1, bsi2); @@ -2700,14 +2700,14 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::ByteSS bsi2; bsi2.resize(2); - bsi1[0].push_back(Ice::Byte(0x01)); - bsi1[0].push_back(Ice::Byte(0x11)); - bsi1[0].push_back(Ice::Byte(0x12)); - bsi1[1].push_back(Ice::Byte(0xff)); + bsi1[0].push_back(uint8_t(0x01)); + bsi1[0].push_back(uint8_t(0x11)); + bsi1[0].push_back(uint8_t(0x12)); + bsi1[1].push_back(uint8_t(0xff)); - bsi2[0].push_back(Ice::Byte(0x0e)); - bsi2[1].push_back(Ice::Byte(0xf2)); - bsi2[1].push_back(Ice::Byte(0xf1)); + bsi2[0].push_back(uint8_t(0x0e)); + bsi2[1].push_back(uint8_t(0xf2)); + bsi2[1].push_back(uint8_t(0xf1)); CallbackPtr cb = make_shared(); auto f = p->opByteSSAsync(bsi1, bsi2); @@ -3234,15 +3234,15 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrxPtr& Test::ByteS si2; Test::ByteS si3; - si1.push_back(Ice::Byte(0x01)); - si1.push_back(Ice::Byte(0x11)); - si2.push_back(Ice::Byte(0x12)); - si3.push_back(Ice::Byte(0xf2)); - si3.push_back(Ice::Byte(0xf3)); + si1.push_back(uint8_t(0x01)); + si1.push_back(uint8_t(0x11)); + si2.push_back(uint8_t(0x12)); + si3.push_back(uint8_t(0xf2)); + si3.push_back(uint8_t(0xf3)); - sdi1[Ice::Byte(0x01)] = si1; - sdi1[Ice::Byte(0x22)] = si2; - sdi2[Ice::Byte(0xf1)] = si3; + sdi1[uint8_t(0x01)] = si1; + sdi1[uint8_t(0x22)] = si2; + sdi2[uint8_t(0xf1)] = si3; CallbackPtr cb = make_shared(); auto f = p->opByteByteSDAsync(sdi1, sdi2); diff --git a/cpp/test/Ice/optional/AllTests.cpp b/cpp/test/Ice/optional/AllTests.cpp index a3aa3a68e30..8c73a7a09e4 100644 --- a/cpp/test/Ice/optional/AllTests.cpp +++ b/cpp/test/Ice/optional/AllTests.cpp @@ -345,7 +345,7 @@ allTests(Test::TestHelper* helper, bool) test(!oon->a); MultiOptionalPtr mo1 = make_shared(); - mo1->a = static_cast(15); + mo1->a = static_cast(15); mo1->b = true; mo1->c = static_cast(19); mo1->d = 78; @@ -408,7 +408,7 @@ allTests(Test::TestHelper* helper, bool) MultiOptionalPtr mo3 = make_shared(); *mo3 = *mo2; - test(mo3->a == static_cast(15)); + test(mo3->a == static_cast(15)); test(mo3->b == true); test(mo3->c == static_cast(19)); test(mo3->d == 78); @@ -445,12 +445,12 @@ allTests(Test::TestHelper* helper, bool) cout << "testing comparison operators... " << flush; - test(mo1->a == static_cast(15) && static_cast(15) == mo1->a && - mo1->a != static_cast(16) && static_cast(16) != mo1->a); - test(mo1->a < static_cast(16) && mo1->a > static_cast(14) && - mo1->a <= static_cast(15) && mo1->a >= static_cast(15) && - mo1->a <= static_cast(16) && mo1->a >= static_cast(14)); - test(mo1->a > optional() && optional() < mo1->a); + test(mo1->a == static_cast(15) && static_cast(15) == mo1->a && + mo1->a != static_cast(16) && static_cast(16) != mo1->a); + test(mo1->a < static_cast(16) && mo1->a > static_cast(14) && + mo1->a <= static_cast(15) && mo1->a >= static_cast(15) && + mo1->a <= static_cast(16) && mo1->a >= static_cast(14)); + test(mo1->a > optional() && optional() < mo1->a); test(14 > optional() && optional() < 14); test(mo1->h == string("test") && string("test") == mo1->h && mo1->h != string("testa") && string("testa") != mo1->h); @@ -941,12 +941,12 @@ allTests(Test::TestHelper* helper, bool) cout << "testing optional parameters... " << flush; { - optional p1; - optional p3; - optional p2 = initial->opByte(p1, p3); + optional p1; + optional p3; + optional p2 = initial->opByte(p1, p3); test(!p2 && !p3); - const Ice::Byte bval = 56; + const uint8_t bval = 56; p1 = bval; p2 = initial->opByte(p1, p3); @@ -963,7 +963,7 @@ allTests(Test::TestHelper* helper, bool) in.read(1, p2); in.read(3, p3); - optional p4 = static_cast(0x08); + optional p4 = static_cast(0x08); in.read(89, p4); in.endEncapsulation(); @@ -1386,12 +1386,12 @@ allTests(Test::TestHelper* helper, bool) cout << "testing optional parameters and custom sequences... " << flush; { - optional > p1; + optional > p1; optional p3; optional p2 = initial->opByteSeq(p1, p3); test(!p2 && !p3); - vector bs(100); + vector bs(100); fill(bs.begin(), bs.end(), 56); p1 = toArrayRange(bs); p2 = initial->opByteSeq(p1, p3); diff --git a/cpp/test/Ice/optional/TestAMDI.cpp b/cpp/test/Ice/optional/TestAMDI.cpp index f122cf1a11a..8fedef0d21b 100644 --- a/cpp/test/Ice/optional/TestAMDI.cpp +++ b/cpp/test/Ice/optional/TestAMDI.cpp @@ -73,8 +73,8 @@ InitialI::opRequiredExceptionAsync(optional a, optional<::std::string> b, o } void -InitialI::opByteAsync(optional<::Ice::Byte> p1, - ::std::function&, const optional<::Ice::Byte>&)> response, +InitialI::opByteAsync(optional p1, + ::std::function&, const optional&)> response, ::std::function, const Ice::Current&) { response(p1, p1); @@ -185,8 +185,8 @@ InitialI::opMyInterfaceProxyAsync(optional<::MyInterfacePrx> p1, } void -InitialI::opByteSeqAsync(optional<::std::pair> p1, - ::std::function>&, const optional<::std::pair>&)> response, +InitialI::opByteSeqAsync(optional<::std::pair> p1, + ::std::function>&, const optional<::std::pair>&)> response, ::std::function, const Ice::Current&) { response(p1, p1); diff --git a/cpp/test/Ice/optional/TestAMDI.h b/cpp/test/Ice/optional/TestAMDI.h index 1750bc64753..71c785ac5a8 100644 --- a/cpp/test/Ice/optional/TestAMDI.h +++ b/cpp/test/Ice/optional/TestAMDI.h @@ -32,8 +32,8 @@ class InitialI : public Test::Initial ::std::function, ::std::function, const Ice::Current&) override; - virtual void opByteAsync(std::optional<::Ice::Byte>, - ::std::function&, const std::optional<::Ice::Byte>&)>, + virtual void opByteAsync(std::optional, + ::std::function&, const std::optional&)>, ::std::function, const Ice::Current&) override; virtual void opBoolAsync(std::optional, @@ -88,8 +88,8 @@ class InitialI : public Test::Initial ::std::function&, const std::optional<::Test::MyInterfacePrx>&)>, ::std::function, const Ice::Current&) override; - virtual void opByteSeqAsync(std::optional<::std::pair>, - ::std::function>&, const std::optional<::std::pair>&)>, + virtual void opByteSeqAsync(std::optional<::std::pair>, + ::std::function>&, const std::optional<::std::pair>&)>, ::std::function, const Ice::Current&) override; virtual void opBoolSeqAsync(std::optional<::std::pair>, diff --git a/cpp/test/Ice/optional/TestI.cpp b/cpp/test/Ice/optional/TestI.cpp index 3786eb349e5..f965f695f6f 100644 --- a/cpp/test/Ice/optional/TestI.cpp +++ b/cpp/test/Ice/optional/TestI.cpp @@ -83,8 +83,8 @@ InitialI::opRequiredException(optional a, throw ex; } -optional -InitialI::opByte(optional p1, optional& p3, const Current&) +optional +InitialI::opByte(optional p1, optional& p3, const Current&) { p3 = p1; return p1; @@ -182,7 +182,7 @@ InitialI::opMyInterfaceProxy(optional p1, optional -InitialI::opByteSeq(optional > p1, optional& p3, +InitialI::opByteSeq(optional > p1, optional& p3, const Current&) { if(p1) diff --git a/cpp/test/Ice/optional/TestI.h b/cpp/test/Ice/optional/TestI.h index e5d0f315b66..a5d58527fc8 100644 --- a/cpp/test/Ice/optional/TestI.h +++ b/cpp/test/Ice/optional/TestI.h @@ -31,8 +31,8 @@ class InitialI : public Test::Initial std::optional, const Ice::Current&); - virtual std::optional<::Ice::Byte> opByte(std::optional<::Ice::Byte>, - std::optional<::Ice::Byte>&, + virtual std::optional opByte(std::optional, + std::optional&, const ::Ice::Current&); virtual std::optional opBool(std::optional, std::optional&, @@ -87,7 +87,7 @@ class InitialI : public Test::Initial const ::Ice::Current&); virtual std::optional<::Test::ByteSeq> opByteSeq( - std::optional<::std::pair >, + std::optional<::std::pair >, std::optional<::Test::ByteSeq>&, const ::Ice::Current&); diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp index f93a6d48e83..040b7a9eb1f 100644 --- a/cpp/test/Ice/proxy/AllTests.cpp +++ b/cpp/test/Ice/proxy/AllTests.cpp @@ -987,11 +987,11 @@ allTests(Test::TestHelper* helper) Ice::OutputStream out(communicator); out.startEncapsulation(); out.endEncapsulation(); - vector inEncaps; + vector inEncaps; out.finished(inEncaps); inEncaps[4] = version.major; inEncaps[5] = version.minor; - vector outEncaps; + vector outEncaps; cl->ice_invoke("ice_ping", Ice::OperationMode::Normal, inEncaps, outEncaps); test(false); } @@ -1008,11 +1008,11 @@ allTests(Test::TestHelper* helper) Ice::OutputStream out(communicator); out.startEncapsulation(); out.endEncapsulation(); - vector inEncaps; + vector inEncaps; out.finished(inEncaps); inEncaps[4] = version.major; inEncaps[5] = version.minor; - vector outEncaps; + vector outEncaps; cl->ice_invoke("ice_ping", Ice::OperationMode::Normal, inEncaps, outEncaps); test(false); } diff --git a/cpp/test/Ice/stream/Client.cpp b/cpp/test/Ice/stream/Client.cpp index 245ad0a58f0..18fa00c4e03 100644 --- a/cpp/test/Ice/stream/Client.cpp +++ b/cpp/test/Ice/stream/Client.cpp @@ -134,7 +134,7 @@ allTests(Test::TestHelper* helper) std::bind(&MyClassFactoryWrapper::create, &factoryWrapper, std::placeholders::_1); communicator->getValueFactoryManager()->add(f, MyClass::ice_staticId()); - vector data; + vector data; // // Test the stream API. @@ -142,7 +142,7 @@ allTests(Test::TestHelper* helper) cout << "testing primitive types... " << flush; { - vector byte; + vector byte; Ice::InputStream in(communicator, byte); } @@ -152,9 +152,9 @@ allTests(Test::TestHelper* helper) out.write(true); out.endEncapsulation(); out.finished(data); - pair d = out.finished(); + pair d = out.finished(); test(d.second - d.first == static_cast(data.size())); - test(vector(d.first, d.second) == data); + test(vector(d.first, d.second) == data); Ice::InputStream in(communicator, data); in.startEncapsulation(); @@ -165,7 +165,7 @@ allTests(Test::TestHelper* helper) } { - vector byte; + vector byte; Ice::InputStream in(communicator, byte); try { @@ -190,10 +190,10 @@ allTests(Test::TestHelper* helper) { Ice::OutputStream out(communicator); - out.write((Ice::Byte)1); + out.write((uint8_t)1); out.finished(data); Ice::InputStream in(communicator, data); - Ice::Byte v; + uint8_t v; in.read(v); test(v == 1); } @@ -1095,30 +1095,30 @@ allTests(Test::TestHelper* helper) // Test marshaling to user-supplied buffer. // { - Ice::Byte buf[128]; - pair p(&buf[0], &buf[0] + sizeof(buf)); + uint8_t buf[128]; + pair p(&buf[0], &buf[0] + sizeof(buf)); Ice::OutputStream out(communicator, Ice::currentEncoding, p); - vector v; + vector v; v.resize(127); out.write(v); test(out.pos() == 128); // 127 bytes + leading size (1 byte) test(out.b.begin() == buf); // Verify the stream hasn't reallocated. } { - Ice::Byte buf[128]; - pair p(&buf[0], &buf[0] + sizeof(buf)); + uint8_t buf[128]; + pair p(&buf[0], &buf[0] + sizeof(buf)); Ice::OutputStream out(communicator, Ice::currentEncoding, p); - vector v; + vector v; v.resize(127); ::memset(&v[0], 0xFF, v.size()); out.write(v); - out.write(Ice::Byte(0xFF)); // This extra byte should make the stream reallocate. + out.write(uint8_t(0xFF)); // This extra byte should make the stream reallocate. test(out.pos() == 129); // 127 bytes + leading size (1 byte) + 1 byte test(out.b.begin() != buf); // Verify the stream was reallocated. out.finished(data); Ice::InputStream in(communicator, data); - vector v2; + vector v2; in.read(v2); test(v2.size() == 127); test(v == v2); // Make sure the original buffer was preserved. diff --git a/cpp/test/IceSSL/configuration/AllTests.cpp b/cpp/test/IceSSL/configuration/AllTests.cpp index db172c71cb2..36406d61875 100644 --- a/cpp/test/IceSSL/configuration/AllTests.cpp +++ b/cpp/test/IceSSL/configuration/AllTests.cpp @@ -44,10 +44,10 @@ using namespace std; using namespace Ice; string -toHexString(vector data) +toHexString(vector data) { ostringstream os; - for(vector::const_iterator i = data.begin(); i != data.end();) + for(vector::const_iterator i = data.begin(); i != data.end();) { unsigned char c = *i; os.fill('0'); diff --git a/cpp/test/IceUtil/unicode/Client.cpp b/cpp/test/IceUtil/unicode/Client.cpp index 137ac5d8b48..59c9f96e1e0 100644 --- a/cpp/test/IceUtil/unicode/Client.cpp +++ b/cpp/test/IceUtil/unicode/Client.cpp @@ -209,8 +209,8 @@ main(int argc, char* argv[]) cout << "testing IceUtilInternal::toUTF16, toUTF32 and fromUTF32... "; - vector u8 = vector(reinterpret_cast(ns.data()), - reinterpret_cast(ns.data() + ns.length())); + vector u8 = vector(reinterpret_cast(ns.data()), + reinterpret_cast(ns.data() + ns.length())); vector u16 = IceUtilInternal::toUTF16(u8); test(u16.size() == 4); @@ -225,7 +225,7 @@ main(int argc, char* argv[]) test(u32[1] == 0x20ac); test(u32[2] == 0x10437); - vector nu8 = IceUtilInternal::fromUTF32(u32); + vector nu8 = IceUtilInternal::fromUTF32(u32); test(nu8 == u8); cout << "ok" << endl; diff --git a/matlab/src/Endpoint.cpp b/matlab/src/Endpoint.cpp index 9d91be92c8f..1b0a9f354cf 100644 --- a/matlab/src/Endpoint.cpp +++ b/matlab/src/Endpoint.cpp @@ -92,7 +92,7 @@ createInfo(const shared_ptr& info) if(opaqueInfo) { mxSetFieldByNumber(r, 0, Field::RawEncoding, createEncodingVersion(opaqueInfo->rawEncoding)); - Ice::Byte* p = &opaqueInfo->rawBytes[0]; + uint8_t* p = &opaqueInfo->rawBytes[0]; mxSetFieldByNumber(r, 0, Field::RawBytes, createByteArray(p, p + opaqueInfo->rawBytes.size())); } diff --git a/matlab/src/ObjectPrx.cpp b/matlab/src/ObjectPrx.cpp index 024c7c92414..447add43ae9 100644 --- a/matlab/src/ObjectPrx.cpp +++ b/matlab/src/ObjectPrx.cpp @@ -23,8 +23,8 @@ class InvocationFuture : public Future virtual void sent(); void finished(const std::shared_ptr&, const Ice::EncodingVersion&, bool, - std::pair); - void getResults(bool&, pair&); + std::pair); + void getResults(bool&, pair&); protected: @@ -35,7 +35,7 @@ class InvocationFuture : public Future const bool _twoway; State _state; bool _ok; // True for success, false for user exception. - vector _data; + vector _data; }; InvocationFuture::InvocationFuture(bool twoway, bool batch) : @@ -67,7 +67,7 @@ InvocationFuture::exception(exception_ptr e) void InvocationFuture::finished(const std::shared_ptr& /*communicator*/, - const Ice::EncodingVersion& /*encoding*/, bool b, pair p) + const Ice::EncodingVersion& /*encoding*/, bool b, pair p) { lock_guard lock(_mutex); _ok = b; @@ -75,14 +75,14 @@ InvocationFuture::finished(const std::shared_ptr& /*communica _token = nullptr; if(p.second > p.first) { - vector data(p.first, p.second); // Makes a copy. + vector data(p.first, p.second); // Makes a copy. _data.swap(data); // Avoids another copy. } _cond.notify_all(); } void -InvocationFuture::getResults(bool& ok, pair& p) +InvocationFuture::getResults(bool& ok, pair& p) { lock_guard lock(_mutex); assert(_twoway); @@ -192,8 +192,8 @@ Ice_ObjectPrx_read(void* communicator, mxArray* encoding, mxArray* buf, int star { assert(!mxIsEmpty(buf)); - pair p; - p.first = reinterpret_cast(mxGetData(buf)) + start; + pair p; + p.first = reinterpret_cast(mxGetData(buf)) + start; p.second = p.first + size; try @@ -231,7 +231,7 @@ Ice_ObjectPrx_write(void* proxy, void* communicator, mxArray* encoding) Ice::OutputStream out(comm, enc); out.write(prx); - pair p = out.finished(); + pair p = out.finished(); assert(p.second > p.first); return createResultValue(createByteArray(p.first, p.second)); @@ -245,14 +245,14 @@ Ice_ObjectPrx_write(void* proxy, void* communicator, mxArray* encoding) mxArray* Ice_ObjectPrx_ice_invoke(void* self, const char* op, int m, mxArray* inParams, unsigned int size, mxArray* context) { - pair params(0, 0); + pair params(0, 0); if(!mxIsEmpty(inParams)) { - params.first = reinterpret_cast(mxGetData(inParams)); + params.first = reinterpret_cast(mxGetData(inParams)); params.second = params.first + size; } auto mode = static_cast(m); - vector v; + vector v; try { @@ -276,14 +276,14 @@ Ice_ObjectPrx_ice_invoke(void* self, const char* op, int m, mxArray* inParams, u mxArray* Ice_ObjectPrx_ice_invokeNC(void* self, const char* op, int m, mxArray* inParams, unsigned int size) { - pair params(0, 0); + pair params(0, 0); if(!mxIsEmpty(inParams)) { - params.first = reinterpret_cast(mxGetData(inParams)); + params.first = reinterpret_cast(mxGetData(inParams)); params.second = params.first + size; } auto mode = static_cast(m); - vector v; + vector v; try { @@ -307,10 +307,10 @@ Ice_ObjectPrx_ice_invokeAsync(void* self, const char* op, int m, mxArray* inPara mxArray* context, void** future) { const auto proxy = restoreProxy(self); - pair params(0, 0); + pair params(0, 0); if(!mxIsEmpty(inParams)) { - params.first = reinterpret_cast(mxGetData(inParams)); + params.first = reinterpret_cast(mxGetData(inParams)); params.second = params.first + size; } auto mode = static_cast(m); @@ -325,7 +325,7 @@ Ice_ObjectPrx_ice_invokeAsync(void* self, const char* op, int m, mxArray* inPara getStringMap(context, ctx); function token = proxy->ice_invokeAsync( op, mode, params, - [proxy, f](bool ok, pair outParams) + [proxy, f](bool ok, pair outParams) { f->finished(proxy->ice_getCommunicator(), proxy->ice_getEncodingVersion(), ok, outParams); }, @@ -352,10 +352,10 @@ mxArray* Ice_ObjectPrx_ice_invokeAsyncNC(void* self, const char* op, int m, mxArray* inParams, unsigned int size, void** future) { const auto proxy = restoreProxy(self); - pair params(0, 0); + pair params(0, 0); if(!mxIsEmpty(inParams)) { - params.first = reinterpret_cast(mxGetData(inParams)); + params.first = reinterpret_cast(mxGetData(inParams)); params.second = params.first + size; } auto mode = static_cast(m); @@ -368,7 +368,7 @@ Ice_ObjectPrx_ice_invokeAsyncNC(void* self, const char* op, int m, mxArray* inPa { function token = proxy->ice_invokeAsync( op, mode, params, - [proxy, f](bool ok, pair outParams) + [proxy, f](bool ok, pair outParams) { f->finished(proxy->ice_getCommunicator(), proxy->ice_getEncodingVersion(), ok, outParams); @@ -1176,7 +1176,7 @@ Ice_InvocationFuture_results(void* self) } bool ok; - pair p; + pair p; f->getResults(ok, p); mxArray* params = 0; if(p.second > p.first) diff --git a/matlab/src/Util.cpp b/matlab/src/Util.cpp index 770bf74f21e..8ab9cc6e95d 100644 --- a/matlab/src/Util.cpp +++ b/matlab/src/Util.cpp @@ -30,7 +30,7 @@ replace(string s, string patt, string val) } void -getMajorMinor(mxArray* p, Ice::Byte& major, Ice::Byte& minor) +getMajorMinor(mxArray* p, uint8_t& major, uint8_t& minor) { auto maj = mxGetProperty(p, 0, "major"); assert(maj); @@ -38,14 +38,14 @@ getMajorMinor(mxArray* p, Ice::Byte& major, Ice::Byte& minor) { throw std::invalid_argument("major is not a scalar"); } - major = static_cast(mxGetScalar(maj)); + major = static_cast(mxGetScalar(maj)); auto min = mxGetProperty(p, 0, "minor"); assert(min); if(!mxIsScalar(min)) { throw std::invalid_argument("minor is not a scalar"); } - minor = static_cast(mxGetScalar(min)); + minor = static_cast(mxGetScalar(min)); } } @@ -112,10 +112,10 @@ IceMatlab::createBool(bool v) } mxArray* -IceMatlab::createByte(Ice::Byte v) +IceMatlab::createByte(uint8_t v) { auto r = mxCreateNumericMatrix(1, 1, mxUINT8_CLASS, mxREAL); - auto p = reinterpret_cast(mxGetPr(r)); + auto p = reinterpret_cast(mxGetPr(r)); *p = v; return r; } @@ -587,15 +587,15 @@ IceMatlab::getStringList(mxArray* m, vector& v) } mxArray* -IceMatlab::createByteArray(const Ice::Byte* begin, const Ice::Byte* end) +IceMatlab::createByteArray(const uint8_t* begin, const uint8_t* end) { mxArray* r = mxCreateUninitNumericMatrix(1, end - begin, mxUINT8_CLASS, mxREAL); - memcpy(reinterpret_cast(mxGetData(r)), begin, end - begin); + memcpy(reinterpret_cast(mxGetData(r)), begin, end - begin); return r; } mxArray* -IceMatlab::createByteList(const vector& bytes) +IceMatlab::createByteList(const vector& bytes) { auto r = mxCreateCellMatrix(1, static_cast(bytes.size())); mwIndex i = 0; diff --git a/matlab/src/Util.h b/matlab/src/Util.h index c4d040592a5..fbbc9da11e0 100644 --- a/matlab/src/Util.h +++ b/matlab/src/Util.h @@ -19,7 +19,7 @@ mxArray* createStringFromUTF8(const std::string&); std::string getStringFromUTF16(mxArray*); mxArray* createEmpty(); mxArray* createBool(bool); -mxArray* createByte(Ice::Byte); +mxArray* createByte(std::uint8_t); mxArray* createShort(short); mxArray* createInt(int); mxArray* createLong(long long); @@ -41,8 +41,8 @@ mxArray* createResultException(mxArray*); mxArray* createOptionalValue(bool, mxArray*); mxArray* createStringList(const std::vector&); void getStringList(mxArray*, std::vector&); -mxArray* createByteArray(const Ice::Byte*, const Ice::Byte*); -mxArray* createByteList(const std::vector&); +mxArray* createByteArray(const std::uint8_t*, const std::uint8_t*); +mxArray* createByteList(const std::vector&); mxArray* createCertificateList(const std::vector&); std::string idToClass(const std::string&); diff --git a/php/src/Operation.cpp b/php/src/Operation.cpp index 054f510caee..4ef9b93cc93 100644 --- a/php/src/Operation.cpp +++ b/php/src/Operation.cpp @@ -115,9 +115,9 @@ class TypedInvocation : public Invocation OperationIPtr _op; - bool prepareRequest(int, zval*, Ice::OutputStream*, pair&); - void unmarshalResults(int, zval*, zval*, const pair&); - void unmarshalException(zval*, const pair&); + bool prepareRequest(int, zval*, Ice::OutputStream*, pair&); + void unmarshalResults(int, zval*, zval*, const pair&); + void unmarshalException(zval*, const pair&); bool validateException(const ExceptionInfoPtr&) const; void checkTwowayOnly(const Ice::ObjectPrx&) const; }; @@ -381,7 +381,7 @@ IcePHP::TypedInvocation::prepareRequest( int argc, zval* args, Ice::OutputStream* os, - pair& params) + pair& params) { // Verify that the expected number of arguments are supplied. The context argument is optional. if(argc != _op->numParams && argc != _op->numParams + 1) @@ -475,7 +475,7 @@ IcePHP::TypedInvocation::unmarshalResults( int argc, zval* args, zval* ret, - const pair& bytes) + const pair& bytes) { Ice::InputStream is(_communicator->getCommunicator(), bytes); @@ -559,7 +559,7 @@ IcePHP::TypedInvocation::unmarshalResults( } void -IcePHP::TypedInvocation::unmarshalException(zval* zex, const pair& bytes) +IcePHP::TypedInvocation::unmarshalException(zval* zex, const pair& bytes) { Ice::InputStream is(_communicator->getCommunicator(), bytes); @@ -662,7 +662,7 @@ IcePHP::SyncTypedInvocation::invoke(INTERNAL_FUNCTION_PARAMETERS) } Ice::OutputStream os(_prx->ice_getCommunicator()); - pair params; + pair params; if (!prepareRequest(ZEND_NUM_ARGS(), args, &os, params)) { return; @@ -684,7 +684,7 @@ IcePHP::SyncTypedInvocation::invoke(INTERNAL_FUNCTION_PARAMETERS) checkTwowayOnly(_prx); // Invoke the operation. - vector result; + vector result; bool status; { if(hasCtx) @@ -703,7 +703,7 @@ IcePHP::SyncTypedInvocation::invoke(INTERNAL_FUNCTION_PARAMETERS) if(!status) { // Unmarshal a user exception. - pair rb(0, 0); + pair rb(0, 0); if(!result.empty()) { rb.first = &result[0]; @@ -721,7 +721,7 @@ IcePHP::SyncTypedInvocation::invoke(INTERNAL_FUNCTION_PARAMETERS) else if(!_op->outParams.empty() || _op->returnType) { // Unmarshal the results. - pair rb(0, 0); + pair rb(0, 0); if(!result.empty()) { rb.first = &result[0]; diff --git a/php/src/Types.cpp b/php/src/Types.cpp index ced9ddb40f2..57aebd2a34b 100644 --- a/php/src/Types.cpp +++ b/php/src/Types.cpp @@ -396,12 +396,12 @@ IcePHP::StreamUtil::getSlicedDataMember(zval* obj, ObjectMap* objectMap) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wshadow" #endif - vector::size_type i = 0; + vector::size_type i = 0; ZEND_HASH_FOREACH_VAL(barr, e) { long l = static_cast(Z_LVAL_P(e)); assert(l >= 0 && l <= 255); - info->bytes[i++] = static_cast(l); + info->bytes[i++] = static_cast(l); } ZEND_HASH_FOREACH_END(); #if defined(__clang__) @@ -757,7 +757,7 @@ IcePHP::PrimitiveInfo::marshal(zval* zv, Ice::OutputStream* os, ObjectMap*, bool assert(Z_TYPE_P(zv) == IS_LONG); long val = static_cast(Z_LVAL_P(zv)); assert(val >= 0 && val <= 255); // validate() should have caught this. - os->write(static_cast(val)); + os->write(static_cast(val)); break; } case PrimitiveInfo::KindShort: @@ -869,7 +869,7 @@ IcePHP::PrimitiveInfo::unmarshal( } case PrimitiveInfo::KindByte: { - Ice::Byte val; + uint8_t val; is->read(val); ZVAL_LONG(&zv, val & 0xff); break; @@ -1625,7 +1625,7 @@ IcePHP::SequenceInfo::marshalPrimitiveSequence(const PrimitiveInfoPtr& pi, zval* } long l = static_cast(Z_LVAL_P(val)); assert(l >= 0 && l <= 255); - seq[i++] = static_cast(l); + seq[i++] = static_cast(l); } ZEND_HASH_FOREACH_END(); @@ -1820,9 +1820,9 @@ IcePHP::SequenceInfo::unmarshalPrimitiveSequence( } case PrimitiveInfo::KindByte: { - pair pr; + pair pr; is->read(pr); - for (const Ice::Byte* p = pr.first; p != pr.second; ++p) + for (const uint8_t* p = pr.first; p != pr.second; ++p) { add_next_index_long(&zv, *p & 0xff); } diff --git a/php/src/Util.cpp b/php/src/Util.cpp index 4fa5c90777c..7249f80dd63 100644 --- a/php/src/Util.cpp +++ b/php/src/Util.cpp @@ -99,7 +99,7 @@ getVersion(zval* zv, T& v, const char* type) invalidArgument("version major must be a value between 0 and 255"); return false; } - v.major = static_cast(m); + v.major = static_cast(m); m = static_cast(Z_LVAL_P(&minorVal)); if(m < 0 || m > 255) @@ -107,7 +107,7 @@ getVersion(zval* zv, T& v, const char* type) invalidArgument("version minor must be a value between 0 and 255"); return false; } - v.minor = static_cast(m); + v.minor = static_cast(m); return true; } diff --git a/python/modules/IcePy/Operation.cpp b/python/modules/IcePy/Operation.cpp index dacca9da30c..260cdb3bc3e 100644 --- a/python/modules/IcePy/Operation.cpp +++ b/python/modules/IcePy/Operation.cpp @@ -101,9 +101,9 @@ class Invocation enum MappingType { SyncMapping, AsyncMapping }; bool prepareRequest(const OperationPtr&, PyObject*, MappingType, Ice::OutputStream*, - pair&); - PyObject* unmarshalResults(const OperationPtr&, const pair&); - PyObject* unmarshalException(const OperationPtr&, const pair&); + pair&); + PyObject* unmarshalResults(const OperationPtr&, const pair&); + PyObject* unmarshalException(const OperationPtr&, const pair&); bool validateException(const OperationPtr&, PyObject*) const; void checkTwowayOnly(const OperationPtr&, const Ice::ObjectPrx&) const; @@ -134,14 +134,14 @@ class AsyncInvocation : public Invocation PyObject* invoke(PyObject*, PyObject* = 0) final; - void response(bool, const pair&); + void response(bool, const pair&); void exception(const Ice::Exception&); void sent(bool); protected: virtual function handleInvoke(PyObject*, PyObject*) = 0; - virtual void handleResponse(PyObject*, bool, const pair&) = 0; + virtual void handleResponse(PyObject*, bool, const pair&) = 0; PyObject* _pyProxy; string _operation; @@ -151,7 +151,7 @@ class AsyncInvocation : public Invocation bool _done; PyObject* _future; bool _ok; - vector _results; + vector _results; PyObject* _exception; }; using AsyncInvocationPtr = shared_ptr; @@ -165,7 +165,7 @@ class AsyncTypedInvocation final : public AsyncInvocation, public enable_shared_ protected: function handleInvoke(PyObject*, PyObject*) final; - void handleResponse(PyObject*, bool, const pair&) final; + void handleResponse(PyObject*, bool, const pair&) final; private: @@ -190,7 +190,7 @@ class AsyncBlobjectInvocation final : public AsyncInvocation, public enable_shar protected: function handleInvoke(PyObject*, PyObject*) final; - void handleResponse(PyObject*, bool, const pair&) final; + void handleResponse(PyObject*, bool, const pair&) final; string _op; }; @@ -200,7 +200,7 @@ class Upcall : public enable_shared_from_this { public: - virtual void dispatch(PyObject*, const pair&, const Ice::Current&) = 0; + virtual void dispatch(PyObject*, const pair&, const Ice::Current&) = 0; virtual void response(PyObject*) = 0; virtual void exception(PyException&) = 0; @@ -217,11 +217,11 @@ class TypedUpcall final : public Upcall TypedUpcall( const OperationPtr&, - function&)>, + function&)>, function, const Ice::CommunicatorPtr&); - void dispatch(PyObject*, const pair&, const Ice::Current&) final; + void dispatch(PyObject*, const pair&, const Ice::Current&) final; void response(PyObject*) final; void exception(PyException&) final; @@ -229,7 +229,7 @@ class TypedUpcall final : public Upcall OperationPtr _op; - function&)> _response; + function&)> _response; function _error; Ice::CommunicatorPtr _communicator; @@ -245,16 +245,16 @@ class BlobjectUpcall final : public Upcall public: BlobjectUpcall( - function&)>, + function&)>, function); - void dispatch(PyObject*, const pair&, const Ice::Current&) final; + void dispatch(PyObject*, const pair&, const Ice::Current&) final; void response(PyObject*) final; void exception(PyException&) final; private: - function&)> _response; + function&)> _response; function _error; }; @@ -266,8 +266,8 @@ class TypedServantWrapper final : public ServantWrapper TypedServantWrapper(PyObject*); void ice_invokeAsync( - pair inEncaps, - function&)> response, + pair inEncaps, + function&)> response, function error, const Ice::Current& current) final; @@ -286,8 +286,8 @@ class BlobjectServantWrapper final : public ServantWrapper BlobjectServantWrapper(PyObject*); void ice_invokeAsync( - pair inEncaps, - function&)> response, + pair inEncaps, + function&)> response, function error, const Ice::Current& current) final; }; @@ -1379,10 +1379,10 @@ IcePy::Invocation::Invocation(const Ice::ObjectPrx& prx) : bool IcePy::Invocation::prepareRequest(const OperationPtr& op, PyObject* args, MappingType mapping, Ice::OutputStream* os, - pair& params) + pair& params) { assert(PyTuple_Check(args)); - params.first = params.second = static_cast(0); + params.first = params.second = static_cast(0); // // Validate the number of arguments. @@ -1489,7 +1489,7 @@ IcePy::Invocation::prepareRequest(const OperationPtr& op, PyObject* args, Mappin } PyObject* -IcePy::Invocation::unmarshalResults(const OperationPtr& op, const pair& bytes) +IcePy::Invocation::unmarshalResults(const OperationPtr& op, const pair& bytes) { Py_ssize_t numResults = static_cast(op->outParams.size()); if(op->returnType) @@ -1568,7 +1568,7 @@ IcePy::Invocation::unmarshalResults(const OperationPtr& op, const pair& bytes) +IcePy::Invocation::unmarshalException(const OperationPtr& op, const pair& bytes) { Ice::InputStream is(_communicator, bytes); @@ -1682,7 +1682,7 @@ IcePy::SyncTypedInvocation::invoke(PyObject* args, PyObject* /* kwds */) // Marshal the input parameters to a byte sequence. // Ice::OutputStream os(_communicator); - pair params; + pair params; if(!prepareRequest(_op, pyparams, SyncMapping, &os, params)) { return 0; @@ -1695,7 +1695,7 @@ IcePy::SyncTypedInvocation::invoke(PyObject* args, PyObject* /* kwds */) // // Invoke the operation. // - vector result; + vector result; bool status; Ice::Context ctx; if(pyctx != Py_None) @@ -1727,7 +1727,7 @@ IcePy::SyncTypedInvocation::invoke(PyObject* args, PyObject* /* kwds */) // if(_prx->ice_isTwoway()) { - pair rb { 0, 0 }; + pair rb { 0, 0 }; if(!result.empty()) { rb.first = &result[0]; @@ -1915,7 +1915,7 @@ IcePy::AsyncInvocation::invoke(PyObject* args, PyObject* kwds) // // Delegate to the subclass. // - pair p(&_results[0], &_results[0] + _results.size()); + pair p(&_results[0], &_results[0] + _results.size()); handleResponse(future.get(), _ok, p); if(PyErr_Occurred()) { @@ -1938,7 +1938,7 @@ IcePy::AsyncInvocation::invoke(PyObject* args, PyObject* kwds) } void -IcePy::AsyncInvocation::response(bool ok, const pair& results) +IcePy::AsyncInvocation::response(bool ok, const pair& results) { AdoptThread adoptThread; // Ensure the current thread is able to call into Python. @@ -1948,7 +1948,7 @@ IcePy::AsyncInvocation::response(bool ok, const pair v(results.first, results.second); + vector v(results.first, results.second); _results.swap(v); _done = true; return; @@ -2083,7 +2083,7 @@ IcePy::AsyncTypedInvocation::handleInvoke(PyObject* args, PyObject* /* kwds */) // Marshal the input parameters to a byte sequence. Ice::OutputStream os(_communicator); - pair params; + pair params; if(!prepareRequest(_op, pyparams, AsyncMapping, &os, params)) { return 0; @@ -2112,7 +2112,7 @@ IcePy::AsyncTypedInvocation::handleInvoke(PyObject* args, PyObject* /* kwds */) _op->name, _op->sendMode, params, - [self](bool ok, const pair& results) + [self](bool ok, const pair& results) { self->response(ok, results); }, @@ -2138,7 +2138,7 @@ void IcePy::AsyncTypedInvocation::handleResponse( PyObject* future, bool ok, - const pair& results) + const pair& results) { try { @@ -2224,18 +2224,18 @@ IcePy::SyncBlobjectInvocation::invoke(PyObject* args, PyObject* /* kwds */) assert(!PyErr_Occurred()); Py_ssize_t sz = PyBytes_GET_SIZE(inParams); - pair in( - static_cast(0), - static_cast(0)); + pair in( + static_cast(0), + static_cast(0)); if(sz > 0) { - in.first = reinterpret_cast(PyBytes_AS_STRING(inParams)); + in.first = reinterpret_cast(PyBytes_AS_STRING(inParams)); in.second = in.first + sz; } try { - vector out; + vector out; bool ok; Ice::Context context; @@ -2319,10 +2319,10 @@ IcePy::AsyncBlobjectInvocation::handleInvoke(PyObject* args, PyObject* /* kwds * assert(!PyErr_Occurred()); Py_ssize_t sz = PyBytes_GET_SIZE(inParams); - pair params { 0, 0 }; + pair params { 0, 0 }; if(sz > 0) { - params.first = reinterpret_cast(PyBytes_AS_STRING(inParams)); + params.first = reinterpret_cast(PyBytes_AS_STRING(inParams)); params.second = params.first + sz; } @@ -2340,7 +2340,7 @@ IcePy::AsyncBlobjectInvocation::handleInvoke(PyObject* args, PyObject* /* kwds * operation, sendMode, params, - [self](bool ok, const pair& results) + [self](bool ok, const pair& results) { self->response(ok, results); }, @@ -2366,7 +2366,7 @@ void IcePy::AsyncBlobjectInvocation::handleResponse( PyObject* future, bool ok, - const pair& results) + const pair& results) { // Prepare the args as a tuple of the bool and out param buffer. PyObjectHandle args = PyTuple_New(2); @@ -2476,7 +2476,7 @@ Upcall::dispatchImpl(PyObject* servant, const string& dispatchName, PyObject* ar // IcePy::TypedUpcall::TypedUpcall( const OperationPtr& op, - function&)> response, + function&)> response, function error, const Ice::CommunicatorPtr& communicator) : _op(op), @@ -2489,7 +2489,7 @@ IcePy::TypedUpcall::TypedUpcall( void IcePy::TypedUpcall::dispatch( PyObject* servant, - const pair& inBytes, + const pair& inBytes, const Ice::Current& current) { _encoding = current.encoding; @@ -2673,7 +2673,7 @@ IcePy::TypedUpcall::exception(PyException& ex) // BlobjectUpcall // IcePy::BlobjectUpcall::BlobjectUpcall( - function&)> response, + function&)> response, function error) : _response(std::move(response)), _error(std::move(error)) @@ -2683,7 +2683,7 @@ IcePy::BlobjectUpcall::BlobjectUpcall( void IcePy::BlobjectUpcall::dispatch( PyObject* servant, - const pair& inBytes, + const pair& inBytes, const Ice::Current& current) { Ice::CommunicatorPtr communicator = current.adapter->getCommunicator(); @@ -2746,10 +2746,10 @@ IcePy::BlobjectUpcall::response(PyObject* result) } Py_ssize_t sz = PyBytes_GET_SIZE(arg); - pair r { 0, 0 }; + pair r { 0, 0 }; if(sz > 0) { - r.first = reinterpret_cast(PyBytes_AS_STRING(arg)); + r.first = reinterpret_cast(PyBytes_AS_STRING(arg)); r.second = r.first + sz; } @@ -3077,8 +3077,8 @@ IcePy::TypedServantWrapper::TypedServantWrapper(PyObject* servant) : void IcePy::TypedServantWrapper::ice_invokeAsync( - pair inParams, - function&)> response, + pair inParams, + function&)> response, function error, const Ice::Current& current) { @@ -3160,8 +3160,8 @@ IcePy::BlobjectServantWrapper::BlobjectServantWrapper(PyObject* servant) : void IcePy::BlobjectServantWrapper::ice_invokeAsync( - pair inParams, - function&)> response, + pair inParams, + function&)> response, function error, const Ice::Current& current) { diff --git a/python/modules/IcePy/Types.cpp b/python/modules/IcePy/Types.cpp index da25cba7db2..307d38bb3d0 100644 --- a/python/modules/IcePy/Types.cpp +++ b/python/modules/IcePy/Types.cpp @@ -534,7 +534,7 @@ IcePy::StreamUtil::getSlicedDataMember(PyObject* obj, ObjectMap* objectMap) Py_ssize_t strsz; assert(PyBytes_Check(bytes.get())); PyBytes_AsStringAndSize(bytes.get(), &str, &strsz); - vector vtmp(reinterpret_cast(str), reinterpret_cast(str + strsz)); + vector vtmp(reinterpret_cast(str), reinterpret_cast(str + strsz)); info->bytes.swap(vtmp); PyObjectHandle instances = getAttr(s.get(), "instances", false); @@ -835,7 +835,7 @@ IcePy::PrimitiveInfo::marshal(PyObject* p, Ice::OutputStream* os, ObjectMap*, bo long val = PyLong_AsLong(p); assert(!PyErr_Occurred()); // validate() should have caught this. assert(val >= 0 && val <= 255); // validate() should have caught this. - os->write(static_cast(val)); + os->write(static_cast(val)); break; } case PrimitiveInfo::KindShort: @@ -917,7 +917,7 @@ IcePy::PrimitiveInfo::unmarshal(Ice::InputStream* is, const UnmarshalCallbackPtr } case PrimitiveInfo::KindByte: { - Ice::Byte val; + uint8_t val; is->read(val); PyObjectHandle p = PyLong_FromLong(val); cb->unmarshaled(p.get(), target, closure); @@ -1800,7 +1800,7 @@ IcePy::SequenceInfo::marshalPrimitiveSequence(const PrimitiveInfoPtr& pi, PyObje throw AbortMarshaling(); } } - const Ice::Byte* b = reinterpret_cast(pybuf.buf); + const uint8_t* b = reinterpret_cast(pybuf.buf); Py_ssize_t sz = pybuf.len; switch(pi->kind) @@ -1813,8 +1813,8 @@ IcePy::SequenceInfo::marshalPrimitiveSequence(const PrimitiveInfoPtr& pi, PyObje } case PrimitiveInfo::KindByte: { - os->write(reinterpret_cast(b), - reinterpret_cast(b + sz)); + os->write(reinterpret_cast(b), + reinterpret_cast(b + sz)); break; } case PrimitiveInfo::KindShort: @@ -1902,7 +1902,7 @@ IcePy::SequenceInfo::marshalPrimitiveSequence(const PrimitiveInfoPtr& pi, PyObje assert(PyBytes_Check(p)); char* str; PyBytes_AsStringAndSize(p, &str, &sz); - os->write(reinterpret_cast(str), reinterpret_cast(str + sz)); + os->write(reinterpret_cast(str), reinterpret_cast(str + sz)); } else { @@ -1925,7 +1925,7 @@ IcePy::SequenceInfo::marshalPrimitiveSequence(const PrimitiveInfoPtr& pi, PyObje static_cast(i)); throw AbortMarshaling(); } - seq[static_cast(i)] = static_cast(val); + seq[static_cast(i)] = static_cast(val); } os->write(seq); } @@ -2174,7 +2174,7 @@ IcePy::SequenceInfo::unmarshalPrimitiveSequence(const PrimitiveInfoPtr& pi, Ice: } case PrimitiveInfo::KindByte: { - pair p; + pair p; is->read(p); int sz = static_cast(p.second - p.first); if(sm->factory) @@ -2627,7 +2627,7 @@ IcePy::CustomInfo::marshal(PyObject* p, Ice::OutputStream* os, ObjectMap* /*obje char* str; Py_ssize_t sz; PyBytes_AsStringAndSize(obj.get(), &str, &sz); - os->write(reinterpret_cast(str), reinterpret_cast(str + sz)); + os->write(reinterpret_cast(str), reinterpret_cast(str + sz)); } void @@ -2637,7 +2637,7 @@ IcePy::CustomInfo::unmarshal(Ice::InputStream* is, const UnmarshalCallbackPtr& c // // Unmarshal the raw byte sequence. // - pair seq; + pair seq; is->read(seq); int sz = static_cast(seq.second - seq.first); diff --git a/python/modules/IcePy/Util.cpp b/python/modules/IcePy/Util.cpp index e9ee7296ae7..c3238b2029e 100644 --- a/python/modules/IcePy/Util.cpp +++ b/python/modules/IcePy/Util.cpp @@ -53,7 +53,7 @@ getVersion(PyObject* p, T& v) PyErr_Format(PyExc_ValueError, STRCAST("version major must be a value between 0 and 255")); return false; } - v.major = static_cast(m); + v.major = static_cast(m); } else { @@ -74,7 +74,7 @@ getVersion(PyObject* p, T& v) PyErr_Format(PyExc_ValueError, STRCAST("version minor must be a value between 0 and 255")); return false; } - v.minor = static_cast(m); + v.minor = static_cast(m); } else { diff --git a/ruby/src/IceRuby/Operation.cpp b/ruby/src/IceRuby/Operation.cpp index a658e5eaaa1..d160a58feb5 100644 --- a/ruby/src/IceRuby/Operation.cpp +++ b/ruby/src/IceRuby/Operation.cpp @@ -69,9 +69,9 @@ class OperationI final : public Operation void convertParams(VALUE, ParamInfoList&, long, bool&); ParamInfoPtr convertParam(VALUE, long); - void prepareRequest(const Ice::ObjectPrx&, VALUE, Ice::OutputStream*, pair&); - VALUE unmarshalResults(const vector&, const Ice::CommunicatorPtr&); - VALUE unmarshalException(const vector&, const Ice::CommunicatorPtr&); + void prepareRequest(const Ice::ObjectPrx&, VALUE, Ice::OutputStream*, pair&); + VALUE unmarshalResults(const vector&, const Ice::CommunicatorPtr&); + VALUE unmarshalException(const vector&, const Ice::CommunicatorPtr&); bool validateException(VALUE) const; void checkTwowayOnly(const Ice::ObjectPrx&) const; }; @@ -283,7 +283,7 @@ IceRuby::OperationI::invoke(const Ice::ObjectPrx& proxy, VALUE args, VALUE hctx) // Marshal the input parameters to a byte sequence. // Ice::OutputStream os(communicator); - pair params; + pair params; prepareRequest(proxy, args, &os, params); if(!_deprecateMessage.empty()) @@ -396,9 +396,9 @@ IceRuby::OperationI::prepareRequest( const Ice::ObjectPrx& proxy, VALUE args, Ice::OutputStream* os, - pair& params) + pair& params) { - params.first = params.second = static_cast(0); + params.first = params.second = static_cast(0); // // Validate the number of arguments. @@ -473,7 +473,7 @@ IceRuby::OperationI::prepareRequest( } VALUE -IceRuby::OperationI::unmarshalResults(const vector& bytes, const Ice::CommunicatorPtr& communicator) +IceRuby::OperationI::unmarshalResults(const vector& bytes, const Ice::CommunicatorPtr& communicator) { int numResults = static_cast(_outParams.size()); if(_returnType) @@ -555,7 +555,7 @@ IceRuby::OperationI::unmarshalResults(const vector& bytes, const Ice: } VALUE -IceRuby::OperationI::unmarshalException(const vector& bytes, const Ice::CommunicatorPtr& communicator) +IceRuby::OperationI::unmarshalException(const vector& bytes, const Ice::CommunicatorPtr& communicator) { Ice::InputStream is(communicator, bytes); diff --git a/ruby/src/IceRuby/Types.cpp b/ruby/src/IceRuby/Types.cpp index 2810c5d6142..504fa5b7f8e 100644 --- a/ruby/src/IceRuby/Types.cpp +++ b/ruby/src/IceRuby/Types.cpp @@ -358,8 +358,8 @@ IceRuby::StreamUtil::getSlicedDataMember(VALUE obj, ValueMap* valueMap) const long len = RSTRING_LEN(bytes); if(str != 0 && len != 0) { - vector vtmp(reinterpret_cast(str), - reinterpret_cast(str + len)); + vector vtmp(reinterpret_cast(str), + reinterpret_cast(str + len)); info->bytes.swap(vtmp); } @@ -554,7 +554,7 @@ IceRuby::PrimitiveInfo::marshal(VALUE p, Ice::OutputStream* os, ValueMap*, bool) long i = getInteger(p); if(i >= 0 && i <= 255) { - os->write(static_cast(i)); + os->write(static_cast(i)); break; } throw RubyException(rb_eTypeError, "value is out of range for a byte"); @@ -640,7 +640,7 @@ IceRuby::PrimitiveInfo::unmarshal(Ice::InputStream* is, const UnmarshalCallbackP } case PrimitiveInfo::KindByte: { - Ice::Byte b; + uint8_t b; is->read(b); val = callRuby(rb_int2inum, b); break; @@ -1420,7 +1420,7 @@ IceRuby::SequenceInfo::marshalPrimitiveSequence(const PrimitiveInfoPtr& pi, VALU } else { - os->write(reinterpret_cast(s), reinterpret_cast(s + len)); + os->write(reinterpret_cast(s), reinterpret_cast(s + len)); } } else @@ -1434,7 +1434,7 @@ IceRuby::SequenceInfo::marshalPrimitiveSequence(const PrimitiveInfoPtr& pi, VALU { throw RubyException(rb_eTypeError, "invalid value for element %ld of sequence", i); } - seq[static_cast(i)] = static_cast(val); + seq[static_cast(i)] = static_cast(val); } os->write(seq); } @@ -1568,7 +1568,7 @@ IceRuby::SequenceInfo::unmarshalPrimitiveSequence(const PrimitiveInfoPtr& pi, Ic } case PrimitiveInfo::KindByte: { - pair p; + pair p; is->read(p); result = callRuby(rb_str_new, reinterpret_cast(p.first), static_cast(p.second - p.first)); break; diff --git a/ruby/src/IceRuby/Util.cpp b/ruby/src/IceRuby/Util.cpp index 947635da8e2..7e411d6018a 100644 --- a/ruby/src/IceRuby/Util.cpp +++ b/ruby/src/IceRuby/Util.cpp @@ -378,13 +378,13 @@ IceRuby::stringSeqToArray(const vector& seq) } VALUE -IceRuby::createNumSeq(const vector& v) +IceRuby::createNumSeq(const vector& v) { volatile VALUE result = createArray(v.size()); long i = 0; if(v.size() > 0) { - for(vector::const_iterator p = v.begin(); p != v.end(); ++p, ++i) + for(vector::const_iterator p = v.begin(); p != v.end(); ++p, ++i) { RARRAY_ASET(result, i, INT2FIX(*p)); } diff --git a/ruby/src/IceRuby/Util.h b/ruby/src/IceRuby/Util.h index 2b0d6f2f86b..396ee2556d0 100644 --- a/ruby/src/IceRuby/Util.h +++ b/ruby/src/IceRuby/Util.h @@ -94,10 +94,10 @@ bool arrayToStringSeq(VALUE, std::vector&); VALUE stringSeqToArray(const std::vector&); // -// Convert a vector of Ice::Byte into a Ruby array of numbers. +// Convert a vector of std::uint8_t into a Ruby array of numbers. // May raise RubyException. // -VALUE createNumSeq(const std::vector&); +VALUE createNumSeq(const std::vector&); // // Convert a Ruby hash to Ice::Context. Returns true on success diff --git a/swift/src/IceImpl/BlobjectFacade.h b/swift/src/IceImpl/BlobjectFacade.h index 7736502edd8..9726f3d9203 100644 --- a/swift/src/IceImpl/BlobjectFacade.h +++ b/swift/src/IceImpl/BlobjectFacade.h @@ -48,8 +48,8 @@ class BlobjectFacade : public Ice::BlobjectArrayAsync } virtual void - ice_invokeAsync(std::pair inEncaps, - std::function&)> response, + ice_invokeAsync(std::pair inEncaps, + std::function&)> response, std::function error, const Ice::Current& current); diff --git a/swift/src/IceImpl/BlobjectFacade.mm b/swift/src/IceImpl/BlobjectFacade.mm index 446535fdd30..a54d857bd83 100644 --- a/swift/src/IceImpl/BlobjectFacade.mm +++ b/swift/src/IceImpl/BlobjectFacade.mm @@ -9,13 +9,13 @@ #import "Connection.h" void -BlobjectFacade::ice_invokeAsync(std::pair inEncaps, - std::function&)> response, +BlobjectFacade::ice_invokeAsync(std::pair inEncaps, + std::function&)> response, std::function error, const Ice::Current& current) { ICEBlobjectResponse responseCallback = ^(bool ok, const void* outParams, long count) { - const Ice::Byte* start = static_cast(outParams); + const std::uint8_t* start = static_cast(outParams); response(ok, std::make_pair(start, start + static_cast(count))); }; @@ -29,13 +29,13 @@ @autoreleasepool { [_facade facadeInvoke:adapter - inEncapsBytes:const_cast(inEncaps.first) + inEncapsBytes:const_cast(inEncaps.first) inEncapsCount:static_cast(inEncaps.second - inEncaps.first) con:con name:toNSString(current.id.name) category:toNSString(current.id.category) facet:toNSString(current.facet) operation:toNSString(current.operation) - mode:static_cast(current.mode) + mode:static_cast(current.mode) context:toNSDictionary(current.ctx) requestId:current.requestId encodingMajor:current.encoding.major diff --git a/swift/src/IceImpl/Communicator.mm b/swift/src/IceImpl/Communicator.mm index b3295e21550..c284011d020 100644 --- a/swift/src/IceImpl/Communicator.mm +++ b/swift/src/IceImpl/Communicator.mm @@ -216,7 +216,7 @@ -(BOOL) setDefaultLocator:(ICEObjectPrx*)locator error:(NSError**)error } } --(BOOL) flushBatchRequests:(uint8_t)compress error:(NSError**)error +-(BOOL) flushBatchRequests:(std::uint8_t)compress error:(NSError**)error { try { @@ -230,7 +230,7 @@ -(BOOL) flushBatchRequests:(uint8_t)compress error:(NSError**)error } } --(void) flushBatchRequestsAsync:(uint8_t)compress +-(void) flushBatchRequestsAsync:(std::uint8_t)compress exception:(void (^)(NSError*))exception sent:(void (^_Nullable)(bool))sent { @@ -399,16 +399,16 @@ -(nullable dispatch_queue_t) getServerDispatchQueue:(NSError* _Nullable * _Nulla } } --(void) getDefaultEncoding:(uint8_t*)major minor:(uint8_t*)minor +-(void) getDefaultEncoding:(std::uint8_t*)major minor:(std::uint8_t*)minor { auto defaultEncoding = IceInternal::getInstance(self.communicator)->defaultsAndOverrides()->defaultEncoding; *major = defaultEncoding.major; *minor = defaultEncoding.minor; } --(uint8_t) getDefaultFormat +-(std::uint8_t) getDefaultFormat { - return static_cast(IceInternal::getInstance(self.communicator)->defaultsAndOverrides()->defaultFormat); + return static_cast(IceInternal::getInstance(self.communicator)->defaultsAndOverrides()->defaultFormat); } -(id) facetToFacade:(const std::shared_ptr&) servant diff --git a/swift/src/IceImpl/Connection.mm b/swift/src/IceImpl/Connection.mm index 64cc661a0f5..a593c9f6f02 100644 --- a/swift/src/IceImpl/Connection.mm +++ b/swift/src/IceImpl/Connection.mm @@ -16,7 +16,7 @@ @implementation ICEConnection return std::static_pointer_cast(self.cppObject); } --(void) close:(uint8_t)mode +-(void) close:(std::uint8_t)mode { self.connection->close(Ice::ConnectionClose(mode)); } @@ -62,7 +62,7 @@ -(ICEEndpoint*) getEndpoint return [ICEEndpoint getHandle:endpoint]; } --(BOOL) flushBatchRequests:(uint8_t)compress error:(NSError**)error +-(BOOL) flushBatchRequests:(std::uint8_t)compress error:(NSError**)error { try { @@ -76,7 +76,7 @@ -(BOOL) flushBatchRequests:(uint8_t)compress error:(NSError**)error } } --(void) flushBatchRequestsAsync:(uint8_t)compress +-(void) flushBatchRequestsAsync:(std::uint8_t)compress exception:(void (^)(NSError*))exception sent:(void (^_Nullable)(bool))sent { @@ -223,12 +223,12 @@ -(void) setACM:(NSNumber* _Nullable)timeout close:(NSNumber* _Nullable)close hea self.connection->setACM(opTimeout, opClose, opHeartbeat); } --(void) getACM:(int32_t*)timeout close:(uint8_t*)close heartbeat:(uint8_t*)heartbeat +-(void) getACM:(int32_t*)timeout close:(std::uint8_t*)close heartbeat:(std::uint8_t*)heartbeat { auto acm = self.connection->getACM(); *timeout = acm.timeout; - *close = static_cast(acm.close); - *heartbeat = static_cast(acm.heartbeat); + *close = static_cast(acm.close); + *heartbeat = static_cast(acm.heartbeat); } -(NSString*) type diff --git a/swift/src/IceImpl/IceUtil.mm b/swift/src/IceImpl/IceUtil.mm index af775f53768..712f0037a80 100644 --- a/swift/src/IceImpl/IceUtil.mm +++ b/swift/src/IceImpl/IceUtil.mm @@ -175,7 +175,7 @@ +(BOOL) stringToIdentity:(NSString*)str +(NSString*) identityToString:(NSString*)name category:(NSString*)category - mode:(uint8_t)mode + mode:(std::uint8_t)mode { Ice::Identity identity{fromNSString(name), fromNSString(category)}; return toNSString(Ice::identityToString(identity, static_cast(mode))); diff --git a/swift/src/IceImpl/ObjectPrx.mm b/swift/src/IceImpl/ObjectPrx.mm index 5c567d9e367..4e84858bbec 100644 --- a/swift/src/IceImpl/ObjectPrx.mm +++ b/swift/src/IceImpl/ObjectPrx.mm @@ -204,12 +204,12 @@ -(instancetype) ice_connectionCached:(bool)cached error:(NSError**)error } } --(uint8_t) ice_getEndpointSelection +-(std::uint8_t) ice_getEndpointSelection { - return static_cast(_prx->ice_getEndpointSelection()); + return static_cast(_prx->ice_getEndpointSelection()); } --(instancetype) ice_endpointSelection:(uint8_t)type error:(NSError**)error +-(instancetype) ice_endpointSelection:(std::uint8_t)type error:(NSError**)error { try { @@ -223,7 +223,7 @@ -(instancetype) ice_endpointSelection:(uint8_t)type error:(NSError**)error } } --(instancetype) ice_encodingVersion:(uint8_t)major minor:(uint8_t)minor +-(instancetype) ice_encodingVersion:(std::uint8_t)major minor:(std::uint8_t)minor { Ice::EncodingVersion encoding{major, minor}; @@ -231,7 +231,7 @@ -(instancetype) ice_encodingVersion:(uint8_t)major minor:(uint8_t)minor return _prx == prx ? self : [[ICEObjectPrx alloc] initWithCppObjectPrx:prx]; } --(void) ice_getEncodingVersion:(uint8_t*)major minor:(uint8_t*)minor +-(void) ice_getEncodingVersion:(std::uint8_t*)major minor:(std::uint8_t*)minor { Ice::EncodingVersion v = _prx->ice_getEncodingVersion(); *major = v.major; @@ -565,14 +565,14 @@ -(instancetype) ice_collocationOptimized:(bool)collocated +(id) ice_read:(NSData*)data communicator:(ICECommunicator*)communicator - encodingMajor:(uint8_t)major - encodingMinor:(uint8_t)minor + encodingMajor:(std::uint8_t)major + encodingMinor:(std::uint8_t)minor bytesRead:(NSInteger*)bytesRead error:(NSError**)error { - std::pair p; - p.first = static_cast(data.bytes); + std::pair p; + p.first = static_cast(data.bytes); p.second = p.first + data.length; auto comm = [communicator communicator]; @@ -602,8 +602,8 @@ +(id) ice_read:(NSData*)data } -(void) ice_write:(id)os - encodingMajor:(uint8_t)encodingMajor - encodingMinor:(uint8_t)encodingMinor + encodingMajor:(std::uint8_t)encodingMajor + encodingMinor:(std::uint8_t)encodingMinor { // // Marshal a proxy into a stream and return the encoded bytes. @@ -617,14 +617,14 @@ -(void) ice_write:(id)os } -(BOOL) invoke:(NSString* _Nonnull)op - mode:(uint8_t)mode + mode:(std::uint8_t)mode inParams:(NSData*)inParams context:(NSDictionary* _Nullable)context response:(void (^)(bool, void*, long))response error:(NSError**)error { - std::pair params(0, 0); - params.first = static_cast(inParams.bytes); + std::pair params(0, 0); + params.first = static_cast(inParams.bytes); params.second = params.first + inParams.length; try @@ -634,7 +634,7 @@ -(BOOL) invoke:(NSString* _Nonnull)op { fromNSDictionary(context, ctx); } - std::vector outParams; + std::vector outParams; // We use a std::promise and invokeAsync to avoid making an extra copy of the outParam buffer // and to avoid calling PromiseKit wait. PromiseKit issues a warning if wait() is called on the main thread. @@ -642,13 +642,13 @@ -(BOOL) invoke:(NSString* _Nonnull)op std::promise p; _prx->ice_invokeAsync(fromNSString(op), static_cast(mode), params, - [response, &p](bool ok, std::pair outParams) + [response, &p](bool ok, std::pair outParams) { // We need an autorelease pool as the unmarshaling (in the response) can // create autorelease objects, typically when unmarshaling proxies @autoreleasepool { - response(ok, const_cast(outParams.first), + response(ok, const_cast(outParams.first), static_cast(outParams.second - outParams.first)); } p.set_value(); @@ -671,13 +671,13 @@ -(BOOL) invoke:(NSString* _Nonnull)op } -(BOOL) onewayInvoke:(NSString*)op - mode:(uint8_t)mode + mode:(std::uint8_t)mode inParams:(NSData*)inParams context:(NSDictionary*)context error:(NSError**)error { - std::pair params(0, 0); - params.first = static_cast(inParams.bytes); + std::pair params(0, 0); + params.first = static_cast(inParams.bytes); params.second = params.first + inParams.length; try @@ -688,7 +688,7 @@ -(BOOL) onewayInvoke:(NSString*)op fromNSDictionary(context, ctx); } - std::vector ignored; + std::vector ignored; _prx->ice_invoke(fromNSString(op), static_cast(mode), params, ignored, context ? ctx : Ice::noExplicitContext); return YES; @@ -701,15 +701,15 @@ -(BOOL) onewayInvoke:(NSString*)op } -(void) invokeAsync:(NSString* _Nonnull)op - mode:(uint8_t)mode + mode:(std::uint8_t)mode inParams:(NSData*)inParams context:(NSDictionary* _Nullable)context response:(void (^)(bool, void*, long))response exception:(void (^)(NSError*))exception sent:(void (^_Nullable)(bool))sent { - std::pair params(0, 0); - params.first = static_cast(inParams.bytes); + std::pair params(0, 0); + params.first = static_cast(inParams.bytes); params.second = params.first + inParams.length; try @@ -721,7 +721,7 @@ -(void) invokeAsync:(NSString* _Nonnull)op } _prx->ice_invokeAsync(fromNSString(op), static_cast(mode), params, - [response](bool ok, std::pair outParams) + [response](bool ok, std::pair outParams) { // We need an autorelease pool in case the unmarshaling creates auto // release objects, and in case the application attaches a handler to @@ -729,7 +729,7 @@ -(void) invokeAsync:(NSString* _Nonnull)op // executes response) @autoreleasepool { - response(ok, const_cast(outParams.first), + response(ok, const_cast(outParams.first), static_cast(outParams.second - outParams.first)); } },