diff --git a/lib/boinc_cmd.C b/lib/boinc_cmd.C index 39d51b4534..5dd993072c 100644 --- a/lib/boinc_cmd.C +++ b/lib/boinc_cmd.C @@ -129,7 +129,7 @@ void read_password_from_file(char* buf) { FILE* f = fopen("gui_rpc_auth.cfg", "r"); if (!f) return; fgets(buf, 256, f); - int n = strlen(buf); + int n = (int)strlen(buf); // trim CR // diff --git a/lib/diagnostics_win.C b/lib/diagnostics_win.C index efb93eeeb9..d1881aa0ff 100644 --- a/lib/diagnostics_win.C +++ b/lib/diagnostics_win.C @@ -364,8 +364,6 @@ int diagnostics_update_thread_list_NT() { PSYSTEM_PROCESSES_NT4 pProcesses = NULL; PSYSTEM_THREADS pThread = NULL; UINT uiSystemIndex = 0; - UINT uiInternalIndex = 0; - UINT uiInternalCount = 0; HMODULE hKernel32Lib; tOT pOT = NULL; @@ -457,8 +455,6 @@ int diagnostics_update_thread_list_XP() { PSYSTEM_PROCESSES pProcesses = NULL; PSYSTEM_THREADS pThread = NULL; UINT uiSystemIndex = 0; - UINT uiInternalIndex = 0; - UINT uiInternalCount = 0; HMODULE hKernel32Lib; tOT pOT = NULL; @@ -1141,7 +1137,7 @@ int diagnostics_message_monitor_dump() { // // See: http://support.microsoft.com/kb/q173260/ // -UINT WINAPI diagnostics_message_monitor(LPVOID lpParameter) { +UINT WINAPI diagnostics_message_monitor(LPVOID /* lpParameter */) { DWORD dwEvent = NULL; DWORD dwCurrentProcessId = NULL; BOOL bContinue = TRUE; @@ -1794,7 +1790,7 @@ UINT diagnostics_determine_exit_code() { } -UINT WINAPI diagnostics_unhandled_exception_monitor(LPVOID lpParameter) { +UINT WINAPI diagnostics_unhandled_exception_monitor(LPVOID /* lpParameter */) { DWORD dwEvent = NULL; BOOL bContinue = TRUE; BOOL bDebuggerInitialized = FALSE; @@ -1940,7 +1936,7 @@ UINT WINAPI diagnostics_unhandled_exception_monitor(LPVOID lpParameter) { // Force terminate the app letting BOINC know an exception has occurred. if (diagnostics_is_aborted_via_gui()) { - TerminateProcess(GetCurrentProcess(), ERR_ABORTED_VIA_GUI); + TerminateProcess(GetCurrentProcess(), (UINT)ERR_ABORTED_VIA_GUI); } else { TerminateProcess(GetCurrentProcess(), diagnostics_determine_exit_code()); } diff --git a/lib/stackwalker_win.cpp b/lib/stackwalker_win.cpp index a1926c5acb..5ecc27a03a 100644 --- a/lib/stackwalker_win.cpp +++ b/lib/stackwalker_win.cpp @@ -121,7 +121,7 @@ bool DebuggerLoadLibrary( return true; } -BOOL CALLBACK SymbolServerCallbackProc(UINT_PTR ActionCode, ULONG64 CallbackData, ULONG64 UserContext) +BOOL CALLBACK SymbolServerCallbackProc(UINT_PTR ActionCode, ULONG64 CallbackData, ULONG64 /* UserContext */) { BOOL bRetVal = FALSE; PIMAGEHLP_CBA_EVENT pEvent = NULL; @@ -154,7 +154,7 @@ BOOL CALLBACK SymbolServerCallbackProc(UINT_PTR ActionCode, ULONG64 CallbackData return bRetVal; } -BOOL CALLBACK SymRegisterCallbackProc(HANDLE hProcess, ULONG ActionCode, ULONG64 CallbackData, ULONG64 UserContext) +BOOL CALLBACK SymRegisterCallbackProc(HANDLE /* hProcess */, ULONG ActionCode, ULONG64 CallbackData, ULONG64 /* UserContext */) { BOOL bRetVal = FALSE; PIMAGEHLP_CBA_EVENT pEvent = NULL; @@ -187,7 +187,7 @@ BOOL CALLBACK SymRegisterCallbackProc(HANDLE hProcess, ULONG ActionCode, ULONG64 return bRetVal; } -BOOL CALLBACK SymEnumerateModulesProc(LPSTR ModuleName, DWORD64 BaseOfDll, PVOID UserContext) +BOOL CALLBACK SymEnumerateModulesProc(LPSTR /* ModuleName */, DWORD64 BaseOfDll, PVOID /* UserContext */) { IMAGEHLP_MODULE64 Module; char szSymbolType[32]; @@ -514,8 +514,6 @@ int DebuggerInitialize( LPCSTR pszBOINCLocation, LPCSTR pszSymbolStore, BOOL bPr std::string strLocalSymbolStore; std::string strSymbolSearchPath; - static const std::basic_string::size_type npos = -1; - tt = (CHAR*) malloc(sizeof(CHAR) * TTBUFLEN); // Get the temporary buffer if (!tt) return 1; // not enough memory... @@ -558,21 +556,21 @@ int DebuggerInitialize( LPCSTR pszBOINCLocation, LPCSTR pszSymbolStore, BOOL bPr strLocalSymbolStore += tt + std::string("symbols"); // microsoft public symbol server - if (npos == strSymbolSearchPath.find("http://msdl.microsoft.com/download/symbols")) { + if (std::string::npos == strSymbolSearchPath.find("http://msdl.microsoft.com/download/symbols")) { strSymbolSearchPath += std::string( "srv*" ) + strLocalSymbolStore + std::string( "*http://msdl.microsoft.com/download/symbols;" ); } // project symbol server - if ((npos == strSymbolSearchPath.find(pszSymbolStore)) && (0 < strlen(pszSymbolStore))) { + if ((std::string::npos == strSymbolSearchPath.find(pszSymbolStore)) && (0 < strlen(pszSymbolStore))) { strSymbolSearchPath += std::string( "srv*" ) + strLocalSymbolStore + std::string( "*" ) + std::string( pszSymbolStore ) + std::string( ";" ); } // boinc symbol server - if (npos == strSymbolSearchPath.find("http://boinc.berkeley.edu/symstore")) { + if (std::string::npos == strSymbolSearchPath.find("http://boinc.berkeley.edu/symstore")) { strSymbolSearchPath += std::string( "srv*" ) + strLocalSymbolStore + std::string( "*http://boinc.berkeley.edu/symstore;" ); @@ -689,9 +687,9 @@ static void ShowStackRM(HANDLE hThread, CONTEXT& Context) { BOOL bRetVal = FALSE; - int frameNum; - DWORD64 offsetFromSymbol; - DWORD offsetFromLine; + int frameNum = 0; + DWORD64 offsetFromSymbol = 0; + DWORD offsetFromLine = 0; char undName[MAX_SYM_NAME]; char szMsgSymFromAddr[256];