summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2020-05-10 20:51:34 +0200
committerMarc Mutz <marc.mutz@kdab.com>2020-05-11 11:01:13 +0200
commit9e56d28663b7df82882d2d0dcc72f3a48bcc6cf9 (patch)
tree9a4eafd590c4e4a28ce2602a01da46c16b820bbb /src
parent8a0f100e97a3d6078b3035d4f516e60e605cb9e6 (diff)
QRegularExpression: cast to PCRE2_SPTR16
It seems that PCRE2_UCHAR16 is exactly ushort, even though it's documented to be uint16_t. There's no requirement for these to be the same type, nor for the PCRE typedef to continue to point to the same type, so add explicit casts. Change-Id: I89f65d29feaada84ea00688976a123364857bc58 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/text/qregularexpression.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp
index 9d21da4277..f479425bed 100644
--- a/src/corelib/text/qregularexpression.cpp
+++ b/src/corelib/text/qregularexpression.cpp
@@ -898,7 +898,7 @@ void QRegularExpressionPrivate::compilePattern()
options |= PCRE2_UTF;
PCRE2_SIZE patternErrorOffset;
- compiledPattern = pcre2_compile_16(pattern.utf16(),
+ compiledPattern = pcre2_compile_16(reinterpret_cast<PCRE2_SPTR16>(pattern.utf16()),
pattern.length(),
options,
&errorCode,
@@ -1163,12 +1163,12 @@ QRegularExpressionMatchPrivate *QRegularExpressionPrivate::doMatch(const QString
if (!previousMatchWasEmpty) {
result = safe_pcre2_match_16(compiledPattern,
- subjectUtf16, subjectLength,
+ reinterpret_cast<PCRE2_SPTR16>(subjectUtf16), subjectLength,
offset, pcreOptions,
matchData, matchContext);
} else {
result = safe_pcre2_match_16(compiledPattern,
- subjectUtf16, subjectLength,
+ reinterpret_cast<PCRE2_SPTR16>(subjectUtf16), subjectLength,
offset, pcreOptions | PCRE2_NOTEMPTY_ATSTART | PCRE2_ANCHORED,
matchData, matchContext);
@@ -1186,7 +1186,7 @@ QRegularExpressionMatchPrivate *QRegularExpressionPrivate::doMatch(const QString
}
result = safe_pcre2_match_16(compiledPattern,
- subjectUtf16, subjectLength,
+ reinterpret_cast<PCRE2_SPTR16>(subjectUtf16), subjectLength,
offset, pcreOptions,
matchData, matchContext);
}