summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qbuffer.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-08-17 13:19:10 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-08-20 21:22:29 +0200
commit817e47fbcde21ab54d353efd647685159cb437a9 (patch)
tree4e3817fad2ad89650bb60bca4957d28fe0232ca4 /src/corelib/io/qbuffer.h
parent3be99799a675a631c67e05897383af9abbc377b3 (diff)
QBuffer: fix the setData() API re: int/qsizetype
The setData(ptr, n) overload was still taking the size as int. Widen it. Task-number: QTBUG-103525 Change-Id: If1d6d6404d62bbae5e0defea9a2115648c1fd5da Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/io/qbuffer.h')
-rw-r--r--src/corelib/io/qbuffer.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/io/qbuffer.h b/src/corelib/io/qbuffer.h
index 96144b63a84..a7c6bde562a 100644
--- a/src/corelib/io/qbuffer.h
+++ b/src/corelib/io/qbuffer.h
@@ -33,7 +33,11 @@ public:
void setBuffer(QByteArray *a);
void setData(const QByteArray &data);
- inline void setData(const char *data, int len);
+#if QT_CORE_REMOVED_SINCE(6, 5) && QT_POINTER_SIZE != 4
+ void setData(const char *data, int len) { setData(data, qsizetype(len)); }
+#endif
+ void setData(const char *data, qsizetype len)
+ { setData(QByteArray(data, len)); }
const QByteArray &data() const;
bool open(OpenMode openMode) override;
@@ -60,9 +64,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_emitSignals())
};
-inline void QBuffer::setData(const char *adata, int alen)
-{ setData(QByteArray(adata, alen)); }
-
QT_END_NAMESPACE
#endif // QBUFFER_H