From d5ebf62bed594d1fe6ab616a6bbcbcf0a5892d47 Mon Sep 17 00:00:00 2001 From: weidai Date: Tue, 12 Jul 2005 04:23:32 +0000 Subject: port to MSVC .NET 2005 beta 2 git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@198 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- mqueue.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'mqueue.h') diff --git a/mqueue.h b/mqueue.h index 1bf8892..390b44c 100644 --- a/mqueue.h +++ b/mqueue.h @@ -15,7 +15,7 @@ public: void IsolatedInitialize(const NameValuePairs ¶meters) {m_queue.IsolatedInitialize(parameters); m_lengths.assign(1, 0U); m_messageCounts.assign(1, 0U);} - unsigned int Put2(const byte *begin, unsigned int length, int messageEnd, bool blocking) + size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking) { m_queue.Put(begin, length); m_lengths.back() += length; @@ -30,34 +30,35 @@ public: bool IsolatedMessageSeriesEnd(bool blocking) {m_messageCounts.push_back(0); return false;} - unsigned long MaxRetrievable() const + lword MaxRetrievable() const {return m_lengths.front();} bool AnyRetrievable() const {return m_lengths.front() > 0;} - unsigned int TransferTo2(BufferedTransformation &target, unsigned long &transferBytes, const std::string &channel=NULL_CHANNEL, bool blocking=true); - unsigned int CopyRangeTo2(BufferedTransformation &target, unsigned long &begin, unsigned long end=ULONG_MAX, const std::string &channel=NULL_CHANNEL, bool blocking=true) const; + size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=NULL_CHANNEL, bool blocking=true); + size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=NULL_CHANNEL, bool blocking=true) const; - unsigned long TotalBytesRetrievable() const + lword TotalBytesRetrievable() const {return m_queue.MaxRetrievable();} unsigned int NumberOfMessages() const - {return m_lengths.size()-1;} + {return (unsigned int)m_lengths.size()-1;} bool GetNextMessage(); unsigned int NumberOfMessagesInThisSeries() const {return m_messageCounts[0];} unsigned int NumberOfMessageSeries() const - {return m_messageCounts.size()-1;} + {return (unsigned int)m_messageCounts.size()-1;} unsigned int CopyMessagesTo(BufferedTransformation &target, unsigned int count=UINT_MAX, const std::string &channel=NULL_CHANNEL) const; - const byte * Spy(unsigned int &contiguousSize) const; + const byte * Spy(size_t &contiguousSize) const; void swap(MessageQueue &rhs); private: ByteQueue m_queue; - std::deque m_lengths, m_messageCounts; + std::deque m_lengths; + std::deque m_messageCounts; }; @@ -73,7 +74,7 @@ public: , m_firstChannel(firstChannel), m_secondChannel(secondChannel) {Detach(attachment);} - unsigned int ChannelPut2(const std::string &channel, const byte *begin, unsigned int length, int messageEnd, bool blocking); + size_t ChannelPut2(const std::string &channel, const byte *begin, size_t length, int messageEnd, bool blocking); bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true); private: -- cgit v1.2.1