From: Ivailo Monev Date: Tue, 26 Jan 2021 14:33:01 +0000 (+0200) Subject: use proper type for argument in QVariant::f_convert function prototype X-Git-Tag: 4.12.0~2677 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9ca01593c6263170e0c2c103565c25f5f322568c;p=kde%2FKatie.git use proper type for argument in QVariant::f_convert function prototype Signed-off-by: Ivailo Monev --- diff --git a/src/core/kernel/qvariant.cpp b/src/core/kernel/qvariant.cpp index c48aea845..76a87b6b3 100644 --- a/src/core/kernel/qvariant.cpp +++ b/src/core/kernel/qvariant.cpp @@ -656,16 +656,16 @@ static qulonglong qConvertToUnsignedNumber(const QVariant::Private *d, bool *ok) Converts \a d to type \a t, which is placed in \a result. */ -static bool convert(const QVariant::Private *d, QVariant::Type t, void *result, bool *ok) +static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) { - Q_ASSERT(d->type != int(t)); + Q_ASSERT(d->type != t); Q_ASSERT(result); bool dummy; if (!ok) ok = &dummy; - switch (int(t)) { + switch (t) { #ifndef QT_BOOTSTRAPPED case QVariant::Url: switch (d->type) { @@ -2513,7 +2513,7 @@ inline T qNumVariantToHelper(const QVariant::Private &d, return val; T ret; - if (!handler->convert(&d, QVariant::Type(t), &ret, ok) && ok) + if (!handler->convert(&d, t, &ret, ok) && ok) *ok = false; return ret; } diff --git a/src/core/kernel/qvariant.h b/src/core/kernel/qvariant.h index 6c38ab035..49bfc759d 100644 --- a/src/core/kernel/qvariant.h +++ b/src/core/kernel/qvariant.h @@ -345,7 +345,7 @@ class Q_CORE_EXPORT QVariant typedef void (*f_save)(const Private *, QDataStream &); #endif typedef bool (*f_compare)(const Private *, const Private *); - typedef bool (*f_convert)(const QVariant::Private *d, Type t, void *, bool *); + typedef bool (*f_convert)(const QVariant::Private *d, int t, void *, bool *); typedef void (*f_debugStream)(QDebug, const QVariant &); struct Handler { f_construct construct; diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 1160dc0d5..9f4a8c37f 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -386,7 +386,7 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b) return qcoreVariantHandler()->compare(a, b); } -static bool convert(const QVariant::Private *d, QVariant::Type t, +static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) { switch (t) {