summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-07-20 22:33:23 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-04 11:17:28 +0000
commit0102ab6cd3e464ca4267777a754811db01edcd2f (patch)
tree210e5c20506efd6df9994cb8fe8847d1ff1bf849
parent4c08f71a11d35bcf263967f95797022ba944f9a4 (diff)
Statically assert that the __mips_dsp code is only active on 32-bit
I was told this is 32-bit-only code in Qt 5, where it didn't really matter, because only QStringView could handle > INT_MAX character strings. Put up a big stop sign now in Qt 6 to enforce that this information is correct, incl. notes for when it turns out it isn't. Task-number: QTBUG-59150 Task-number: QTBUG-103531 Change-Id: I4620a43e2e67776cc67531fa993a7bb8e01cffed Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 753079b7074b06d237a0ae7a58281c28df134fc0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/corelib/text/qstring.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 4ae5eb1060..fc6489bcee 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -816,6 +816,8 @@ Q_CORE_EXPORT void qt_from_latin1(char16_t *dst, const char *str, size_t size) n
# endif
#endif
#if defined(__mips_dsp)
+ static_assert(sizeof(qsizetype) == sizeof(int),
+ "oops, the assembler implementation needs to be called in a loop");
if (size > 20)
qt_fromlatin1_mips_asm_unroll8(dst, str, size);
else
@@ -971,6 +973,8 @@ static void qt_to_latin1_internal(uchar *dst, const char16_t *src, qsizetype len
}
#endif
#if defined(__mips_dsp)
+ static_assert(sizeof(qsizetype) == sizeof(int),
+ "oops, the assembler implementation needs to be called in a loop");
qt_toLatin1_mips_dsp_asm(dst, src, length);
#else
while (length--) {