diff --git a/src/lib/base/TMethodJob.h b/src/lib/base/TMethodJob.h index 35c641bd19..22b6800053 100644 --- a/src/lib/base/TMethodJob.h +++ b/src/lib/base/TMethodJob.h @@ -17,7 +17,7 @@ template class TMethodJob : public IJob { public: //! run() invokes \c object->method(arg) - TMethodJob(T *object, void (T::*method)(void *), void *arg = nullptr); + TMethodJob(T *object, void (T::*method)(const void *), void *arg = nullptr); ~TMethodJob() override = default; // IJob overrides @@ -25,12 +25,12 @@ public: private: T *m_object; - void (T::*m_method)(void *); + void (T::*m_method)(const void *); void *m_arg; }; template -inline TMethodJob::TMethodJob(T *object, void (T::*method)(void *), void *arg) +inline TMethodJob::TMethodJob(T *object, void (T::*method)(const void *), void *arg) : m_object(object), m_method(method), m_arg(arg) diff --git a/src/lib/deskflow/App.cpp b/src/lib/deskflow/App.cpp index 6bafec9f7e..5743121efd 100644 --- a/src/lib/deskflow/App.cpp +++ b/src/lib/deskflow/App.cpp @@ -165,7 +165,7 @@ void App::handleScreenError() const getEvents()->addEvent(Event(EventTypes::Quit)); } -void App::runEventsLoop(void *) +void App::runEventsLoop(const void *) { m_events->loop(); diff --git a/src/lib/deskflow/App.h b/src/lib/deskflow/App.h index 7f199fa7cc..6ef42dbbb0 100644 --- a/src/lib/deskflow/App.h +++ b/src/lib/deskflow/App.h @@ -107,7 +107,7 @@ public: void handleScreenError() const; protected: - void runEventsLoop(void *); + void runEventsLoop(const void *); private: void (*m_bye)(int); diff --git a/src/lib/net/SocketMultiplexer.cpp b/src/lib/net/SocketMultiplexer.cpp index ce763aaf2a..ac7de51a72 100644 --- a/src/lib/net/SocketMultiplexer.cpp +++ b/src/lib/net/SocketMultiplexer.cpp @@ -119,7 +119,7 @@ void SocketMultiplexer::removeSocket(ISocket *socket) unlockJobList(); } -[[noreturn]] void SocketMultiplexer::serviceThread(void *) +[[noreturn]] void SocketMultiplexer::serviceThread(const void *) { std::vector pfds; IArchNetwork::PollEntry pfd; diff --git a/src/lib/net/SocketMultiplexer.h b/src/lib/net/SocketMultiplexer.h index 8daec8d2d8..e9e0144a53 100644 --- a/src/lib/net/SocketMultiplexer.h +++ b/src/lib/net/SocketMultiplexer.h @@ -60,7 +60,7 @@ private: // and m_update while m_pollable and m_polling are true. all other // threads must only modify these when m_pollable and m_polling are // false. only the service thread sets m_polling. - [[noreturn]] void serviceThread(void *); + [[noreturn]] void serviceThread(const void *); // create, iterate, and destroy a cursor. a cursor is used to // safely iterate through the job list while other threads modify diff --git a/src/lib/platform/MSWindowsDesks.cpp b/src/lib/platform/MSWindowsDesks.cpp index 606009a38a..e6a02544ad 100644 --- a/src/lib/platform/MSWindowsDesks.cpp +++ b/src/lib/platform/MSWindowsDesks.cpp @@ -596,12 +596,12 @@ void MSWindowsDesks::deskLeave(Desk *desk, HKL keyLayout) } } -void MSWindowsDesks::deskThread(void *vdesk) +void MSWindowsDesks::deskThread(const void *vdesk) { MSG msg; // use given desktop for this thread - Desk *desk = static_cast(vdesk); + Desk *desk = const_cast(static_cast(vdesk)); desk->m_threadID = GetCurrentThreadId(); desk->m_window = nullptr; desk->m_foregroundWindow = nullptr; diff --git a/src/lib/platform/MSWindowsDesks.h b/src/lib/platform/MSWindowsDesks.h index b7ae63b06c..038b7bdb2b 100644 --- a/src/lib/platform/MSWindowsDesks.h +++ b/src/lib/platform/MSWindowsDesks.h @@ -203,7 +203,7 @@ private: void deskMouseRelativeMove(int32_t dx, int32_t dy) const; void deskEnter(Desk *desk); void deskLeave(Desk *desk, HKL keyLayout); - void deskThread(void *vdesk); + void deskThread(const void *vdesk); // desk switch checking and handling Desk *addDesk(const std::wstring &name, HDESK hdesk); diff --git a/src/lib/platform/MSWindowsScreen.cpp b/src/lib/platform/MSWindowsScreen.cpp index 106f67dd85..a606da7a9a 100644 --- a/src/lib/platform/MSWindowsScreen.cpp +++ b/src/lib/platform/MSWindowsScreen.cpp @@ -1558,7 +1558,7 @@ bool MSWindowsScreen::mapPressFromEvent(WPARAM msg, LPARAM) const } } -void MSWindowsScreen::updateKeysCB(void *) +void MSWindowsScreen::updateKeysCB(const void *) { // record which keys we think are down bool down[IKeyState::s_numButtons]; diff --git a/src/lib/platform/MSWindowsScreen.h b/src/lib/platform/MSWindowsScreen.h index 3692d2f39d..5430c3dba3 100644 --- a/src/lib/platform/MSWindowsScreen.h +++ b/src/lib/platform/MSWindowsScreen.h @@ -205,7 +205,7 @@ private: // HACK bool mapPressFromEvent(WPARAM msg, LPARAM button) const; // job to update the key state - void updateKeysCB(void *); + void updateKeysCB(const void *); // determine whether the mouse is hidden by the system. // if true and on secondary screen, enable mouse keys to show the cursor. diff --git a/src/lib/platform/MSWindowsScreenSaver.cpp b/src/lib/platform/MSWindowsScreenSaver.cpp index f86669a76e..070fde824b 100644 --- a/src/lib/platform/MSWindowsScreenSaver.cpp +++ b/src/lib/platform/MSWindowsScreenSaver.cpp @@ -206,7 +206,7 @@ void MSWindowsScreenSaver::unwatchProcess() } } -void MSWindowsScreenSaver::watchDesktopThread(void *) +void MSWindowsScreenSaver::watchDesktopThread(const void *) { DWORD reserved = 0; TCHAR *name = nullptr; @@ -228,7 +228,7 @@ void MSWindowsScreenSaver::watchDesktopThread(void *) } } -void MSWindowsScreenSaver::watchProcessThread(void *) +void MSWindowsScreenSaver::watchProcessThread(const void *) { for (;;) { Thread::testCancel(); diff --git a/src/lib/platform/MSWindowsScreenSaver.h b/src/lib/platform/MSWindowsScreenSaver.h index 688fddc99c..1eb0e926e4 100644 --- a/src/lib/platform/MSWindowsScreenSaver.h +++ b/src/lib/platform/MSWindowsScreenSaver.h @@ -55,8 +55,8 @@ private: void watchDesktop(); void watchProcess(HANDLE process); void unwatchProcess(); - void watchDesktopThread(void *); - void watchProcessThread(void *); + void watchDesktopThread(const void *); + void watchProcessThread(const void *); void setSecure(bool secure, bool saveSecureAsInt); bool isSecure(bool *wasSecureAnInt) const; diff --git a/src/lib/platform/MSWindowsWatchdog.cpp b/src/lib/platform/MSWindowsWatchdog.cpp index f9d98d6aa3..baa578e69d 100644 --- a/src/lib/platform/MSWindowsWatchdog.cpp +++ b/src/lib/platform/MSWindowsWatchdog.cpp @@ -151,7 +151,7 @@ MSWindowsWatchdog::getUserToken(LPSECURITY_ATTRIBUTES security, bool elevatedTok } } -void MSWindowsWatchdog::mainLoop(void *) +void MSWindowsWatchdog::mainLoop(const void *) { using enum ProcessState; @@ -322,7 +322,7 @@ void MSWindowsWatchdog::setProcessConfig(const std::string_view &command, bool e } } -void MSWindowsWatchdog::outputLoop(void *) +void MSWindowsWatchdog::outputLoop(const void *) { static constexpr DWORD kBufSize = 4096; @@ -497,7 +497,7 @@ void MSWindowsWatchdog::initSasFunc() LOG_DEBUG("found SendSAS function in sas.dll"); } -void MSWindowsWatchdog::sasLoop(void *) // NOSONAR - Thread entry point signature +void MSWindowsWatchdog::sasLoop(const void *) // NOSONAR - Thread entry point signature { LOG_DEBUG3("watchdog creating sas event"); diff --git a/src/lib/platform/MSWindowsWatchdog.h b/src/lib/platform/MSWindowsWatchdog.h index e397bc6b0a..c5559de3b2 100644 --- a/src/lib/platform/MSWindowsWatchdog.h +++ b/src/lib/platform/MSWindowsWatchdog.h @@ -64,12 +64,12 @@ private: /** * @brief Monitor the process state and start/stop the process as necessary. */ - void mainLoop(void *); + void mainLoop(const void *); /** * @brief Monitor the process standard out/error and write to the file log outputter. */ - void outputLoop(void *); + void outputLoop(const void *); /** * @brief Duplicates the process token for the given process. @@ -116,7 +116,7 @@ private: * * SendSAS sends a SAS (Secure Attention Sequence) for Ctrl+Alt+Del emulation. */ - void sasLoop(void *); + void sasLoop(const void *); /** * @brief Convert the process state enum to a string (useful for logging). diff --git a/src/lib/platform/OSXScreen.h b/src/lib/platform/OSXScreen.h index b956db6a7c..fc795cea1d 100644 --- a/src/lib/platform/OSXScreen.h +++ b/src/lib/platform/OSXScreen.h @@ -153,7 +153,7 @@ private: static pascal OSStatus userSwitchCallback(EventHandlerCallRef nextHandler, EventRef theEvent, void *inUserData); // sleep / wakeup support - void watchSystemPowerThread(void *); + void watchSystemPowerThread(const void *); static void testCanceled(CFRunLoopTimerRef timer, void *info); static void powerChangeCallback(void *refcon, io_service_t service, natural_t messageType, void *messageArgument); void handlePowerChangeRequest(natural_t messageType, void *messageArgument); diff --git a/src/lib/platform/OSXScreen.mm b/src/lib/platform/OSXScreen.mm index c6aec907fc..ee318cdb2d 100644 --- a/src/lib/platform/OSXScreen.mm +++ b/src/lib/platform/OSXScreen.mm @@ -1343,7 +1343,7 @@ pascal OSStatus OSXScreen::userSwitchCallback(EventHandlerCallRef nextHandler, E // main of thread monitoring system power (sleep/wakup) using a CFRunLoop // -void OSXScreen::watchSystemPowerThread(void *) +void OSXScreen::watchSystemPowerThread(const void *) { io_object_t notifier; IONotificationPortRef notificationPortRef; diff --git a/src/lib/platform/PortalInputCapture.cpp b/src/lib/platform/PortalInputCapture.cpp index a9258bbc07..9da3d9ba08 100644 --- a/src/lib/platform/PortalInputCapture.cpp +++ b/src/lib/platform/PortalInputCapture.cpp @@ -348,7 +348,7 @@ void PortalInputCapture::handleZonesChanged(XdpInputCaptureSession *session, con } } -void PortalInputCapture::glibThread(void *) +void PortalInputCapture::glibThread(const void *) { auto context = g_main_loop_get_context(m_glibMainLoop); diff --git a/src/lib/platform/PortalInputCapture.h b/src/lib/platform/PortalInputCapture.h index ecf6f66da9..8448cb74a9 100644 --- a/src/lib/platform/PortalInputCapture.h +++ b/src/lib/platform/PortalInputCapture.h @@ -33,7 +33,7 @@ public: } private: - void glibThread(void *); + void glibThread(const void *); gboolean timeoutHandler() const; gboolean initSession(); void handleInitSession(GObject *object, GAsyncResult *res); diff --git a/src/lib/platform/PortalRemoteDesktop.cpp b/src/lib/platform/PortalRemoteDesktop.cpp index ab46dfb66a..59a890b615 100644 --- a/src/lib/platform/PortalRemoteDesktop.cpp +++ b/src/lib/platform/PortalRemoteDesktop.cpp @@ -170,7 +170,7 @@ gboolean PortalRemoteDesktop::initSession() return false; // don't reschedule } -void PortalRemoteDesktop::glibThread(void *) +void PortalRemoteDesktop::glibThread(const void *) { auto context = g_main_loop_get_context(m_glibMainLoop); diff --git a/src/lib/platform/PortalRemoteDesktop.h b/src/lib/platform/PortalRemoteDesktop.h index 0399c43dc8..8f4b14bc74 100644 --- a/src/lib/platform/PortalRemoteDesktop.h +++ b/src/lib/platform/PortalRemoteDesktop.h @@ -24,7 +24,7 @@ public: ~PortalRemoteDesktop(); private: - void glibThread(void *); + void glibThread(const void *); gboolean timeoutHandler() const; gboolean initSession(); void handleInitSession(GObject *object, GAsyncResult *res);