fixed warnings shown in QtCreator

This commit is contained in:
Volker Fischer 2019-05-17 22:55:46 +02:00
parent 6f12d8395a
commit fa0f122638
19 changed files with 60 additions and 63 deletions

View file

@ -47,8 +47,8 @@ class CAnalyzerConsole : public QDialog
public: public:
CAnalyzerConsole ( CClient* pNCliP, CAnalyzerConsole ( CClient* pNCliP,
QWidget* parent = 0, QWidget* parent = nullptr,
Qt::WindowFlags f = 0 ); Qt::WindowFlags f = nullptr );
protected: protected:

View file

@ -95,7 +95,7 @@ class CAudioMixerBoard : public QGroupBox
Q_OBJECT Q_OBJECT
public: public:
CAudioMixerBoard ( QWidget* parent = 0, Qt::WindowFlags f = 0 ); CAudioMixerBoard ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
void HideAll(); void HideAll();
void ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInfo ); void ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInfo );

View file

@ -27,7 +27,7 @@
// CChannel implementation ***************************************************** // CChannel implementation *****************************************************
CChannel::CChannel ( const bool bNIsServer ) : CChannel::CChannel ( const bool bNIsServer ) :
vecdGains ( MAX_NUM_CHANNELS, (double) 1.0 ), vecdGains ( MAX_NUM_CHANNELS, 1.0 ),
bDoAutoSockBufSize ( true ), bDoAutoSockBufSize ( true ),
bIsEnabled ( false ), bIsEnabled ( false ),
bIsServer ( bNIsServer ) bIsServer ( bNIsServer )
@ -355,9 +355,9 @@ void CChannel::OnNetTranspPropsReceived ( CNetworkTransportProps NetworkTranspor
{ {
// store received parameters // store received parameters
eAudioCompressionType = NetworkTransportProps.eAudioCodingType; eAudioCompressionType = NetworkTransportProps.eAudioCodingType;
iNumAudioChannels = NetworkTransportProps.iNumAudioChannels; iNumAudioChannels = static_cast<int> ( NetworkTransportProps.iNumAudioChannels );
iNetwFrameSizeFact = NetworkTransportProps.iBlockSizeFact; iNetwFrameSizeFact = NetworkTransportProps.iBlockSizeFact;
iNetwFrameSize = NetworkTransportProps.iBaseNetworkPacketSize; iNetwFrameSize = static_cast<int> ( NetworkTransportProps.iBaseNetworkPacketSize );
MutexSocketBuf.lock(); MutexSocketBuf.lock();
{ {
@ -388,14 +388,13 @@ CNetworkTransportProps CChannel::GetNetworkTransportPropsFromCurrentSettings()
{ {
// use current stored settings of the channel to fill the network transport // use current stored settings of the channel to fill the network transport
// properties structure // properties structure
return CNetworkTransportProps ( return CNetworkTransportProps ( static_cast<uint32_t> ( iNetwFrameSize ),
iNetwFrameSize, static_cast<uint16_t> ( iNetwFrameSizeFact ),
iNetwFrameSizeFact, static_cast<uint32_t> ( iNumAudioChannels ),
iNumAudioChannels, SYSTEM_SAMPLE_RATE_HZ,
SYSTEM_SAMPLE_RATE_HZ, eAudioCompressionType,
eAudioCompressionType, 0, // version of the codec
0, // version of the codec 0 );
0 );
} }
void CChannel::Disconnect() void CChannel::Disconnect()

View file

@ -39,7 +39,7 @@ class CChatDlg : public QDialog, private Ui_CChatDlgBase
Q_OBJECT Q_OBJECT
public: public:
CChatDlg ( QWidget* parent = 0, Qt::WindowFlags f = 0 ); CChatDlg ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
void AddChatText ( QString strChatText ); void AddChatText ( QString strChatText );

View file

@ -1090,7 +1090,7 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
if ( eAudioCompressionType == CT_OPUS ) if ( eAudioCompressionType == CT_OPUS )
{ {
opus_custom_decode ( OpusDecoderMono, opus_custom_decode ( OpusDecoderMono,
NULL, nullptr,
iCeltNumCodedBytes, iCeltNumCodedBytes,
&vecsAudioSndCrdMono[i * SYSTEM_FRAME_SIZE_SAMPLES], &vecsAudioSndCrdMono[i * SYSTEM_FRAME_SIZE_SAMPLES],
SYSTEM_FRAME_SIZE_SAMPLES ); SYSTEM_FRAME_SIZE_SAMPLES );
@ -1101,7 +1101,7 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
if ( eAudioCompressionType == CT_OPUS ) if ( eAudioCompressionType == CT_OPUS )
{ {
opus_custom_decode ( OpusDecoderStereo, opus_custom_decode ( OpusDecoderStereo,
NULL, nullptr,
iCeltNumCodedBytes, iCeltNumCodedBytes,
&vecsStereoSndCrd[i * 2 * SYSTEM_FRAME_SIZE_SAMPLES], &vecsStereoSndCrd[i * 2 * SYSTEM_FRAME_SIZE_SAMPLES],
SYSTEM_FRAME_SIZE_SAMPLES ); SYSTEM_FRAME_SIZE_SAMPLES );
@ -1158,7 +1158,7 @@ int CClient::EstimatedOverallDelay ( const int iPingTimeMs )
// Consider the jitter buffer on the client and on the server side, too. // Consider the jitter buffer on the client and on the server side, too.
const double dTotalJitterBufferDelayMs = SYSTEM_BLOCK_DURATION_MS_FLOAT * const double dTotalJitterBufferDelayMs = SYSTEM_BLOCK_DURATION_MS_FLOAT *
static_cast<double> ( GetSockBufNumFrames() + static_cast<double> ( GetSockBufNumFrames() +
GetServerSockBufNumFrames() ) * 0.7f; GetServerSockBufNumFrames() ) * 0.7;
// consider delay introduced by the sound card conversion buffer by using // consider delay introduced by the sound card conversion buffer by using
// "GetSndCrdConvBufAdditionalDelayMonoBlSize()" // "GetSndCrdConvBufAdditionalDelayMonoBlSize()"

View file

@ -920,8 +920,8 @@ void CClientDlg::OnTimerSigMet()
} }
// show current level // show current level
lbrInputLevelL->setValue ( (int) ceil ( dCurSigLevelL ) ); lbrInputLevelL->setValue ( static_cast<int> ( ceil ( dCurSigLevelL ) ) );
lbrInputLevelR->setValue ( (int) ceil ( dCurSigLevelR ) ); lbrInputLevelR->setValue ( static_cast<int> ( ceil ( dCurSigLevelR ) ) );
} }
void CClientDlg::OnTimerBuffersLED() void CClientDlg::OnTimerBuffersLED()
@ -1036,9 +1036,7 @@ void CClientDlg::Connect ( const QString& strSelectedAddress,
catch ( CGenErr generr ) catch ( CGenErr generr )
{ {
// show error message and return the function // show error message and return the function
QMessageBox::critical ( QMessageBox::critical ( this, APP_NAME, generr.GetErrorText(), "Close", nullptr );
this, APP_NAME, generr.GetErrorText(), "Close", 0 );
return; return;
} }

View file

@ -455,7 +455,7 @@ QString CClientSettingsDlg::GenSndCrdBufferDelayString ( const int iFrameSiz
{ {
// use two times the buffer delay for the entire delay since // use two times the buffer delay for the entire delay since
// we have input and output // we have input and output
return QString().setNum ( (double) iFrameSize * 2 * return QString().setNum ( static_cast<double> ( iFrameSize ) * 2 *
1000 / SYSTEM_SAMPLE_RATE_HZ, 'f', 2 ) + " ms (" + 1000 / SYSTEM_SAMPLE_RATE_HZ, 'f', 2 ) + " ms (" +
QString().setNum ( iFrameSize ) + strAddText + ")"; QString().setNum ( iFrameSize ) + strAddText + ")";
} }
@ -629,7 +629,7 @@ void CClientSettingsDlg::OnSoundcardActivated ( int iSndDevIdx )
QString ( tr ( "The selected audio device could not be used " QString ( tr ( "The selected audio device could not be used "
"because of the following error: " ) ) + strError + "because of the following error: " ) ) + strError +
QString ( tr ( " The previous driver will be selected." ) ), QString ( tr ( " The previous driver will be selected." ) ),
"Ok", 0 ); "Ok", nullptr );
// recover old selection // recover old selection
cbxSoundcard->setCurrentIndex ( pClient->GetSndCrdDev() ); cbxSoundcard->setCurrentIndex ( pClient->GetSndCrdDev() );

View file

@ -52,8 +52,8 @@ class CClientSettingsDlg : public QDialog, private Ui_CClientSettingsDlgBase
public: public:
CClientSettingsDlg ( CClient* pNCliP, CClientSettingsDlg ( CClient* pNCliP,
QWidget* parent = 0, QWidget* parent = nullptr,
Qt::WindowFlags f = 0 ); Qt::WindowFlags f = nullptr );
void SetStatus ( const CMultiColorLED::ELightColor eStatus ) { ledNetw->SetLight ( eStatus ); } void SetStatus ( const CMultiColorLED::ELightColor eStatus ) { ledNetw->SetLight ( eStatus ); }

View file

@ -440,7 +440,7 @@ void CConnectDlg::OnServerListItemDoubleClicked ( QTreeWidgetItem* Item,
{ {
// if a server list item was double clicked, it is the same as if the // if a server list item was double clicked, it is the same as if the
// connect button was clicked // connect button was clicked
if ( Item != 0 ) if ( Item != nullptr )
{ {
OnConnectClicked(); OnConnectClicked();
} }
@ -632,7 +632,7 @@ QTreeWidgetItem* CConnectDlg::FindListViewItem ( const CHostAddress& InetAddr )
} }
} }
return NULL; return nullptr;
} }
QTreeWidgetItem* CConnectDlg::GetParentListViewItem ( QTreeWidgetItem* pItem ) QTreeWidgetItem* CConnectDlg::GetParentListViewItem ( QTreeWidgetItem* pItem )

View file

@ -48,8 +48,8 @@ class CConnectDlg : public QDialog, private Ui_CConnectDlgBase
public: public:
CConnectDlg ( const bool bNewShowCompleteRegList, CConnectDlg ( const bool bNewShowCompleteRegList,
QWidget* parent = 0, QWidget* parent = nullptr,
Qt::WindowFlags f = 0 ); Qt::WindowFlags f = nullptr );
void Init ( const QString strNewCentralServerAddr, void Init ( const QString strNewCentralServerAddr,
const CVector<QString>& vstrIPAddresses ); const CVector<QString>& vstrIPAddresses );

View file

@ -51,7 +51,7 @@ public:
RL_RED RL_RED
}; };
CMultiColorLED ( QWidget* parent = 0, Qt::WindowFlags f = 0 ); CMultiColorLED ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
void Reset(); void Reset();
void SetLight ( const ELightColor eNewStatus ); void SetLight ( const ELightColor eNewStatus );

View file

@ -39,7 +39,7 @@ class CMultiColorLEDBar : public QFrame
Q_OBJECT Q_OBJECT
public: public:
CMultiColorLEDBar ( QWidget* parent = 0, Qt::WindowFlags f = 0 ); CMultiColorLEDBar ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
virtual ~CMultiColorLEDBar(); virtual ~CMultiColorLEDBar();
void setValue ( const int value ); void setValue ( const int value );

View file

@ -797,7 +797,7 @@ JitterMeas.Measure();
if ( vecChannels[iCurChanID].GetAudioCompressionType() == CT_OPUS ) if ( vecChannels[iCurChanID].GetAudioCompressionType() == CT_OPUS )
{ {
opus_custom_decode ( OpusDecoderMono[iCurChanID], opus_custom_decode ( OpusDecoderMono[iCurChanID],
NULL, nullptr,
iCeltNumCodedBytes, iCeltNumCodedBytes,
&vecvecsData[i][0], &vecvecsData[i][0],
SYSTEM_FRAME_SIZE_SAMPLES ); SYSTEM_FRAME_SIZE_SAMPLES );
@ -809,7 +809,7 @@ JitterMeas.Measure();
if ( vecChannels[iCurChanID].GetAudioCompressionType() == CT_OPUS ) if ( vecChannels[iCurChanID].GetAudioCompressionType() == CT_OPUS )
{ {
opus_custom_decode ( OpusDecoderStereo[iCurChanID], opus_custom_decode ( OpusDecoderStereo[iCurChanID],
NULL, nullptr,
iCeltNumCodedBytes, iCeltNumCodedBytes,
&vecvecsData[i][0], &vecvecsData[i][0],
SYSTEM_FRAME_SIZE_SAMPLES ); SYSTEM_FRAME_SIZE_SAMPLES );
@ -1252,11 +1252,11 @@ bool CServer::PutAudioData ( const CVector<uint8_t>& vecbyRecBuf,
// time reset gains of this channel ID for all other channels // time reset gains of this channel ID for all other channels
for ( int i = 0; i < iMaxNumChannels; i++ ) for ( int i = 0; i < iMaxNumChannels; i++ )
{ {
vecChannels[iCurChanID].SetGain ( i, (double) 1.0 ); vecChannels[iCurChanID].SetGain ( i, 1.0 );
// other channels (we do not distinguish the case if // other channels (we do not distinguish the case if
// i == iCurChanID for simplicity) // i == iCurChanID for simplicity)
vecChannels[i].SetGain ( iCurChanID, (double) 1.0 ); vecChannels[i].SetGain ( iCurChanID, 1.0 );
} }
} }
else else

View file

@ -450,7 +450,7 @@ void CServerDlg::OnTimer()
// fill list with connected clients // fill list with connected clients
for ( int i = 0; i < iNumChannels; i++ ) for ( int i = 0; i < iNumChannels; i++ )
{ {
if ( !( vecHostAddresses[i].InetAddr == QHostAddress ( (quint32) 0 ) ) ) if ( !( vecHostAddresses[i].InetAddr == QHostAddress ( static_cast<quint32> ( 0 ) ) ) )
{ {
// IP, port number // IP, port number
vecpListViewItems[i]->setText ( 0, vecpListViewItems[i]->setText ( 0,

View file

@ -53,8 +53,8 @@ public:
CServerDlg ( CServer* pNServP, CServerDlg ( CServer* pNServP,
CSettings* pNSetP, CSettings* pNSetP,
const bool bStartMinimized, const bool bStartMinimized,
QWidget* parent = 0, QWidget* parent = nullptr,
Qt::WindowFlags f = 0 ); Qt::WindowFlags f = nullptr );
protected: protected:
virtual void changeEvent ( QEvent* pEvent ); virtual void changeEvent ( QEvent* pEvent );

View file

@ -170,7 +170,7 @@ protected:
class CSocketThread : public QThread class CSocketThread : public QThread
{ {
public: public:
CSocketThread ( CSocket* pNewSocket = NULL, QObject* parent = 0 ) : CSocketThread ( CSocket* pNewSocket = nullptr, QObject* parent = nullptr ) :
QThread ( parent ), pSocket ( pNewSocket ), bRun ( true ) {} QThread ( parent ), pSocket ( pNewSocket ), bRun ( true ) {}
void Stop() void Stop()
@ -191,7 +191,7 @@ protected:
void run() { void run() {
// make sure the socket pointer is initialized (should be always the // make sure the socket pointer is initialized (should be always the
// case) // case)
if ( pSocket != NULL ) if ( pSocket != nullptr )
{ {
while ( bRun ) while ( bRun )
{ {

View file

@ -186,13 +186,13 @@ QString CSoundBase::SetDev ( const int iNewDev )
// have changed so that they are not compatible to our // have changed so that they are not compatible to our
// software anymore // software anymore
QMessageBox::critical ( QMessageBox::critical (
0, APP_NAME, QString ( tr ( "The audio driver properties " nullptr, APP_NAME, QString ( tr ( "The audio driver properties "
"have changed to a state which is incompatible to this " "have changed to a state which is incompatible to this "
"software. The selected audio device could not be used " "software. The selected audio device could not be used "
"because of the following error: <b>" ) ) + "because of the following error: <b>" ) ) +
strErrorMessage + strErrorMessage +
QString ( tr ( "</b><br><br>Please restart the software." ) ), QString ( tr ( "</b><br><br>Please restart the software." ) ),
"Close", 0 ); "Close", nullptr );
_exit ( 0 ); _exit ( 0 );
} }

View file

@ -170,13 +170,13 @@ void CAudioReverb::Init ( const int iSampleRate,
// delay lengths for 44100 Hz sample rate // delay lengths for 44100 Hz sample rate
int lengths[9] = { 1116, 1356, 1422, 1617, 225, 341, 441, 211, 179 }; int lengths[9] = { 1116, 1356, 1422, 1617, 225, 341, 441, 211, 179 };
const double scaler = (double) iSampleRate / 44100.0; const double scaler = static_cast<double> ( iSampleRate ) / 44100.0;
if ( scaler != 1.0 ) if ( scaler != 1.0 )
{ {
for ( i = 0; i < 9; i++ ) for ( i = 0; i < 9; i++ )
{ {
delay = (int) floor ( scaler * lengths[i] ); delay = static_cast<int> ( floor ( scaler * lengths[i] ) );
if ( ( delay & 1 ) == 0 ) if ( ( delay & 1 ) == 0 )
{ {
@ -206,7 +206,7 @@ void CAudioReverb::Init ( const int iSampleRate,
setT60 ( rT60, iSampleRate ); setT60 ( rT60, iSampleRate );
outLeftDelay.Init ( lengths[7] ); outLeftDelay.Init ( lengths[7] );
outRightDelay.Init ( lengths[8] ); outRightDelay.Init ( lengths[8] );
allpassCoefficient = (double) 0.7; allpassCoefficient = 0.7;
Clear(); Clear();
} }
@ -223,7 +223,7 @@ bool CAudioReverb::isPrime ( const int number )
if ( number & 1 ) if ( number & 1 )
{ {
for ( int i = 3; i < (int) sqrt ( (double) number ) + 1; i += 2 ) for ( int i = 3; i < static_cast<int> ( sqrt ( static_cast<double> ( number ) ) ) + 1; i += 2 )
{ {
if ( ( number % i ) == 0 ) if ( ( number % i ) == 0 )
{ {
@ -263,7 +263,7 @@ void CAudioReverb::setT60 ( const double rT60,
// set the reverberation T60 decay time // set the reverberation T60 decay time
for ( int i = 0; i < 4; i++ ) for ( int i = 0; i < 4; i++ )
{ {
combCoefficient[i] = pow ( (double) 10.0, (double) ( -3.0 * combCoefficient[i] = pow ( 10.0, static_cast<double> ( -3.0 *
combDelays[i].Size() / ( rT60 * iSampleRate ) ) ); combDelays[i].Size() / ( rT60 * iSampleRate ) ) );
} }
} }

View file

@ -83,7 +83,7 @@ inline short Double2Short ( const double dInput )
return _MAXSHORT; return _MAXSHORT;
} }
return (short) dInput; return static_cast<short> ( dInput );
} }
// debug error handling // debug error handling
@ -412,7 +412,7 @@ class CAboutDlg : public QDialog, private Ui_CAboutDlgBase
Q_OBJECT Q_OBJECT
public: public:
CAboutDlg ( QWidget* parent = 0 ); CAboutDlg ( QWidget* parent = nullptr );
static QString GetVersionAndNameStr ( const bool bWithHtml = true ); static QString GetVersionAndNameStr ( const bool bWithHtml = true );
}; };
@ -424,7 +424,7 @@ class CLicenceDlg : public QDialog
Q_OBJECT Q_OBJECT
public: public:
CLicenceDlg ( QWidget* parent = 0 ); CLicenceDlg ( QWidget* parent = nullptr );
protected: protected:
QPushButton* butAccept; QPushButton* butAccept;
@ -441,7 +441,7 @@ class CMusProfDlg : public QDialog
public: public:
CMusProfDlg ( CClient* pNCliP, CMusProfDlg ( CClient* pNCliP,
QWidget* parent = 0 ); QWidget* parent = nullptr );
protected: protected:
virtual void showEvent ( QShowEvent* ); virtual void showEvent ( QShowEvent* );
@ -469,7 +469,7 @@ class CHelpMenu : public QMenu
Q_OBJECT Q_OBJECT
public: public:
CHelpMenu ( QWidget* parent = 0 ); CHelpMenu ( QWidget* parent = nullptr );
protected: protected:
CAboutDlg AboutDlg; CAboutDlg AboutDlg;
@ -993,13 +993,13 @@ public:
{ {
switch ( eOSType ) switch ( eOSType )
{ {
case OT_WINDOWS: return "Windows"; break; case OT_WINDOWS: return "Windows";
case OT_MAC_OS: return "MacOS"; break; case OT_MAC_OS: return "MacOS";
case OT_LINUX: return "Linux"; break; case OT_LINUX: return "Linux";
case OT_ANDROID: return "Android"; break; case OT_ANDROID: return "Android";
case OT_I_OS: return "iOS"; break; case OT_I_OS: return "iOS";
case OT_UNIX: return "Unix"; break; case OT_UNIX: return "Unix";
default: return "Unknown"; break; default: return "Unknown";
} }
} }
@ -1024,7 +1024,7 @@ class CAudioReverb
public: public:
CAudioReverb() {} CAudioReverb() {}
void Init ( const int iSampleRate, const double rT60 = (double) 1.1 ); void Init ( const int iSampleRate, const double rT60 = 1.1 );
void Clear(); void Clear();
void ProcessSample ( int16_t& iInputOutputLeft, void ProcessSample ( int16_t& iInputOutputLeft,
int16_t& iInputOutputRight, int16_t& iInputOutputRight,
@ -1083,7 +1083,7 @@ class MathUtils
public: public:
static int round ( double x ) static int round ( double x )
{ {
return (int) ( ( x - floor ( x ) ) >= 0.5 ) ? ceil(x) : floor(x); return static_cast<int> ( ( x - floor ( x ) ) >= 0.5 ) ? static_cast<int> ( ceil ( x ) ) : static_cast<int> ( floor ( x ) );
} }
static void UpDownIIR1 ( double& dOldValue, static void UpDownIIR1 ( double& dOldValue,