summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2020-07-15 17:47:10 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2020-07-15 23:16:50 +0200
commitb7ccc80526ee7768d59b8467ef72f93f36819ff4 (patch)
tree3661b0273b985fadbefe6915b76b23f7e54205ea
parenta99bc30e1e07b5307ad34b2114fc2e108df6a1f2 (diff)
Use qsizetype instead of int in QByteArrayMatcher
Change-Id: Id32dc567fa0359ad281d34fcf88c46484f87ce2c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/corelib/text/qbytearraymatcher.cpp7
-rw-r--r--src/corelib/text/qbytearraymatcher.h8
2 files changed, 7 insertions, 8 deletions
diff --git a/src/corelib/text/qbytearraymatcher.cpp b/src/corelib/text/qbytearraymatcher.cpp
index 650b51d48e..4292064de2 100644
--- a/src/corelib/text/qbytearraymatcher.cpp
+++ b/src/corelib/text/qbytearraymatcher.cpp
@@ -128,8 +128,7 @@ QByteArrayMatcher::QByteArrayMatcher()
has the given \a length. \a pattern must remain in scope, but
the destructor does not delete \a pattern.
*/
-QByteArrayMatcher::QByteArrayMatcher(const char *pattern, int length)
- : d(nullptr)
+QByteArrayMatcher::QByteArrayMatcher(const char *pattern, qsizetype length) : d(nullptr)
{
p.p = reinterpret_cast<const uchar *>(pattern);
p.l = length;
@@ -196,7 +195,7 @@ void QByteArrayMatcher::setPattern(const QByteArray &pattern)
setPattern(). Returns the position where the pattern() matched in
\a ba, or -1 if no match was found.
*/
-int QByteArrayMatcher::indexIn(const QByteArray &ba, int from) const
+qsizetype QByteArrayMatcher::indexIn(const QByteArray &ba, qsizetype from) const
{
if (from < 0)
from = 0;
@@ -211,7 +210,7 @@ int QByteArrayMatcher::indexIn(const QByteArray &ba, int from) const
most recent call to setPattern(). Returns the position where the
pattern() matched in \a str, or -1 if no match was found.
*/
-int QByteArrayMatcher::indexIn(const char *str, int len, int from) const
+qsizetype QByteArrayMatcher::indexIn(const char *str, qsizetype len, qsizetype from) const
{
if (from < 0)
from = 0;
diff --git a/src/corelib/text/qbytearraymatcher.h b/src/corelib/text/qbytearraymatcher.h
index c923bd15d5..e847d3a6dc 100644
--- a/src/corelib/text/qbytearraymatcher.h
+++ b/src/corelib/text/qbytearraymatcher.h
@@ -52,7 +52,7 @@ class Q_CORE_EXPORT QByteArrayMatcher
public:
QByteArrayMatcher();
explicit QByteArrayMatcher(const QByteArray &pattern);
- explicit QByteArrayMatcher(const char *pattern, int length);
+ explicit QByteArrayMatcher(const char *pattern, qsizetype length);
QByteArrayMatcher(const QByteArrayMatcher &other);
~QByteArrayMatcher();
@@ -60,8 +60,8 @@ public:
void setPattern(const QByteArray &pattern);
- int indexIn(const QByteArray &ba, int from = 0) const;
- int indexIn(const char *str, int len, int from = 0) const;
+ qsizetype indexIn(const QByteArray &ba, qsizetype from = 0) const;
+ qsizetype indexIn(const char *str, qsizetype len, qsizetype from = 0) const;
inline QByteArray pattern() const
{
if (q_pattern.isNull())
@@ -75,7 +75,7 @@ private:
struct Data {
uchar q_skiptable[256];
const uchar *p;
- int l;
+ qsizetype l;
};
union {
uint dummy[256];