diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2023-03-08 22:01:15 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-03-12 21:34:43 +0200 |
commit | 6e2963200642fa0171b247cb986726ca124795b0 (patch) | |
tree | d69495046655c04c10ae751428fc1a9707d2785b /src/corelib/text | |
parent | 30de1f74def7008b55a8a6d88a6b0f935bc6e2f8 (diff) |
QString: fix a couple of integral narrowing warnings
Change-Id: Ibc193665c4fe5458a4ba84a3993dcd67a6180048
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text')
-rw-r--r-- | src/corelib/text/qstring.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 2d387d1e05..4b7535505a 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -1200,7 +1200,7 @@ void qt_to_latin1_unchecked(uchar *dst, const char16_t *src, qsizetype length) Q_NEVER_INLINE static int ucstricmp(qsizetype alen, const char16_t *a, qsizetype blen, const char16_t *b) { if (a == b) - return (alen - blen); + return qt_lencmp(alen, blen); char32_t alast = 0; char32_t blast = 0; @@ -6434,7 +6434,7 @@ int QString::compare_helper(const QChar *data1, qsizetype length1, const char *d Q_ASSERT(length1 >= 0); Q_ASSERT(data1 || length1 == 0); if (!data2) - return length1; + return qt_lencmp(length1, 0); if (Q_UNLIKELY(length2 < 0)) length2 = qsizetype(strlen(data2)); return QtPrivate::compareStrings(QStringView(data1, length1), @@ -7212,7 +7212,7 @@ QString QString::vasprintf(const char *cformat, va_list ap) } default: { int *n = va_arg(ap, int*); - *n = result.size(); + *n = int(result.size()); break; } } |