diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-08-11 09:43:46 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-08-11 20:44:16 +0200 |
commit | 50d1a8a3770df7ada3ef558db449c758444234bf (patch) | |
tree | 5b74e5b7b4f6cbc3b0586b61443ad1dd73a82b0b /src/corelib | |
parent | ea1e005cb18cbd4fe9ceda725aac47bbfb068389 (diff) |
QUnicodeTools: fix types used around th_brk()
Libthai's th_brk() takes the breakpoints array lengths as size_t, so
use that.
This still doesn't fix thaiAssignAttributes() for ≥ 2 Gi characters,
because th_brk returns break positions in an array of int, thus
limiting any results to the first INT_MAX characters. Created
QTBUG-105541 to track this.
Task-number: QTBUG-103531
Pick-to: 6.4 6.3 6.2
Change-Id: Iba468cc9389f4533401bc18dd326c4ca7e85a5da
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/text/qunicodetools.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qunicodetools.cpp b/src/corelib/text/qunicodetools.cpp index 0d9935b142..a2a080d4ae 100644 --- a/src/corelib/text/qunicodetools.cpp +++ b/src/corelib/text/qunicodetools.cpp @@ -1444,7 +1444,7 @@ static void thaiAssignAttributes(const char16_t *string, qsizetype len, QCharAtt char *cstr = s; int *break_positions = nullptr; int brp[128]; - int brp_size = 0; + size_t brp_size = 0; qsizetype numbreaks, i; struct thcell_t tis_cell; @@ -1466,7 +1466,7 @@ static void thaiAssignAttributes(const char16_t *string, qsizetype len, QCharAtt if (len > 128) { break_positions = static_cast<int *>(malloc (sizeof(int) * len)); memset (break_positions, 0, sizeof(int) * len); - brp_size = len; + brp_size = size_t(len); } else { break_positions = brp; |