From ead042a301d584746cf264249ae35c10f7da4ee6 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 29 Mar 2020 12:12:13 +0200 Subject: [PATCH] patch provided by jkohnert, see Ticket #63 Fix compiler warnings on Linux --- Jamulus.pro | 4 ++++ libs/opus/src/mlp.c | 22 +++++++++++----------- src/connectdlg.cpp | 6 +++--- src/serverlist.h | 4 ++-- src/util.h | 4 ++++ 5 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Jamulus.pro b/Jamulus.pro index c594288a..fb71108b 100755 --- a/Jamulus.pro +++ b/Jamulus.pro @@ -106,6 +106,10 @@ win32 { # we want to compile with C++11 QMAKE_CXXFLAGS += -std=c++11 + # we assume to have lrintf() one moderately modern linux distributions + # would be better to have that tested, though + DEFINES += HAVE_LRINTF + # we assume that stdint.h is always present in a Linux system DEFINES += HAVE_STDINT_H diff --git a/libs/opus/src/mlp.c b/libs/opus/src/mlp.c index 46386026..b8a4e568 100644 --- a/libs/opus/src/mlp.c +++ b/libs/opus/src/mlp.c @@ -75,17 +75,17 @@ static OPUS_INLINE float tansig_approx(float x) return 1; if (!(x>-8)) return -1; - if (x<0) - { - x=-x; - sign=-1; - } - i = (int)floor(.5f+25*x); - x -= .04f*i; - y = tansig_table[i]; - dy = 1-y*y; - y = y + x*dy*(1 - y*x); - return sign*y; + if (x<0) + { + x=-x; + sign=-1; + } + i = (int)floor(.5f+25*x); + x -= .04f*i; + y = tansig_table[i]; + dy = 1-y*y; + y = y + x*dy*(1 - y*x); + return sign*y; } #endif diff --git a/src/connectdlg.cpp b/src/connectdlg.cpp index ee7fa8f6..0f5eac42 100755 --- a/src/connectdlg.cpp +++ b/src/connectdlg.cpp @@ -536,15 +536,15 @@ void CConnectDlg::SetPingTimeAndNumClientsResult ( CHostAddress& switch ( ePingTimeLEDColor ) { case CMultiColorLED::RL_GREEN: - pCurListViewItem->setTextColor ( 1, Qt::darkGreen ); + pCurListViewItem->setForeground ( 1, Qt::darkGreen ); break; case CMultiColorLED::RL_YELLOW: - pCurListViewItem->setTextColor ( 1, Qt::darkYellow ); + pCurListViewItem->setForeground ( 1, Qt::darkYellow ); break; default: // including "CMultiColorLED::RL_RED" - pCurListViewItem->setTextColor ( 1, Qt::red ); + pCurListViewItem->setForeground ( 1, Qt::red ); break; } diff --git a/src/serverlist.h b/src/serverlist.h index 4528ad6b..c7f5e9a0 100755 --- a/src/serverlist.h +++ b/src/serverlist.h @@ -62,7 +62,7 @@ private network. #include #include #include -#include +#include #include #include "global.h" #include "util.h" @@ -116,7 +116,7 @@ public: public: // time on which the entry was registered - QTime RegisterTime; + QElapsedTimer RegisterTime; }; class CServerListManager : public QObject diff --git a/src/util.h b/src/util.h index ac646f3b..323f136d 100755 --- a/src/util.h +++ b/src/util.h @@ -114,6 +114,8 @@ public: CVector ( const int iNeSi, const TData tInVa ) { Init ( iNeSi, tInVa ); } + CVector ( CVector const& ) = default; + void Init ( const int iNewSize ); // use this init to give all elements a defined value @@ -778,6 +780,8 @@ public: ( CompChanInfo.eSkillLevel != eSkillLevel ) ); } + CChannelCoreInfo& operator= ( const CChannelCoreInfo& ) = default; + // fader tag text (channel name) QString strName;