diff options
| author | 2010-07-14 13:31:37 +0000 | |
|---|---|---|
| committer | 2010-07-14 13:31:37 +0000 | |
| commit | 484d98ded2038f4dd262d546b4e0fe460d907bd4 (patch) | |
| tree | 4e9541dab6a937b8f580912e8c7d6decce42ef68 /src/modules/dcc/chat.cpp | |
| parent | updated some mediaplayer homepage urls and some other typos, thanks xoffice (diff) | |
| download | KVIrc-484d98ded2038f4dd262d546b4e0fe460d907bd4.tar.gz KVIrc-484d98ded2038f4dd262d546b4e0fe460d907bd4.tar.bz2 KVIrc-484d98ded2038f4dd262d546b4e0fe460d907bd4.zip | |
Rewrite parts of the regchan module in order to
avoid the heavy usage of pointers.
Add some new nice debug macros and tools.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4669 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/dcc/chat.cpp')
| -rw-r--r-- | src/modules/dcc/chat.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/modules/dcc/chat.cpp b/src/modules/dcc/chat.cpp index 02e897a04..1ed7cd0d8 100644 --- a/src/modules/dcc/chat.cpp +++ b/src/modules/dcc/chat.cpp @@ -31,8 +31,6 @@ #include "dialogs.h" #endif -#define _KVI_DEBUG_CHECK_RANGE_ - #include "kvi_debug.h" #include "kvi_options.h" #include "kvi_input.h" @@ -684,7 +682,7 @@ void KviDccChatThread::run() if(!handleInvalidSocketRead(readLen)) { if(data.iLen)handleIncomingData(&data,true); // critical - __range_invalid(data.iLen); + KVI_ASSERT(!data.iLen); break; // error } } @@ -712,8 +710,8 @@ out_of_the_loop: bool KviDccChatThread::handleIncomingData(KviDccThreadIncomingData * data,bool bCritical) { - __range_valid(data->iLen); - __range_valid(data->buffer); + KVI_ASSERT(data->iLen); + KVI_ASSERT(data->buffer); char * aux = data->buffer; char * end = data->buffer + data->iLen; while(aux != end) @@ -733,7 +731,7 @@ bool KviDccChatThread::handleIncomingData(KviDccThreadIncomingData * data,bool b // so len += 1; --> new data->iLen -= len; data->iLen -= (len + 1); // debug("iLen now = %d",data->iLen); - __range_valid(data->iLen >= 0); + KVI_ASSERT(data->iLen >= 0); if(data->iLen > 0) { // memmove the remaining part to the beginning @@ -744,7 +742,7 @@ bool KviDccChatThread::handleIncomingData(KviDccThreadIncomingData * data,bool b aux = data->buffer; } else { // no more data in the buffer - __range_valid(data->iLen == 0); + KVI_ASSERT(data->iLen == 0); kvi_free(data->buffer); data->buffer = end = aux = 0; } |
