From d9c45936db19c0ec1452f703aee23ae567b275ab Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 20 Jan 2010 19:43:54 +0000 Subject: type cleanup --- src/posix/signalHandler.hpp | 12 ++++++------ src/signalController.cpp | 2 +- src/signalController.h | 5 ++--- src/win32/signalHandler.hpp | 10 +++++----- src/win32/winService.cpp | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/posix/signalHandler.hpp b/src/posix/signalHandler.hpp index 2b4f8f6..8b3494e 100644 --- a/src/posix/signalHandler.hpp +++ b/src/posix/signalHandler.hpp @@ -37,37 +37,37 @@ #include #include -int SigIntHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int SigIntHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "SIG-Int caught, exiting"; return 1; } -int SigQuitHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int SigQuitHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "SIG-Quit caught, exiting"; return 1; } -int SigHupHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int SigHupHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "SIG-Hup caught"; return 0; } -int SigTermHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int SigTermHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "SIG-Term caught, exiting"; return 1; } -int SigUsr1Handler(const SigNum& /*sig*/, const std::string& /*msg*/) +int SigUsr1Handler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "SIG-Usr1 caught"; return 0; } -int SigUsr2Handler(const SigNum& /*sig*/, const std::string& /*msg*/) +int SigUsr2Handler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "SIG-Usr2 caught"; return 0; diff --git a/src/signalController.cpp b/src/signalController.cpp index c690608..f20b695 100644 --- a/src/signalController.cpp +++ b/src/signalController.cpp @@ -53,7 +53,7 @@ SignalController& SignalController::instance() return *inst; } -int SigErrorHandler(const SigNum& /*sig*/, const std::string& msg) +int SigErrorHandler(int /*sig*/, const std::string& msg) { AnytunError::throwErr() << msg; diff --git a/src/signalController.h b/src/signalController.h index 7acf4a3..fdc778a 100644 --- a/src/signalController.h +++ b/src/signalController.h @@ -48,8 +48,7 @@ typedef void DaemonService; #define SIGERROR -1 #define SIGUNKNOWN -2 -typedef int SigNum; -typedef boost::function SignalHandler; +typedef boost::function SignalHandler; typedef enum { CALLB_RUNNING, CALLB_STOPPING } CallbackType; typedef boost::function ServiceCallback; @@ -84,7 +83,7 @@ private: Mutex sigQueueMutex; Semaphore sigQueueSem; - typedef std::map HandlerMap; + typedef std::map HandlerMap; HandlerMap handler; typedef std::map CallbackMap; CallbackMap callbacks; diff --git a/src/win32/signalHandler.hpp b/src/win32/signalHandler.hpp index aeafcb4..fb0c7e6 100644 --- a/src/win32/signalHandler.hpp +++ b/src/win32/signalHandler.hpp @@ -35,31 +35,31 @@ #include -int CtrlCHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int CtrlCHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "CTRL-C Event received, exitting"; return 1; } -int CtrlBreakHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int CtrlBreakHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "CTRL-Break Event received, ignoring"; return 0; } -int CtrlCloseHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int CtrlCloseHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "Close Event received, exitting"; return 1; } -int CtrlLogoffHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int CtrlLogoffHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "LogOff Event received, exitting"; return 1; } -int CtrlShutdownHandler(const SigNum& /*sig*/, const std::string& /*msg*/) +int CtrlShutdownHandler(int /*sig*/, const std::string& /*msg*/) { cLog.msg(Log::PRIO_NOTICE) << "Shutdown Event received, exitting"; return 1; diff --git a/src/win32/winService.cpp b/src/win32/winService.cpp index 4e324b2..f796fcf 100644 --- a/src/win32/winService.cpp +++ b/src/win32/winService.cpp @@ -130,7 +130,7 @@ VOID WINAPI WinService::ctrlHandler(DWORD dwCtrl) gSignalController.inject(dwCtrl); } -int WinService::handleCtrlSignal(const SigNum& sig, const std::string& msg) +int WinService::handleCtrlSignal(int sig, const std::string& msg) { switch(sig) { case SERVICE_CONTROL_STOP: { -- cgit v1.2.3