mirror of
https://github.com/deskflow/deskflow.git
synced 2026-07-04 21:04:59 +08:00
chore: make TMethodJob const void*
This commit is contained in:
parent
eab38dc23e
commit
8fadbecf00
@ -17,7 +17,7 @@ template <class T> 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 <class T>
|
||||
inline TMethodJob<T>::TMethodJob(T *object, void (T::*method)(void *), void *arg)
|
||||
inline TMethodJob<T>::TMethodJob(T *object, void (T::*method)(const void *), void *arg)
|
||||
: m_object(object),
|
||||
m_method(method),
|
||||
m_arg(arg)
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ public:
|
||||
void handleScreenError() const;
|
||||
|
||||
protected:
|
||||
void runEventsLoop(void *);
|
||||
void runEventsLoop(const void *);
|
||||
|
||||
private:
|
||||
void (*m_bye)(int);
|
||||
|
||||
@ -119,7 +119,7 @@ void SocketMultiplexer::removeSocket(ISocket *socket)
|
||||
unlockJobList();
|
||||
}
|
||||
|
||||
[[noreturn]] void SocketMultiplexer::serviceThread(void *)
|
||||
[[noreturn]] void SocketMultiplexer::serviceThread(const void *)
|
||||
{
|
||||
std::vector<IArchNetwork::PollEntry> pfds;
|
||||
IArchNetwork::PollEntry pfd;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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<Desk *>(vdesk);
|
||||
Desk *desk = const_cast<Desk *>(static_cast<const Desk *>(vdesk));
|
||||
desk->m_threadID = GetCurrentThreadId();
|
||||
desk->m_window = nullptr;
|
||||
desk->m_foregroundWindow = nullptr;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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];
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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");
|
||||
|
||||
|
||||
@ -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).
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void glibThread(void *);
|
||||
void glibThread(const void *);
|
||||
gboolean timeoutHandler() const;
|
||||
gboolean initSession();
|
||||
void handleInitSession(GObject *object, GAsyncResult *res);
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user