Skip to content

Commit

Permalink
reuse float/double member of QVariant for qreal [ci reset]
Browse files Browse the repository at this point in the history
Signed-off-by: Ivailo Monev <[email protected]>
  • Loading branch information
fluxer committed Aug 10, 2021
1 parent b4bee2b commit 9a1a182
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/core/kernel/qvariant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2451,7 +2451,11 @@ float QVariant::toFloat(bool *ok) const
*/
qreal QVariant::toReal(bool *ok) const
{
return qNumVariantToHelper<qreal>(d, handler, ok, d.data.real);
#if defined(QT_NO_FPU)
return qNumVariantToHelper<qreal>(d, handler, ok, d.data.f);
#else
return qNumVariantToHelper<qreal>(d, handler, ok, d.data.d);
#endif
}

/*!
Expand Down
1 change: 0 additions & 1 deletion src/core/kernel/qvariant.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ class Q_CORE_EXPORT QVariant
bool b;
double d;
float f;
qreal real;
qlonglong ll;
qulonglong ull;
QObject *o;
Expand Down

0 comments on commit 9a1a182

Please sign in to comment.