mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
replace q_static_assert() with Q_ASSERT()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
58ae4ed531
commit
451ad1f204
2 changed files with 4 additions and 18 deletions
|
@ -104,16 +104,10 @@ static inline int prepareNewValueWithSerialNumber(int oldId, int newId)
|
|||
return (newId & TimerIdMask) | ((oldId + TimerSerialCounter) & TimerSerialMask);
|
||||
}
|
||||
|
||||
namespace {
|
||||
template<bool> struct QStaticAssertType;
|
||||
template<> struct QStaticAssertType<true> { enum { Value = 1 }; };
|
||||
}
|
||||
#define q_static_assert(expr) (void)QStaticAssertType<expr>::Value
|
||||
|
||||
static inline int bucketOffset(int timerId)
|
||||
{
|
||||
q_static_assert(sizeof BucketSize == sizeof BucketOffset);
|
||||
q_static_assert(sizeof(timerIds) / sizeof(timerIds[0]) == NumberOfBuckets);
|
||||
Q_ASSERT(sizeof(BucketSize) == sizeof(BucketOffset));
|
||||
Q_ASSERT(sizeof(timerIds) / sizeof(timerIds[0]) == NumberOfBuckets);
|
||||
|
||||
for (int i = 0; i < NumberOfBuckets; ++i) {
|
||||
if (timerId < BucketSize[i])
|
||||
|
|
|
@ -337,18 +337,10 @@ QList<QNetworkProxy> QGlobalNetworkProxy::proxyForQuery(const QNetworkProxyQuery
|
|||
|
||||
Q_GLOBAL_STATIC(QGlobalNetworkProxy, globalNetworkProxy)
|
||||
|
||||
namespace {
|
||||
template<bool> struct StaticAssertTest;
|
||||
template<> struct StaticAssertTest<true> { enum { Value = 1 }; };
|
||||
}
|
||||
|
||||
static inline void qt_noop_with_arg(int) {}
|
||||
#define q_static_assert(expr) qt_noop_with_arg(sizeof(StaticAssertTest< expr >::Value))
|
||||
|
||||
static QNetworkProxy::Capabilities defaultCapabilitiesForType(QNetworkProxy::ProxyType type)
|
||||
{
|
||||
q_static_assert(int(QNetworkProxy::DefaultProxy) == 0);
|
||||
q_static_assert(int(QNetworkProxy::FtpCachingProxy) == 5);
|
||||
Q_ASSERT(int(QNetworkProxy::DefaultProxy) == 0);
|
||||
Q_ASSERT(int(QNetworkProxy::FtpCachingProxy) == 5);
|
||||
static const int defaults[] =
|
||||
{
|
||||
/* [QNetworkProxy::DefaultProxy] = */
|
||||
|
|
Loading…
Add table
Reference in a new issue