From 156d1590b405d1d374b5b8c87f5388718462c5e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 18 Aug 2010 19:27:32 +0200 Subject: 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 --- src/corelib/tools/qstring.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(q_check_ptr(qRealloc(d, sizeof(Data) + alloc * sizeof(QChar)))); + Data *p = static_cast(qRealloc(d, sizeof(Data) + alloc * sizeof(QChar))); + Q_CHECK_PTR(p); + d = p; d->alloc = alloc; d->data = d->array; } -- cgit v0.12