fixed warnings in bytebuffer.cpp
This commit is contained in:
parent
e41dec458c
commit
c83dfdb66e
@ -773,7 +773,7 @@ void cByteBuffer::ReadAll(AString & a_Data)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool cByteBuffer::ReadToByteBuffer(cByteBuffer & a_Dst, int a_NumBytes)
|
bool cByteBuffer::ReadToByteBuffer(cByteBuffer & a_Dst, size_t a_NumBytes)
|
||||||
{
|
{
|
||||||
if (!a_Dst.CanWriteBytes(a_NumBytes) || !CanReadBytes(a_NumBytes))
|
if (!a_Dst.CanWriteBytes(a_NumBytes) || !CanReadBytes(a_NumBytes))
|
||||||
{
|
{
|
||||||
@ -781,9 +781,9 @@ bool cByteBuffer::ReadToByteBuffer(cByteBuffer & a_Dst, int a_NumBytes)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
while (a_NumBytes > 0)
|
while (a_NumBytes > static_cast<size_t>(0))
|
||||||
{
|
{
|
||||||
int num = (a_NumBytes > sizeof(buf)) ? sizeof(buf) : a_NumBytes;
|
size_t num = (a_NumBytes > sizeof(buf)) ? sizeof(buf) : a_NumBytes;
|
||||||
VERIFY(ReadBuf(buf, num));
|
VERIFY(ReadBuf(buf, num));
|
||||||
VERIFY(a_Dst.Write(buf, num));
|
VERIFY(a_Dst.Write(buf, num));
|
||||||
a_NumBytes -= num;
|
a_NumBytes -= num;
|
||||||
|
@ -110,7 +110,7 @@ public:
|
|||||||
void ReadAll(AString & a_Data);
|
void ReadAll(AString & a_Data);
|
||||||
|
|
||||||
/// Reads the specified number of bytes and writes it into the destinatio bytebuffer. Returns true on success.
|
/// Reads the specified number of bytes and writes it into the destinatio bytebuffer. Returns true on success.
|
||||||
bool ReadToByteBuffer(cByteBuffer & a_Dst, int a_NumBytes);
|
bool ReadToByteBuffer(cByteBuffer & a_Dst, size_t a_NumBytes);
|
||||||
|
|
||||||
/// Removes the bytes that have been read from the ringbuffer
|
/// Removes the bytes that have been read from the ringbuffer
|
||||||
void CommitRead(void);
|
void CommitRead(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user