From da3876325d6fc737643e3118672292e1eace5e01 Mon Sep 17 00:00:00 2001 From: Daniel Seither Date: Tue, 19 Nov 2019 12:01:37 +0100 Subject: [PATCH 1/4] Remove unused variables --- src/gui/src/SettingsDialog.cpp | 4 +--- src/lib/arch/unix/ArchNetworkBSD.cpp | 1 - src/lib/barrier/ServerApp.cpp | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/src/SettingsDialog.cpp b/src/gui/src/SettingsDialog.cpp index 15f7067f..24bb86c6 100644 --- a/src/gui/src/SettingsDialog.cpp +++ b/src/gui/src/SettingsDialog.cpp @@ -31,8 +31,6 @@ #include #include -static const char networkSecurity[] = "ns"; - SettingsDialog::SettingsDialog(QWidget* parent, AppConfig& config) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), Ui::SettingsDialogBase(), @@ -136,4 +134,4 @@ void SettingsDialog::on_m_pComboLanguage_currentIndexChanged(int index) { QString ietfCode = m_pComboLanguage->itemData(index).toString(); QBarrierApplication::getInstance()->switchTranslator(ietfCode); -} \ No newline at end of file +} diff --git a/src/lib/arch/unix/ArchNetworkBSD.cpp b/src/lib/arch/unix/ArchNetworkBSD.cpp index 2a9259ca..496c9888 100644 --- a/src/lib/arch/unix/ArchNetworkBSD.cpp +++ b/src/lib/arch/unix/ArchNetworkBSD.cpp @@ -690,7 +690,6 @@ ArchNetworkBSD::nameToAddr(const std::string& name) // allocate address ArchNetAddressImpl* addr = new ArchNetAddressImpl; - char ipstr[INET6_ADDRSTRLEN]; struct addrinfo hints; struct addrinfo *p; int ret; diff --git a/src/lib/barrier/ServerApp.cpp b/src/lib/barrier/ServerApp.cpp index 318673ca..c1cb962d 100644 --- a/src/lib/barrier/ServerApp.cpp +++ b/src/lib/barrier/ServerApp.cpp @@ -684,9 +684,9 @@ ServerApp::handleNoClients(const Event&, void*) void ServerApp::handleScreenSwitched(const Event& e, void*) { - Server::SwitchToScreenInfo* info = (Server::SwitchToScreenInfo*)(e.getData()); - #ifdef WINAPI_XWINDOWS + Server::SwitchToScreenInfo* info = (Server::SwitchToScreenInfo*)(e.getData()); + if (!args().m_screenChangeScript.empty()) { LOG((CLOG_INFO "Running shell script for screen \"%s\"", info->m_screen)); From 96e8adbaae126263cd170186411e857b73d851e2 Mon Sep 17 00:00:00 2001 From: Daniel Seither Date: Tue, 19 Nov 2019 12:03:53 +0100 Subject: [PATCH 2/4] IpcLogOutputter: Put member initializers in execution order Member initializers are always run in the order defined in the header. This commit reorders them in the implementation so that their order reflects their execution order. --- src/lib/ipc/IpcLogOutputter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ipc/IpcLogOutputter.cpp b/src/lib/ipc/IpcLogOutputter.cpp index b62c76a0..8f649d2f 100644 --- a/src/lib/ipc/IpcLogOutputter.cpp +++ b/src/lib/ipc/IpcLogOutputter.cpp @@ -44,8 +44,8 @@ IpcLogOutputter::IpcLogOutputter(IpcServer& ipcServer, EIpcClientType clientType m_running(false), m_notifyCond(ARCH->newCondVar()), m_notifyMutex(ARCH->newMutex()), - m_bufferThreadId(0), m_bufferWaiting(false), + m_bufferThreadId(0), m_bufferMaxSize(kBufferMaxSize), m_bufferRateWriteLimit(kBufferRateWriteLimit), m_bufferRateTimeLimit(kBufferRateTimeLimit), From 937326bf4f52eee356bed7afdf65d388961d63d2 Mon Sep 17 00:00:00 2001 From: Daniel Seither Date: Tue, 19 Nov 2019 12:04:29 +0100 Subject: [PATCH 3/4] OSXDragView: Get rid of uninitialized variable warning --- src/lib/platform/OSXDragView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/platform/OSXDragView.m b/src/lib/platform/OSXDragView.m index 9f774993..67dac566 100644 --- a/src/lib/platform/OSXDragView.m +++ b/src/lib/platform/OSXDragView.m @@ -129,13 +129,13 @@ draggingSourceOperationMask - (NSPoint)draggingLocation { - NSPoint point; + NSPoint point = NSMakePoint(0, 0); return point; } - (NSPoint)draggedImageLocation { - NSPoint point; + NSPoint point = NSMakePoint(0, 0); return point; } From dc2d8e966149b6d7675f890ea1ffccac077b8246 Mon Sep 17 00:00:00 2001 From: Daniel Seither Date: Tue, 19 Nov 2019 12:04:55 +0100 Subject: [PATCH 4/4] Add override specifiers --- src/lib/net/SecureSocket.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/net/SecureSocket.h b/src/lib/net/SecureSocket.h index 773b5088..d4c36d4d 100644 --- a/src/lib/net/SecureSocket.h +++ b/src/lib/net/SecureSocket.h @@ -39,21 +39,21 @@ public: ~SecureSocket(); // ISocket overrides - void close(); + void close() override; // IDataSocket overrides - virtual void connect(const NetworkAddress&); + virtual void connect(const NetworkAddress&) override; std::unique_ptr newJob() override; - bool isFatal() const { return m_fatal; } + bool isFatal() const override { return m_fatal; } void isFatal(bool b) { m_fatal = b; } bool isSecureReady(); void secureConnect(); void secureAccept(); int secureRead(void* buffer, int size, int& read); int secureWrite(const void* buffer, int size, int& wrote); - EJobResult doRead(); - EJobResult doWrite(); + EJobResult doRead() override; + EJobResult doWrite() override; void initSsl(bool server); bool loadCertificates(String& CertFile);