Fix cast-function-type gcc 8 warning
Gcc 8 now warns against casting functions taking references to functions taking pointers: warning: cast between incompatible function types from ‘QVariant (*)(const int&, const int&, double)’ to ‘QVariant (*)(const void*, const void*, double)’ [-Werror=cast-function-type] Suppressed by casting over void(*)(). Change-Id: I48bee53253b8e87110e8a49efa761fc2add89c5a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
bfc96c9c0e
commit
0ffc39806e
@ -448,7 +448,7 @@ void QVariantAnimation::registerInterpolator(QVariantAnimation::Interpolator fun
|
|||||||
|
|
||||||
template<typename T> static inline QVariantAnimation::Interpolator castToInterpolator(QVariant (*func)(const T &from, const T &to, qreal progress))
|
template<typename T> static inline QVariantAnimation::Interpolator castToInterpolator(QVariant (*func)(const T &from, const T &to, qreal progress))
|
||||||
{
|
{
|
||||||
return reinterpret_cast<QVariantAnimation::Interpolator>(func);
|
return reinterpret_cast<QVariantAnimation::Interpolator>(reinterpret_cast<void(*)()>(func));
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantAnimation::Interpolator QVariantAnimationPrivate::getInterpolator(int interpolationType)
|
QVariantAnimation::Interpolator QVariantAnimationPrivate::getInterpolator(int interpolationType)
|
||||||
|
@ -113,7 +113,7 @@ private:
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void qRegisterAnimationInterpolator(QVariant (*func)(const T &from, const T &to, qreal progress)) {
|
void qRegisterAnimationInterpolator(QVariant (*func)(const T &from, const T &to, qreal progress)) {
|
||||||
QVariantAnimation::registerInterpolator(reinterpret_cast<QVariantAnimation::Interpolator>(func), qMetaTypeId<T>());
|
QVariantAnimation::registerInterpolator(reinterpret_cast<QVariantAnimation::Interpolator>(reinterpret_cast<void(*)()>(func)), qMetaTypeId<T>());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //QT_NO_ANIMATION
|
#endif //QT_NO_ANIMATION
|
||||||
|
Loading…
x
Reference in New Issue
Block a user