diff --git a/src/lib/base/Log.h b/src/lib/base/Log.h index 412409927..9ce2d51fd 100644 --- a/src/lib/base/Log.h +++ b/src/lib/base/Log.h @@ -27,8 +27,8 @@ LOGC() provide convenient access. class Log { public: - Log(bool singleton = true); - Log(Log *src); + explicit Log(bool singleton = true); + explicit Log(Log *src); Log(Log const &) = delete; Log(Log &&) = delete; ~Log(); diff --git a/src/lib/base/XBase.h b/src/lib/base/XBase.h index 7e658ed04..1785f9c80 100644 --- a/src/lib/base/XBase.h +++ b/src/lib/base/XBase.h @@ -20,7 +20,7 @@ public: //! Use getWhat() as the result of what() XBase(); //! Use \c msg as the result of what() - XBase(const std::string &msg); + explicit XBase(const std::string &msg); ~XBase() throw() override = default; //! Reason for exception diff --git a/src/lib/client/Client.h b/src/lib/client/Client.h index 220c9334a..3da40df0c 100644 --- a/src/lib/client/Client.h +++ b/src/lib/client/Client.h @@ -43,7 +43,7 @@ public: class FailInfo { public: - FailInfo(const char *what) : m_retry(false), m_what(what) + explicit FailInfo(const char *what) : m_retry(false), m_what(what) { // do nothing } diff --git a/src/lib/deskflow/ArgParser.h b/src/lib/deskflow/ArgParser.h index f5075a4fe..fd09256ed 100644 --- a/src/lib/deskflow/ArgParser.h +++ b/src/lib/deskflow/ArgParser.h @@ -21,7 +21,7 @@ class ArgParser { public: - ArgParser(App *app); + explicit ArgParser(App *app); bool parseServerArgs(deskflow::ServerArgs &args, int argc, const char *const *argv); bool parseClientArgs(deskflow::ClientArgs &args, int argc, const char *const *argv); diff --git a/src/lib/deskflow/Chunk.h b/src/lib/deskflow/Chunk.h index 67627969c..9701d1169 100644 --- a/src/lib/deskflow/Chunk.h +++ b/src/lib/deskflow/Chunk.h @@ -12,7 +12,7 @@ class Chunk : public EventData { public: - Chunk(size_t size); + explicit Chunk(size_t size); Chunk(Chunk const &) = delete; Chunk(Chunk &&) = delete; ~Chunk() override; diff --git a/src/lib/deskflow/ClientApp.h b/src/lib/deskflow/ClientApp.h index 2f9cce773..0adb0075b 100644 --- a/src/lib/deskflow/ClientApp.h +++ b/src/lib/deskflow/ClientApp.h @@ -23,7 +23,7 @@ class ISocketFactory; class ClientApp : public App { public: - ClientApp(IEventQueue *events); + explicit ClientApp(IEventQueue *events); ~ClientApp() override = default; // diff --git a/src/lib/deskflow/ClipboardChunk.h b/src/lib/deskflow/ClipboardChunk.h index 3d4b5c613..46fa66a9f 100644 --- a/src/lib/deskflow/ClipboardChunk.h +++ b/src/lib/deskflow/ClipboardChunk.h @@ -21,7 +21,7 @@ class IStream; class ClipboardChunk : public Chunk { public: - ClipboardChunk(size_t size); + explicit ClipboardChunk(size_t size); static ClipboardChunk *start(ClipboardID id, uint32_t sequence, const std::string &size); static ClipboardChunk *data(ClipboardID id, uint32_t sequence, const std::string &data); diff --git a/src/lib/deskflow/DisplayInvalidException.h b/src/lib/deskflow/DisplayInvalidException.h index f6f6f04d5..304d2caf5 100644 --- a/src/lib/deskflow/DisplayInvalidException.h +++ b/src/lib/deskflow/DisplayInvalidException.h @@ -12,12 +12,12 @@ class DisplayInvalidException : public std::runtime_error { public: - DisplayInvalidException(const char *msg) : std::runtime_error(msg) + explicit DisplayInvalidException(const char *msg) : std::runtime_error(msg) { // do nothing } - DisplayInvalidException(std::string msg) : std::runtime_error(msg) + explicit DisplayInvalidException(std::string msg) : std::runtime_error(msg) { // do nothing } diff --git a/src/lib/deskflow/IKeyState.h b/src/lib/deskflow/IKeyState.h index 6fbc3ea1a..2dfca19af 100644 --- a/src/lib/deskflow/IKeyState.h +++ b/src/lib/deskflow/IKeyState.h @@ -23,7 +23,7 @@ to synthesize key events. class IKeyState : public IInterface { public: - IKeyState(IEventQueue *events); + explicit IKeyState(IEventQueue *events); enum { diff --git a/src/lib/deskflow/IPlatformScreen.h b/src/lib/deskflow/IPlatformScreen.h index 7ee577cb2..5cdd9ac3e 100644 --- a/src/lib/deskflow/IPlatformScreen.h +++ b/src/lib/deskflow/IPlatformScreen.h @@ -28,7 +28,7 @@ public: //! @name manipulators //@{ - IPlatformScreen(IEventQueue *events) : IKeyState(events) + explicit IPlatformScreen(IEventQueue *events) : IKeyState(events) { // do nothing } diff --git a/src/lib/deskflow/ServerApp.h b/src/lib/deskflow/ServerApp.h index b82e11cb9..b95f43310 100644 --- a/src/lib/deskflow/ServerApp.h +++ b/src/lib/deskflow/ServerApp.h @@ -45,7 +45,7 @@ class ServerApp : public App using ServerConfig = deskflow::server::Config; public: - ServerApp(IEventQueue *events); + explicit ServerApp(IEventQueue *events); ~ServerApp() override = default; // diff --git a/src/lib/deskflow/XDeskflow.h b/src/lib/deskflow/XDeskflow.h index 926a81bed..b38da1b93 100644 --- a/src/lib/deskflow/XDeskflow.h +++ b/src/lib/deskflow/XDeskflow.h @@ -65,7 +65,7 @@ a client that is already connected. class XDuplicateClient : public XDeskflow { public: - XDuplicateClient(const std::string &name); + explicit XDuplicateClient(const std::string &name); ~XDuplicateClient() throw() override = default; //! @name accessors @@ -91,7 +91,7 @@ unknown to the server. class XUnknownClient : public XDeskflow { public: - XUnknownClient(const std::string &name); + explicit XUnknownClient(const std::string &name); ~XUnknownClient() throw() override = default; //! @name accessors @@ -118,7 +118,7 @@ exit(int). class XExitApp : public XDeskflow { public: - XExitApp(int code); + explicit XExitApp(int code); ~XExitApp() throw() override = default; //! Get the exit code diff --git a/src/lib/deskflow/XScreen.h b/src/lib/deskflow/XScreen.h index c75b79432..bcd212c9b 100644 --- a/src/lib/deskflow/XScreen.h +++ b/src/lib/deskflow/XScreen.h @@ -36,7 +36,7 @@ public: \c timeUntilRetry is the suggested time the caller should wait until trying to open the screen again. */ - XScreenUnavailable(double timeUntilRetry); + explicit XScreenUnavailable(double timeUntilRetry); ~XScreenUnavailable() throw() override = default; //! @name manipulators diff --git a/src/lib/deskflow/unix/AppUtilUnix.h b/src/lib/deskflow/unix/AppUtilUnix.h index 18f1089f1..e5a703c1a 100644 --- a/src/lib/deskflow/unix/AppUtilUnix.h +++ b/src/lib/deskflow/unix/AppUtilUnix.h @@ -16,7 +16,7 @@ class IEventQueue; class AppUtilUnix : public AppUtil { public: - AppUtilUnix(IEventQueue *events); + explicit AppUtilUnix(IEventQueue *events); ~AppUtilUnix() override = default; int run(int argc, char **argv) override; diff --git a/src/lib/deskflow/win32/AppUtilWindows.h b/src/lib/deskflow/win32/AppUtilWindows.h index fd8e94f1b..030118928 100644 --- a/src/lib/deskflow/win32/AppUtilWindows.h +++ b/src/lib/deskflow/win32/AppUtilWindows.h @@ -29,7 +29,7 @@ enum AppExitMode class AppUtilWindows : public AppUtil { public: - AppUtilWindows(IEventQueue *events); + explicit AppUtilWindows(IEventQueue *events); ~AppUtilWindows() override; static AppUtilWindows &instance(); diff --git a/src/lib/gui/widgets/NewScreenWidget.h b/src/lib/gui/widgets/NewScreenWidget.h index 63bf37951..bedf8143e 100644 --- a/src/lib/gui/widgets/NewScreenWidget.h +++ b/src/lib/gui/widgets/NewScreenWidget.h @@ -17,7 +17,7 @@ class NewScreenWidget : public QLabel Q_OBJECT public: - NewScreenWidget(QWidget *parent); + explicit NewScreenWidget(QWidget *parent); protected: void mousePressEvent(QMouseEvent *event) override; diff --git a/src/lib/gui/widgets/ScreenSetupView.h b/src/lib/gui/widgets/ScreenSetupView.h index 3563b0e14..5dc13bbcb 100644 --- a/src/lib/gui/widgets/ScreenSetupView.h +++ b/src/lib/gui/widgets/ScreenSetupView.h @@ -23,7 +23,7 @@ class ScreenSetupView : public QTableView Q_OBJECT public: - ScreenSetupView(QWidget *parent); + explicit ScreenSetupView(QWidget *parent); public: void setModel(QAbstractItemModel *model) override; diff --git a/src/lib/gui/widgets/TrashScreenWidget.h b/src/lib/gui/widgets/TrashScreenWidget.h index 4e96fd2e3..a5bf4c45b 100644 --- a/src/lib/gui/widgets/TrashScreenWidget.h +++ b/src/lib/gui/widgets/TrashScreenWidget.h @@ -18,7 +18,7 @@ class TrashScreenWidget : public QLabel Q_OBJECT public: - TrashScreenWidget(QWidget *parent) : QLabel(parent) + explicit TrashScreenWidget(QWidget *parent) : QLabel(parent) { // do nothing } diff --git a/src/lib/mt/CondVar.h b/src/lib/mt/CondVar.h index fbde627d6..f49742248 100644 --- a/src/lib/mt/CondVar.h +++ b/src/lib/mt/CondVar.h @@ -27,7 +27,7 @@ public: associated mutex. The mutex needn't be unique to one condition variable. */ - CondVarBase(Mutex *mutex); + explicit CondVarBase(Mutex *mutex); ~CondVarBase(); //! @name manipulators diff --git a/src/lib/mt/Lock.h b/src/lib/mt/Lock.h index 702aec236..0141a648c 100644 --- a/src/lib/mt/Lock.h +++ b/src/lib/mt/Lock.h @@ -23,9 +23,9 @@ class Lock { public: //! Lock the mutex \c mutex - Lock(const Mutex *mutex); + explicit Lock(const Mutex *mutex); //! Lock the condition variable \c cv - Lock(const CondVarBase *cv); + explicit Lock(const CondVarBase *cv); //! Unlock the mutex or condition variable ~Lock(); diff --git a/src/lib/mt/Thread.h b/src/lib/mt/Thread.h index acfb9e03d..2593e9e34 100644 --- a/src/lib/mt/Thread.h +++ b/src/lib/mt/Thread.h @@ -37,7 +37,7 @@ public: Create and start a new thread executing the \c adoptedJob. The new thread takes ownership of \c adoptedJob and will delete it. */ - Thread(IJob *adoptedJob); + explicit Thread(IJob *adoptedJob); //! Duplicate a thread handle /*! @@ -190,7 +190,7 @@ public: //@} private: - Thread(ArchThread); + explicit Thread(ArchThread); static void *threadFunc(void *); diff --git a/src/lib/mt/XThread.h b/src/lib/mt/XThread.h index 9b99188ca..49fa0aad7 100644 --- a/src/lib/mt/XThread.h +++ b/src/lib/mt/XThread.h @@ -19,7 +19,7 @@ class XThreadExit : public XThread { public: //! \c result is the result of the thread - XThreadExit(void *result) : m_result(result) + explicit XThreadExit(void *result) : m_result(result) { // do nothing } diff --git a/src/lib/net/IDataSocket.h b/src/lib/net/IDataSocket.h index 2ae8c5cea..19e762310 100644 --- a/src/lib/net/IDataSocket.h +++ b/src/lib/net/IDataSocket.h @@ -22,15 +22,16 @@ public: class ConnectionFailedInfo { public: - ConnectionFailedInfo(const char *what) : m_what(what) + explicit ConnectionFailedInfo(const char *what) : m_what(what) { // do nothing } std::string m_what; }; - IDataSocket(IEventQueue *events) + explicit IDataSocket(IEventQueue *events) { + // do nothing } //! @name manipulators diff --git a/src/lib/net/NetworkAddress.h b/src/lib/net/NetworkAddress.h index 30b88ca0a..c23099c1b 100644 --- a/src/lib/net/NetworkAddress.h +++ b/src/lib/net/NetworkAddress.h @@ -26,7 +26,7 @@ public: Construct the wildcard address with the given port. \c port must not be zero. */ - NetworkAddress(int port); + explicit NetworkAddress(int port); /*! Construct the network address for the given \c hostname and \c port. diff --git a/src/lib/platform/EiScreen.h b/src/lib/platform/EiScreen.h index eed7739e7..fa89cfc00 100644 --- a/src/lib/platform/EiScreen.h +++ b/src/lib/platform/EiScreen.h @@ -164,7 +164,7 @@ private: class HotKeySet { public: - HotKeySet(KeyID keyid); + explicit HotKeySet(KeyID keyid); KeyID keyid() const { return id_; diff --git a/src/lib/platform/XWindowsClipboardBMPConverter.h b/src/lib/platform/XWindowsClipboardBMPConverter.h index 077b7d8ac..8d5722e50 100644 --- a/src/lib/platform/XWindowsClipboardBMPConverter.h +++ b/src/lib/platform/XWindowsClipboardBMPConverter.h @@ -13,7 +13,7 @@ class XWindowsClipboardBMPConverter : public IXWindowsClipboardConverter { public: - XWindowsClipboardBMPConverter(Display *display); + explicit XWindowsClipboardBMPConverter(Display *display); ~XWindowsClipboardBMPConverter() override = default; // IXWindowsClipboardConverter overrides diff --git a/src/lib/platform/XWindowsUtil.h b/src/lib/platform/XWindowsUtil.h index 74386cb0b..1e09498a1 100644 --- a/src/lib/platform/XWindowsUtil.h +++ b/src/lib/platform/XWindowsUtil.h @@ -125,7 +125,7 @@ public: /*! Ignore X11 errors. */ - ErrorLock(Display *); + explicit ErrorLock(Display *); ErrorLock(ErrorLock const &) = delete; ErrorLock(ErrorLock &&) = delete; diff --git a/src/lib/server/BaseClientProxy.h b/src/lib/server/BaseClientProxy.h index 0331a148d..d61e34642 100644 --- a/src/lib/server/BaseClientProxy.h +++ b/src/lib/server/BaseClientProxy.h @@ -20,7 +20,7 @@ public: /*! \c name is the name of the client. */ - BaseClientProxy(const std::string &name); + explicit BaseClientProxy(const std::string &name); ~BaseClientProxy() override = default; //! @name manipulators diff --git a/src/lib/server/Config.h b/src/lib/server/Config.h index 3c7a6dd3d..1d9c4ee65 100644 --- a/src/lib/server/Config.h +++ b/src/lib/server/Config.h @@ -201,7 +201,7 @@ public: internal_const_iterator m_i; }; - Config(IEventQueue *events); + explicit Config(IEventQueue *events); virtual ~Config() = default; //! @name manipulators diff --git a/src/lib/server/InputFilter.h b/src/lib/server/InputFilter.h index a2cdfaa73..71aff127f 100644 --- a/src/lib/server/InputFilter.h +++ b/src/lib/server/InputFilter.h @@ -301,7 +301,7 @@ public: { public: Rule(); - Rule(Condition *adopted); + explicit Rule(Condition *adopted); Rule(const Rule &); ~Rule(); @@ -355,7 +355,7 @@ public: // ------------------------------------------------------------------------- using RuleList = std::vector; - InputFilter(IEventQueue *events); + explicit InputFilter(IEventQueue *events); InputFilter(const InputFilter &); virtual ~InputFilter(); diff --git a/src/lib/server/Server.h b/src/lib/server/Server.h index 207cd1b6e..1e959175a 100644 --- a/src/lib/server/Server.h +++ b/src/lib/server/Server.h @@ -86,8 +86,9 @@ public: class ScreenConnectedInfo { public: - ScreenConnectedInfo(std::string screen) : m_screen(screen) + explicit ScreenConnectedInfo(std::string screen) : m_screen(screen) { + // do nothing } public: