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>
This commit is contained in:
Rolland Dudemaine 2015-10-27 02:49:05 +01:00 committed by Thiago Macieira
parent 7cff3e807e
commit dff4120a37

View File

@ -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