diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-07-20 22:33:23 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-08-04 01:35:36 +0000 |
commit | 753079b7074b06d237a0ae7a58281c28df134fc0 (patch) | |
tree | c3db8c0d700ec951f7fb00e1e461d575224670ca /src/corelib | |
parent | 3698186f9d5a0a223b400ca5bbed9a62acf825bc (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.
Pick-to: 6.4 6.3 6.2 5.15
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>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/text/qstring.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index f52f7317b9..9a8620cc1c 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--) { |