- improved Buffer exceptions
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@1038 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -98,6 +98,9 @@ typename Buffer<T>::Result Buffer<T>::write(const T *pData, size_t len)
|
||||
{
|
||||
if (len > free())
|
||||
{
|
||||
printf("len : %u\n", len);
|
||||
printf("free : %u\n", free());
|
||||
printf("capa : %u\n", capacity());
|
||||
RETURN_OR_EXCEPT(Result::Err_InvalidSize);
|
||||
}
|
||||
|
||||
@@ -140,7 +143,7 @@ T Buffer<T>::readAt(size_t offset)
|
||||
{
|
||||
if (m_len < (1+offset))
|
||||
{
|
||||
throw Buffer::Exception(Result::Err_InvalidSize);
|
||||
RETURN_OR_EXCEPT(Result::Err_InvalidSize);
|
||||
}
|
||||
size_t i = (m_ri + offset) % m_capacity;
|
||||
T result = bufferActive()[i];
|
||||
|
||||
Reference in New Issue
Block a user