diff --git a/api/boinc_api.C b/api/boinc_api.C index cb0fe6489f..14b534bcf2 100644 --- a/api/boinc_api.C +++ b/api/boinc_api.C @@ -321,7 +321,7 @@ int boinc_thread_cpu_time(double& cpu, double& ws) { #ifdef _WIN32 static void CALLBACK on_timer(UINT uTimerID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) { #else -static RETSIGTYPE on_timer(int a) { +static void on_timer(int a) { #endif if (!ready_to_checkpoint) { diff --git a/lib/error_numbers.h b/lib/error_numbers.h index a3c86b7ed1..8af00fa5be 100755 --- a/lib/error_numbers.h +++ b/lib/error_numbers.h @@ -126,3 +126,5 @@ #define ERR_SOCKS_CONN_REFUSED -175 #define ERR_TIMER_INIT -176 #define ERR_RSC_LIMIT_EXCEEDED -177 +#define ERR_INVALID_PARAM -178 +#define ERR_SIGNAL_OP -179 diff --git a/lib/exception.C b/lib/exception.C index bac210db69..11714ea621 100644 --- a/lib/exception.C +++ b/lib/exception.C @@ -32,20 +32,19 @@ using namespace std; #include "error_numbers.h" -// BOINC Base Exception Class Implementation -// +const char* boinc_base_exception::ErrorType() { + return "BOINC Exception"; +} -const char * boinc_base_exception::ErrorType() - { return "BOINC Exception"; } +const char * boinc_base_exception::ErrorMessage() { + return "Unknown Exception"; +} -const char * boinc_base_exception::ErrorMessage() - { return "Unknown Exception"; } +long boinc_base_exception::ErrorValue() { + return -1; +} -long boinc_base_exception::ErrorValue() - { return -1; } - -const char * boinc_base_exception::what() -{ +const char * boinc_base_exception::what() { m_strErrorBuffer.empty(); memset(m_szConversionBuffer, '\0', sizeof(m_szConversionBuffer)); @@ -80,32 +79,46 @@ const char * boinc_base_exception::what() // BOINC Base Runtime Exception Class Implementation // -const char * boinc_runtime_base_exception::ErrorType() - { return "BOINC Runtime Exception"; } +const char * boinc_runtime_base_exception::ErrorType() { + return "BOINC Runtime Exception"; +} -const char * boinc_runtime_base_exception::ErrorMessage() - { return "Unknown Runtime Exception"; } +const char * boinc_runtime_base_exception::ErrorMessage() { + return "Unknown Runtime Exception"; +} // BOINC Runtime Exceptions // -const char * boinc_out_of_memory_exception::ErrorMessage() - { return "Out Of Memory"; } -long boinc_out_of_memory_exception::ErrorValue() - { return ERR_MALLOC; } +const char * boinc_out_of_memory_exception::ErrorMessage() { + return "Out Of Memory"; +} -const char * boinc_invalid_parameter_exception::ErrorMessage() - { return "Invalid Parameter"; } -long boinc_invalid_parameter_exception::ErrorValue() - { return -1001; } +long boinc_out_of_memory_exception::ErrorValue() { + return ERR_MALLOC; +} + +const char * boinc_invalid_parameter_exception::ErrorMessage() { + return "Invalid Parameter"; +} + +long boinc_invalid_parameter_exception::ErrorValue() { + return ERR_INVALID_PARAM; +} -const char * boinc_file_operation_exception::ErrorMessage() - { return "File Operation Failure"; } -long boinc_file_operation_exception::ErrorValue() - { return -1100; } +const char * boinc_file_operation_exception::ErrorMessage() { + return "File Operation Failure"; +} -const char * boinc_signal_operation_exception::ErrorMessage() - { return "Signal Operation Failure"; } -long boinc_signal_operation_exception::ErrorValue() - { return -1101; } +long boinc_file_operation_exception::ErrorValue() { + return ERR_FOPEN; +} + +const char * boinc_signal_operation_exception::ErrorMessage() { + return "Signal Operation Failure"; +} + +long boinc_signal_operation_exception::ErrorValue() { + return ERR_SIGNAL_OP; +}