Add -Wzero-as-null-pointer-constant and fix occurences
This commit is contained in:
@@ -11,4 +11,4 @@ QMAKE_CXXFLAGS += --system-header-prefix=third-party
|
|||||||
# Sign conversion warns on auto generated Qt MOC files.
|
# Sign conversion warns on auto generated Qt MOC files.
|
||||||
QMAKE_CXXFLAGS += -Weffc++ -Wconversion -Wno-sign-conversion
|
QMAKE_CXXFLAGS += -Weffc++ -Wconversion -Wno-sign-conversion
|
||||||
|
|
||||||
QMAKE_CXXFLAGS += -Wextra-semi
|
QMAKE_CXXFLAGS += -Wextra-semi -Wzero-as-null-pointer-constant
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ QMAKE_CXXFLAGS += -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wrestric
|
|||||||
# Sign conversion warns on auto generated Qt MOC files.
|
# Sign conversion warns on auto generated Qt MOC files.
|
||||||
QMAKE_CXXFLAGS += -Wconversion -Wno-sign-conversion
|
QMAKE_CXXFLAGS += -Wconversion -Wno-sign-conversion
|
||||||
|
|
||||||
QMAKE_CXXFLAGS += -Wextra-semi
|
QMAKE_CXXFLAGS += -Wextra-semi -Wzero-as-null-pointer-constant
|
||||||
|
|||||||
@@ -594,7 +594,7 @@ void OverlayController::mainEventLoop()
|
|||||||
m_pWindow->mapToGlobal( ptNewMouse ),
|
m_pWindow->mapToGlobal( ptNewMouse ),
|
||||||
Qt::NoButton,
|
Qt::NoButton,
|
||||||
m_lastMouseButtons,
|
m_lastMouseButtons,
|
||||||
0 );
|
nullptr );
|
||||||
m_ptLastMouse = ptNewMouse;
|
m_ptLastMouse = ptNewMouse;
|
||||||
QCoreApplication::sendEvent( m_pWindow.get(), &mouseEvent );
|
QCoreApplication::sendEvent( m_pWindow.get(), &mouseEvent );
|
||||||
OnRenderRequest();
|
OnRenderRequest();
|
||||||
@@ -615,7 +615,7 @@ void OverlayController::mainEventLoop()
|
|||||||
m_pWindow->mapToGlobal( ptNewMouse ),
|
m_pWindow->mapToGlobal( ptNewMouse ),
|
||||||
button,
|
button,
|
||||||
m_lastMouseButtons,
|
m_lastMouseButtons,
|
||||||
0 );
|
nullptr );
|
||||||
QCoreApplication::sendEvent( m_pWindow.get(), &mouseEvent );
|
QCoreApplication::sendEvent( m_pWindow.get(), &mouseEvent );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -633,7 +633,7 @@ void OverlayController::mainEventLoop()
|
|||||||
m_pWindow->mapToGlobal( ptNewMouse ),
|
m_pWindow->mapToGlobal( ptNewMouse ),
|
||||||
button,
|
button,
|
||||||
m_lastMouseButtons,
|
m_lastMouseButtons,
|
||||||
0 );
|
nullptr );
|
||||||
QCoreApplication::sendEvent( m_pWindow.get(), &mouseEvent );
|
QCoreApplication::sendEvent( m_pWindow.get(), &mouseEvent );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -652,7 +652,7 @@ void OverlayController::mainEventLoop()
|
|||||||
0,
|
0,
|
||||||
Qt::Vertical,
|
Qt::Vertical,
|
||||||
m_lastMouseButtons,
|
m_lastMouseButtons,
|
||||||
0 );
|
nullptr );
|
||||||
QCoreApplication::sendEvent( m_pWindow.get(), &wheelEvent );
|
QCoreApplication::sendEvent( m_pWindow.get(), &wheelEvent );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ private:
|
|||||||
bool m_dashboardVisible = false;
|
bool m_dashboardVisible = false;
|
||||||
|
|
||||||
QPoint m_ptLastMouse;
|
QPoint m_ptLastMouse;
|
||||||
Qt::MouseButtons m_lastMouseButtons = 0;
|
Qt::MouseButtons m_lastMouseButtons = nullptr;
|
||||||
|
|
||||||
bool m_desktopMode;
|
bool m_desktopMode;
|
||||||
bool m_noSound;
|
bool m_noSound;
|
||||||
|
|||||||
@@ -370,7 +370,7 @@ IMMDeviceEnumerator* AudioManagerWindows::getAudioDeviceEnumerator()
|
|||||||
{
|
{
|
||||||
IMMDeviceEnumerator* pEnumerator;
|
IMMDeviceEnumerator* pEnumerator;
|
||||||
if ( CoCreateInstance( __uuidof( MMDeviceEnumerator ),
|
if ( CoCreateInstance( __uuidof( MMDeviceEnumerator ),
|
||||||
NULL,
|
nullptr,
|
||||||
CLSCTX_ALL,
|
CLSCTX_ALL,
|
||||||
__uuidof( IMMDeviceEnumerator ),
|
__uuidof( IMMDeviceEnumerator ),
|
||||||
reinterpret_cast<void**>( &pEnumerator ) )
|
reinterpret_cast<void**>( &pEnumerator ) )
|
||||||
@@ -387,14 +387,14 @@ IPolicyConfig* AudioManagerWindows::getPolicyConfig()
|
|||||||
// for Win 10
|
// for Win 10
|
||||||
auto hr
|
auto hr
|
||||||
= CoCreateInstance( __uuidof( CPolicyConfigClient ),
|
= CoCreateInstance( __uuidof( CPolicyConfigClient ),
|
||||||
NULL,
|
nullptr,
|
||||||
CLSCTX_INPROC,
|
CLSCTX_INPROC,
|
||||||
IID_IPolicyConfig2,
|
IID_IPolicyConfig2,
|
||||||
reinterpret_cast<LPVOID*>( &var_policyConfig ) );
|
reinterpret_cast<LPVOID*>( &var_policyConfig ) );
|
||||||
if ( hr != S_OK )
|
if ( hr != S_OK )
|
||||||
{
|
{
|
||||||
hr = CoCreateInstance( __uuidof( CPolicyConfigClient ),
|
hr = CoCreateInstance( __uuidof( CPolicyConfigClient ),
|
||||||
NULL,
|
nullptr,
|
||||||
CLSCTX_INPROC,
|
CLSCTX_INPROC,
|
||||||
IID_IPolicyConfig1,
|
IID_IPolicyConfig1,
|
||||||
reinterpret_cast<LPVOID*>( &var_policyConfig ) );
|
reinterpret_cast<LPVOID*>( &var_policyConfig ) );
|
||||||
@@ -403,7 +403,7 @@ IPolicyConfig* AudioManagerWindows::getPolicyConfig()
|
|||||||
if ( hr != S_OK )
|
if ( hr != S_OK )
|
||||||
{
|
{
|
||||||
hr = CoCreateInstance( __uuidof( CPolicyConfigClient ),
|
hr = CoCreateInstance( __uuidof( CPolicyConfigClient ),
|
||||||
NULL,
|
nullptr,
|
||||||
CLSCTX_INPROC,
|
CLSCTX_INPROC,
|
||||||
IID_IPolicyConfig0,
|
IID_IPolicyConfig0,
|
||||||
reinterpret_cast<LPVOID*>( &var_policyConfig ) );
|
reinterpret_cast<LPVOID*>( &var_policyConfig ) );
|
||||||
@@ -471,7 +471,7 @@ IAudioEndpointVolume*
|
|||||||
IAudioEndpointVolume* pEndpointVolume;
|
IAudioEndpointVolume* pEndpointVolume;
|
||||||
if ( device->Activate( __uuidof( IAudioEndpointVolume ),
|
if ( device->Activate( __uuidof( IAudioEndpointVolume ),
|
||||||
CLSCTX_INPROC_SERVER,
|
CLSCTX_INPROC_SERVER,
|
||||||
NULL,
|
nullptr,
|
||||||
reinterpret_cast<void**>( &pEndpointVolume ) )
|
reinterpret_cast<void**>( &pEndpointVolume ) )
|
||||||
< 0 )
|
< 0 )
|
||||||
{
|
{
|
||||||
@@ -546,7 +546,7 @@ HRESULT AudioManagerWindows::QueryInterface( REFIID riid, void** ppvObject )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*ppvObject = NULL;
|
*ppvObject = nullptr;
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user