Add Q_DECL_CONST_FUNCTION and Q_DECL_NOTHROW to qPopulationCount
Change-Id: I7602936b7064d6a87cd9fbfc4ab22a8fc881b9e9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
983fc2aa4a
commit
1355ac5b05
@ -526,7 +526,7 @@ QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE RandomAccessItera
|
|||||||
#define QALGORITHMS_USE_BUILTIN_POPCOUNT
|
#define QALGORITHMS_USE_BUILTIN_POPCOUNT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Q_DECL_CONSTEXPR inline uint qPopulationCount(quint32 v)
|
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint32 v) Q_DECL_NOTHROW
|
||||||
{
|
{
|
||||||
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
|
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
|
||||||
return __builtin_popcount(v);
|
return __builtin_popcount(v);
|
||||||
@ -539,7 +539,7 @@ Q_DECL_CONSTEXPR inline uint qPopulationCount(quint32 v)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_DECL_CONSTEXPR inline uint qPopulationCount(quint8 v)
|
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint8 v) Q_DECL_NOTHROW
|
||||||
{
|
{
|
||||||
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
|
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
|
||||||
return __builtin_popcount(v);
|
return __builtin_popcount(v);
|
||||||
@ -549,7 +549,7 @@ Q_DECL_CONSTEXPR inline uint qPopulationCount(quint8 v)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_DECL_CONSTEXPR inline uint qPopulationCount(quint16 v)
|
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint16 v) Q_DECL_NOTHROW
|
||||||
{
|
{
|
||||||
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
|
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
|
||||||
return __builtin_popcount(v);
|
return __builtin_popcount(v);
|
||||||
@ -560,7 +560,7 @@ Q_DECL_CONSTEXPR inline uint qPopulationCount(quint16 v)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_DECL_CONSTEXPR inline uint qPopulationCount(quint64 v)
|
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint64 v) Q_DECL_NOTHROW
|
||||||
{
|
{
|
||||||
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
|
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
|
||||||
return __builtin_popcountll(v);
|
return __builtin_popcountll(v);
|
||||||
@ -575,7 +575,7 @@ Q_DECL_CONSTEXPR inline uint qPopulationCount(quint64 v)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_DECL_CONSTEXPR inline uint qPopulationCount(long unsigned int v)
|
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(long unsigned int v) Q_DECL_NOTHROW
|
||||||
{
|
{
|
||||||
return qPopulationCount(static_cast<quint64>(v));
|
return qPopulationCount(static_cast<quint64>(v));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user