diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2010-08-18 17:27:32 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2010-08-19 10:58:27 (GMT) |
commit | 156d1590b405d1d374b5b8c87f5388718462c5e1 (patch) | |
tree | ab0b8dbfa297ebdd67b0d93bfa9e9b8fa66302e7 | |
parent | 9a7a7ab681307067661fccad418f4b13535a24f2 (diff) | |
download | Qt-156d1590b405d1d374b5b8c87f5388718462c5e1.zip Qt-156d1590b405d1d374b5b8c87f5388718462c5e1.tar.gz Qt-156d1590b405d1d374b5b8c87f5388718462c5e1.tar.bz2 |
Prefer Q_CHECK_PTR to q_check_ptr
With the macro version we get proper debug output (with __FILE__,
__LINE__ annotations) when compiling with -no-exceptions and
!QT_NO_DEBUG.
Reviewed-by: Olivier Goffart
-rw-r--r-- | src/corelib/tools/qstring.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 7bc9ca1..7ea9877 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1298,7 +1298,9 @@ void QString::realloc(int alloc) asciiCache->remove(d); } #endif - d = static_cast<Data *>(q_check_ptr(qRealloc(d, sizeof(Data) + alloc * sizeof(QChar)))); + Data *p = static_cast<Data *>(qRealloc(d, sizeof(Data) + alloc * sizeof(QChar))); + Q_CHECK_PTR(p); + d = p; d->alloc = alloc; d->data = d->array; } |