summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorRolland Dudemaine <rolland@ghs.com>2015-10-27 02:49:05 +0100
committerThiago Macieira <thiago.macieira@intel.com>2015-12-04 00:28:10 +0000
commitdff4120a378bab8269de41844f1510bbe6fd373e (patch)
treecb7678bb3edd79823cd995aaa5751733b5308d07 /src/corelib/tools
parent7cff3e807ead31e4955e1379e20a5e576cf0ae69 (diff)
Add an else clause that clears the return value.
This avoids several warnings with the GHS toolchain, in the form: warning #111-D: statement is unreachable This is because the sizeof() equality test is statically determined, but the following code is not discarded automatically. It is when using an explicit else clause. Change-Id: Ic0584aafc72f70badcf5285ab635f9d99eac161a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qstring.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index ba07259e77..5894b869da 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -958,8 +958,9 @@ inline int QString::toWCharArray(wchar_t *array) const
if (sizeof(wchar_t) == sizeof(QChar)) {
memcpy(array, d->data(), sizeof(QChar) * size());
return size();
+ } else {
+ return toUcs4_helper(d->data(), size(), reinterpret_cast<uint *>(array));
}
- return toUcs4_helper(d->data(), size(), reinterpret_cast<uint *>(array));
}
QT_WARNING_POP