diff options
Diffstat (limited to 'src/modules/dcc')
| -rw-r--r-- | src/modules/dcc/chat.cpp | 12 | ||||
| -rw-r--r-- | src/modules/dcc/libkvidcc.cpp | 4 | ||||
| -rw-r--r-- | src/modules/dcc/thread.cpp | 6 | ||||
| -rw-r--r-- | src/modules/dcc/video.cpp | 8 |
4 files changed, 13 insertions, 17 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; } diff --git a/src/modules/dcc/libkvidcc.cpp b/src/modules/dcc/libkvidcc.cpp index 5f252728c..9520c48dc 100644 --- a/src/modules/dcc/libkvidcc.cpp +++ b/src/modules/dcc/libkvidcc.cpp @@ -94,7 +94,7 @@ static bool dcc_kvs_parse_default_parameters(KviDccDescriptor * d,KviKvsModuleCo } else d->setConsole(c->window()->frame()->firstConsole()); } - __range_valid(d->console()); + KVI_ASSERT(d->console()); if(!d->console()->isConnected()) { @@ -1284,7 +1284,7 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) else d->console() = c->window()->frame()->firstConsole(); } - __range_valid(d->console()); + KVI_ASSERT(d->console()); if(!d->console()->isConnected()) { diff --git a/src/modules/dcc/thread.cpp b/src/modules/dcc/thread.cpp index bee9d374c..d89f8422e 100644 --- a/src/modules/dcc/thread.cpp +++ b/src/modules/dcc/thread.cpp @@ -22,8 +22,6 @@ // //============================================================================= -#define _KVI_DEBUG_CHECK_RANGE_ - #include "thread.h" #include "kvi_debug.h" @@ -57,7 +55,7 @@ KviDccThread::~KviDccThread() m_pSSL = 0; #endif if(m_fd != KVI_INVALID_SOCKET)kvi_socket_close(m_fd); - __range_invalid(m_pMutex->locked()); + KVI_ASSERT(!m_pMutex->locked()); delete m_pMutex; } @@ -71,7 +69,7 @@ void KviDccThread::setSSL(KviSSL * s) bool KviDccThread::handleInvalidSocketRead(int readLen) { - __range_valid(readLen < 1); + KVI_ASSERT(readLen < 1); if(readLen == 0) { // connection closed diff --git a/src/modules/dcc/video.cpp b/src/modules/dcc/video.cpp index e2232ee18..7d6bd6833 100644 --- a/src/modules/dcc/video.cpp +++ b/src/modules/dcc/video.cpp @@ -241,8 +241,8 @@ bool KviDccVideoThread::textStep() bool KviDccVideoThread::handleIncomingData(KviDccThreadIncomingData * data,bool bCritical) { // qDebug("KviDccVideoThread::handleIncomingData"); - __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) @@ -262,7 +262,7 @@ bool KviDccVideoThread::handleIncomingData(KviDccThreadIncomingData * data,bool // 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 @@ -273,7 +273,7 @@ bool KviDccVideoThread::handleIncomingData(KviDccThreadIncomingData * data,bool 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; } |
