use proper type for argument in QVariant::f_convert function prototype

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-01-26 16:33:01 +02:00
parent 1daf24df45
commit 9ca01593c6
3 changed files with 6 additions and 6 deletions

View file

@ -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;
}

View file

@ -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;

View file

@ -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) {