From 26331fc17cbe776704d94cee46c605aa41ab78dc Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Thu, 1 Mar 2012 19:30:56 +0800 Subject: [PATCH] assert ==> Q_ASSERT --- src/History.cpp | 5 ++--- src/Screen.cpp | 11 +++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/History.cpp b/src/History.cpp index 093bdf889..9b9e0e07f 100644 --- a/src/History.cpp +++ b/src/History.cpp @@ -23,7 +23,6 @@ // System #include -#include #include #include #include @@ -82,7 +81,7 @@ HistoryFile::~HistoryFile() //to avoid this. void HistoryFile::map() { - assert(_fileMap == 0); + Q_ASSERT(_fileMap == 0); _fileMap = (char*)mmap(0 , _length , PROT_READ , MAP_PRIVATE , _fd , 0); @@ -97,7 +96,7 @@ void HistoryFile::map() void HistoryFile::unmap() { int result = munmap(_fileMap , _length); - assert(result == 0); Q_UNUSED(result); + Q_ASSERT(result == 0); Q_UNUSED(result); _fileMap = 0; } diff --git a/src/Screen.cpp b/src/Screen.cpp index 4474861e2..60539e40a 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -1157,7 +1156,7 @@ int Screen::copyLineToStream(int line , static const int MAX_CHARS = 1024; static Character characterBuffer[MAX_CHARS]; - assert(count < MAX_CHARS); + Q_ASSERT(count < MAX_CHARS); LineProperty currentLineProperties = 0; @@ -1178,9 +1177,9 @@ int Screen::copyLineToStream(int line , } // safety checks - assert(start >= 0); - assert(count >= 0); - assert((start + count) <= history->getLineLen(line)); + Q_ASSERT(start >= 0); + Q_ASSERT(count >= 0); + Q_ASSERT((start + count) <= history->getLineLen(line)); history->getCells(line, start, count, characterBuffer); @@ -1190,7 +1189,7 @@ int Screen::copyLineToStream(int line , if (count == -1) count = columns - start; - assert(count >= 0); + Q_ASSERT(count >= 0); const int screenLine = line - history->getLines();