diff --git a/client/acct_mgr.cpp b/client/acct_mgr.cpp index 511f0c64f3..49810413a9 100644 --- a/client/acct_mgr.cpp +++ b/client/acct_mgr.cpp @@ -481,8 +481,11 @@ static inline bool is_weak_auth(const char* auth) { return (strstr(auth, "_") != NULL); } +#ifdef SIM +void ACCT_MGR_OP::handle_reply(int ) { +} +#else void ACCT_MGR_OP::handle_reply(int http_op_retval) { -#ifndef SIM unsigned int i; int retval; bool verified; @@ -804,8 +807,8 @@ void ACCT_MGR_OP::handle_reply(int http_op_retval) { gstate.acct_mgr_info.user_keywords = ami.user_keywords; gstate.acct_mgr_info.write_info(); gstate.set_client_state_dirty("account manager RPC"); -#endif } +#endif // write AM info to files. // This is done after each AM RPC. diff --git a/client/app.cpp b/client/app.cpp index 640f8175e7..c5dd8d0de6 100644 --- a/client/app.cpp +++ b/client/app.cpp @@ -587,8 +587,12 @@ bool ACTIVE_TASK_SET::is_slot_dir_in_use(char* dir) { // either find an unused an empty slot dir, // or create a new slot dir if needed // +#ifdef SIM +int ACTIVE_TASK::get_free_slot(RESULT*) { + return 0; +} +#else int ACTIVE_TASK::get_free_slot(RESULT* rp) { -#ifndef SIM int j, retval; char path[MAXPATHLEN]; @@ -636,9 +640,9 @@ int ACTIVE_TASK::get_free_slot(RESULT* rp) { "[slot] assigning slot %d to %s", j, rp->name ); } -#endif return 0; } +#endif bool ACTIVE_TASK_SET::slot_taken(int slot) { unsigned int i; diff --git a/client/sim.cpp b/client/sim.cpp index b65c790612..607a9f9701 100644 --- a/client/sim.cpp +++ b/client/sim.cpp @@ -448,7 +448,7 @@ bool CLIENT_STATE::simulate_rpc(PROJECT* p) { decrement_request(rp); } - njobs += new_results.size(); + njobs += (int)new_results.size(); msg_printf(0, MSG_INFO, "Got %lu tasks", new_results.size()); sprintf(buf, "got %lu tasks
", new_results.size()); html_msg += buf; diff --git a/clientsetup/win/CACleanupOldBinaries.cpp b/clientsetup/win/CACleanupOldBinaries.cpp index 6ee69177c3..21138e6527 100644 --- a/clientsetup/win/CACleanupOldBinaries.cpp +++ b/clientsetup/win/CACleanupOldBinaries.cpp @@ -61,7 +61,7 @@ CACleanupOldBinaries::~CACleanupOldBinaries() UINT CACleanupOldBinaries::OnExecution() { tstring strInstallDirectory; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("INSTALLDIR"), strInstallDirectory ); diff --git a/clientsetup/win/CACreateAcctMgrLoginFile.cpp b/clientsetup/win/CACreateAcctMgrLoginFile.cpp index ef93d1cf0c..d506ea718d 100644 --- a/clientsetup/win/CACreateAcctMgrLoginFile.cpp +++ b/clientsetup/win/CACreateAcctMgrLoginFile.cpp @@ -65,7 +65,7 @@ UINT CACreateAcctMgrLoginFile::OnExecution() tstring strAcctMgrLogin; tstring strAcctMgrPasswordHash; tstring strAcctMgrLoginFile; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("DATADIR"), strDataDirectory ); diff --git a/clientsetup/win/CACreateBOINCAccounts.cpp b/clientsetup/win/CACreateBOINCAccounts.cpp index 46577c9322..e420856b4b 100644 --- a/clientsetup/win/CACreateBOINCAccounts.cpp +++ b/clientsetup/win/CACreateBOINCAccounts.cpp @@ -79,7 +79,7 @@ UINT CACreateBOINCAccounts::OnExecution() BOOL bBOINCProjectAccountCreated = FALSE; BOOL bBOINCMasterAccountModified = FALSE; BOOL bBOINCProjectAccountModified = FALSE; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("BOINC_MASTER_USERNAME"), strBOINCMasterAccountUsername ); if ( uiReturnValue ) return uiReturnValue; diff --git a/clientsetup/win/CACreateBOINCGroups.cpp b/clientsetup/win/CACreateBOINCGroups.cpp index 68a6939693..2627540276 100644 --- a/clientsetup/win/CACreateBOINCGroups.cpp +++ b/clientsetup/win/CACreateBOINCGroups.cpp @@ -64,7 +64,7 @@ UINT CACreateBOINCGroups::OnExecution() { NET_API_STATUS nasReturnValue; DWORD dwParameterError; - UINT uiReturnValue = -1; + UINT uiReturnValue; BOOL bBOINCAdminsCreated = FALSE; BOOL bBOINCUsersCreated = FALSE; BOOL bBOINCProjectsCreated = FALSE; diff --git a/clientsetup/win/CACreateClientAuthFile.cpp b/clientsetup/win/CACreateClientAuthFile.cpp index 9ca324c9fd..91d2a0eb63 100644 --- a/clientsetup/win/CACreateClientAuthFile.cpp +++ b/clientsetup/win/CACreateClientAuthFile.cpp @@ -69,8 +69,7 @@ UINT CACreateClientAuthFile::OnExecution() tstring strVersionNT; struct _stat buf; TCHAR szMessage[2048]; - UINT uiReturnValue = -1; - + UINT uiReturnValue; uiReturnValue = GetProperty( _T("DATADIR"), strDataDirectory ); if ( uiReturnValue ) return uiReturnValue; diff --git a/clientsetup/win/CADeleteBOINCAccounts.cpp b/clientsetup/win/CADeleteBOINCAccounts.cpp index 0a07fcd30a..4b574d3f7c 100644 --- a/clientsetup/win/CADeleteBOINCAccounts.cpp +++ b/clientsetup/win/CADeleteBOINCAccounts.cpp @@ -66,7 +66,7 @@ UINT CADeleteBOINCAccounts::OnExecution() tstring strBOINCMasterAccountUsername; tstring strBOINCProjectAccountUsername; NET_API_STATUS nasReturnValue; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("BOINC_MASTER_USERNAME"), strBOINCMasterAccountUsername ); if ( uiReturnValue ) return uiReturnValue; diff --git a/clientsetup/win/CAGetAdministratorsGroupName.cpp b/clientsetup/win/CAGetAdministratorsGroupName.cpp index b7b19d9469..a38b9db148 100644 --- a/clientsetup/win/CAGetAdministratorsGroupName.cpp +++ b/clientsetup/win/CAGetAdministratorsGroupName.cpp @@ -64,7 +64,7 @@ UINT CAGetAdministratorsGroupName::OnExecution() tstring strGroupAlias; WCHAR szName[UNLEN+1]; DWORD cchName = UNLEN; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("GROUPALIAS_ADMINISTRATORS"), strGroupAlias ); diff --git a/clientsetup/win/CAGetUsersGroupName.cpp b/clientsetup/win/CAGetUsersGroupName.cpp index a94b51aafe..4debe2b8c2 100644 --- a/clientsetup/win/CAGetUsersGroupName.cpp +++ b/clientsetup/win/CAGetUsersGroupName.cpp @@ -65,7 +65,7 @@ UINT CAGetUsersGroupName::OnExecution() tstring strGroupAlias; WCHAR szName[UNLEN+1]; DWORD cchName = UNLEN; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("GROUPALIAS_USERS"), strGroupAlias ); diff --git a/clientsetup/win/CAGrantBOINCAdminsRights.cpp b/clientsetup/win/CAGrantBOINCAdminsRights.cpp index dfa1c4a41a..fc98e75e55 100644 --- a/clientsetup/win/CAGrantBOINCAdminsRights.cpp +++ b/clientsetup/win/CAGrantBOINCAdminsRights.cpp @@ -64,7 +64,7 @@ UINT CAGrantBOINCAdminsRights::OnExecution() { PSID pSid; tstring strOSVersion; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("VersionNT"), strOSVersion ); diff --git a/clientsetup/win/CAGrantBOINCMasterRights.cpp b/clientsetup/win/CAGrantBOINCMasterRights.cpp index 76dca4fe1e..cae8669757 100644 --- a/clientsetup/win/CAGrantBOINCMasterRights.cpp +++ b/clientsetup/win/CAGrantBOINCMasterRights.cpp @@ -65,7 +65,7 @@ UINT CAGrantBOINCMasterRights::OnExecution() PSID pSid; tstring strBOINCMasterAccountUsername; tstring strOSVersion; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("BOINC_MASTER_USERNAME"), strBOINCMasterAccountUsername ); diff --git a/clientsetup/win/CAGrantBOINCProjectRights.cpp b/clientsetup/win/CAGrantBOINCProjectRights.cpp index 26e02ee3aa..90eb761b1c 100644 --- a/clientsetup/win/CAGrantBOINCProjectRights.cpp +++ b/clientsetup/win/CAGrantBOINCProjectRights.cpp @@ -65,7 +65,7 @@ UINT CAGrantBOINCProjectRights::OnExecution() PSID pSid; tstring strBOINCProjectAccountUsername; tstring strOSVersion; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("BOINC_PROJECT_USERNAME"), strBOINCProjectAccountUsername ); diff --git a/clientsetup/win/CAGrantBOINCProjectsRights.cpp b/clientsetup/win/CAGrantBOINCProjectsRights.cpp index a5ebfc0f21..a103838a27 100644 --- a/clientsetup/win/CAGrantBOINCProjectsRights.cpp +++ b/clientsetup/win/CAGrantBOINCProjectsRights.cpp @@ -64,7 +64,7 @@ UINT CAGrantBOINCProjectsRights::OnExecution() { PSID pSid; tstring strOSVersion; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("VersionNT"), strOSVersion ); diff --git a/clientsetup/win/CAGrantBOINCUsersRights.cpp b/clientsetup/win/CAGrantBOINCUsersRights.cpp index 6d5060f2ca..018ff621d8 100644 --- a/clientsetup/win/CAGrantBOINCUsersRights.cpp +++ b/clientsetup/win/CAGrantBOINCUsersRights.cpp @@ -64,7 +64,7 @@ UINT CAGrantBOINCUsersRights::OnExecution() { PSID pSid; tstring strOSVersion; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("VersionNT"), strOSVersion ); diff --git a/clientsetup/win/CALaunchBOINCManager.cpp b/clientsetup/win/CALaunchBOINCManager.cpp index 622eb2be4b..2e0c47c36f 100644 --- a/clientsetup/win/CALaunchBOINCManager.cpp +++ b/clientsetup/win/CALaunchBOINCManager.cpp @@ -63,7 +63,7 @@ UINT CALaunchBOINCManager::OnExecution() { tstring strInstallDirectory; tstring strBuffer; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("INSTALLDIR"), strInstallDirectory ); if ( uiReturnValue ) return uiReturnValue; diff --git a/clientsetup/win/CALaunchBOINCTray.cpp b/clientsetup/win/CALaunchBOINCTray.cpp index 6017e031ca..6aa5b8f013 100644 --- a/clientsetup/win/CALaunchBOINCTray.cpp +++ b/clientsetup/win/CALaunchBOINCTray.cpp @@ -63,7 +63,7 @@ UINT CALaunchBOINCTray::OnExecution() { tstring strInstallDirectory; tstring strBuffer; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("INSTALLDIR"), strInstallDirectory ); if ( uiReturnValue ) return uiReturnValue; diff --git a/clientsetup/win/CARestorePermissionBOINCData.cpp b/clientsetup/win/CARestorePermissionBOINCData.cpp index 6023c0f552..89fc07f131 100644 --- a/clientsetup/win/CARestorePermissionBOINCData.cpp +++ b/clientsetup/win/CARestorePermissionBOINCData.cpp @@ -69,7 +69,7 @@ UINT CARestorePermissionBOINCData::OnExecution() EXPLICIT_ACCESS ea[2]; ULONG ulEntries = 0; tstring strBOINCDataDirectory; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("DATADIR"), strBOINCDataDirectory ); if ( uiReturnValue ) return uiReturnValue; diff --git a/clientsetup/win/CARevokeBOINCAdminsRights.cpp b/clientsetup/win/CARevokeBOINCAdminsRights.cpp index 292af5c734..9f36130c96 100644 --- a/clientsetup/win/CARevokeBOINCAdminsRights.cpp +++ b/clientsetup/win/CARevokeBOINCAdminsRights.cpp @@ -63,7 +63,6 @@ CARevokeBOINCAdminsRights::~CARevokeBOINCAdminsRights() UINT CARevokeBOINCAdminsRights::OnExecution() { PSID pSid; - UINT uiReturnValue = -1; // // Obtain the SID of the user/group. diff --git a/clientsetup/win/CARevokeBOINCMasterRights.cpp b/clientsetup/win/CARevokeBOINCMasterRights.cpp index 37cfbf7ba1..c9510e62a2 100644 --- a/clientsetup/win/CARevokeBOINCMasterRights.cpp +++ b/clientsetup/win/CARevokeBOINCMasterRights.cpp @@ -65,7 +65,7 @@ UINT CARevokeBOINCMasterRights::OnExecution() PSID pSid; tstring strBOINCMasterAccountUsername; tstring strOSVersion; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("BOINC_MASTER_USERNAME"), strBOINCMasterAccountUsername ); diff --git a/clientsetup/win/CARevokeBOINCProjectRights.cpp b/clientsetup/win/CARevokeBOINCProjectRights.cpp index d5c97e513a..e44ae12e86 100644 --- a/clientsetup/win/CARevokeBOINCProjectRights.cpp +++ b/clientsetup/win/CARevokeBOINCProjectRights.cpp @@ -65,7 +65,7 @@ UINT CARevokeBOINCProjectRights::OnExecution() PSID pSid; tstring strBOINCProjectAccountUsername; tstring strOSVersion; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("BOINC_PROJECT_USERNAME"), strBOINCProjectAccountUsername ); diff --git a/clientsetup/win/CARevokeBOINCProjectsRights.cpp b/clientsetup/win/CARevokeBOINCProjectsRights.cpp index 3858ac349a..b5596d9fa4 100644 --- a/clientsetup/win/CARevokeBOINCProjectsRights.cpp +++ b/clientsetup/win/CARevokeBOINCProjectsRights.cpp @@ -63,7 +63,6 @@ CARevokeBOINCProjectsRights::~CARevokeBOINCProjectsRights() UINT CARevokeBOINCProjectsRights::OnExecution() { PSID pSid; - UINT uiReturnValue = -1; // // Obtain the SID of the user/group. diff --git a/clientsetup/win/CARevokeBOINCUsersRights.cpp b/clientsetup/win/CARevokeBOINCUsersRights.cpp index 5244f1946d..a4ceb30b09 100644 --- a/clientsetup/win/CARevokeBOINCUsersRights.cpp +++ b/clientsetup/win/CARevokeBOINCUsersRights.cpp @@ -63,8 +63,6 @@ CARevokeBOINCUsersRights::~CARevokeBOINCUsersRights() UINT CARevokeBOINCUsersRights::OnExecution() { PSID pSid; - UINT uiReturnValue = -1; - // // Obtain the SID of the user/group. diff --git a/clientsetup/win/CASetPermissionBOINC.cpp b/clientsetup/win/CASetPermissionBOINC.cpp index 7bd1b4ce71..9fab05670e 100644 --- a/clientsetup/win/CASetPermissionBOINC.cpp +++ b/clientsetup/win/CASetPermissionBOINC.cpp @@ -74,7 +74,7 @@ UINT CASetPermissionBOINC::OnExecution() tstring strBOINCInstallDirectory; tstring strEnableProtectedApplicationExecution; tstring strEnableUseByAllUsers; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("BOINC_ADMINS_GROUPNAME"), strBOINCAdminsGroupAlias ); if ( uiReturnValue ) return uiReturnValue; diff --git a/clientsetup/win/CASetPermissionBOINCData.cpp b/clientsetup/win/CASetPermissionBOINCData.cpp index 2e03c10201..029fbe8157 100644 --- a/clientsetup/win/CASetPermissionBOINCData.cpp +++ b/clientsetup/win/CASetPermissionBOINCData.cpp @@ -77,7 +77,7 @@ UINT CASetPermissionBOINCData::OnExecution() tstring strBOINCDataDirectory; tstring strEnableProtectedApplicationExecution; tstring strEnableUseByAllUsers; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("UserSID"), strUserSID ); if ( uiReturnValue ) return uiReturnValue; diff --git a/clientsetup/win/CASetPermissionBOINCDataProjects.cpp b/clientsetup/win/CASetPermissionBOINCDataProjects.cpp index 0f9c0c8101..b424e5c997 100644 --- a/clientsetup/win/CASetPermissionBOINCDataProjects.cpp +++ b/clientsetup/win/CASetPermissionBOINCDataProjects.cpp @@ -76,7 +76,7 @@ UINT CASetPermissionBOINCDataProjects::OnExecution() tstring strBOINCDataProjectsDirectory; tstring strEnableProtectedApplicationExecution; tstring strEnableUseByAllUsers; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("BOINC_ADMINS_GROUPNAME"), strBOINCAdminsGroupAlias ); if ( uiReturnValue ) return uiReturnValue; diff --git a/clientsetup/win/CASetPermissionBOINCDataSlots.cpp b/clientsetup/win/CASetPermissionBOINCDataSlots.cpp index ba11770c1c..d3f7507f88 100644 --- a/clientsetup/win/CASetPermissionBOINCDataSlots.cpp +++ b/clientsetup/win/CASetPermissionBOINCDataSlots.cpp @@ -76,7 +76,7 @@ UINT CASetPermissionBOINCDataSlots::OnExecution() tstring strBOINCDataSlotsDirectory; tstring strEnableProtectedApplicationExecution; tstring strEnableUseByAllUsers; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("BOINC_ADMINS_GROUPNAME"), strBOINCAdminsGroupAlias ); if ( uiReturnValue ) return uiReturnValue; diff --git a/clientsetup/win/CAShutdownBOINCManager.cpp b/clientsetup/win/CAShutdownBOINCManager.cpp index 66e9df45c5..2580996a12 100644 --- a/clientsetup/win/CAShutdownBOINCManager.cpp +++ b/clientsetup/win/CAShutdownBOINCManager.cpp @@ -67,7 +67,6 @@ UINT CAShutdownBOINCManager::OnExecution() TCHAR szWindowTitle[256]; LRESULT lrReturnValue = NULL; UINT uiLoopCounter = 0; - UINT uiReturn = -1; const UINT WM_TASKBARSHUTDOWN = ::RegisterWindowMessage(_T("TaskbarShutdown")); diff --git a/clientsetup/win/CAValidateRebootRequest.cpp b/clientsetup/win/CAValidateRebootRequest.cpp index 1edfd2774a..a375b41f10 100644 --- a/clientsetup/win/CAValidateRebootRequest.cpp +++ b/clientsetup/win/CAValidateRebootRequest.cpp @@ -64,7 +64,7 @@ UINT CAValidateRebootRequest::OnExecution() tstring strRebootRequested; tstring strRebootPendingFilename; FILE* fRebootPending; - UINT uiReturnValue = -1; + UINT uiReturnValue; uiReturnValue = GetProperty( _T("INSTALLDIR"), strInstallDirectory ); diff --git a/clientsetup/win/aclmgmt.cpp b/clientsetup/win/aclmgmt.cpp index 71e37dc05e..76c9453f16 100644 --- a/clientsetup/win/aclmgmt.cpp +++ b/clientsetup/win/aclmgmt.cpp @@ -184,7 +184,6 @@ RemovePrincipalFromACL ( ACCESS_DENIED_ACE *accessDeniedAce = NULL; SYSTEM_AUDIT_ACE *systemAuditAce = NULL; PSID principalSID = NULL; - DWORD returnValue = 0; ACE_HEADER *aceHeader = NULL; if (!GetAccountSid(NULL, Principal, &principalSID)) diff --git a/clientsetup/win/terminate.cpp b/clientsetup/win/terminate.cpp index 0d15a53ef1..7bc5ed9141 100644 --- a/clientsetup/win/terminate.cpp +++ b/clientsetup/win/terminate.cpp @@ -117,7 +117,7 @@ int diagnostics_update_process_list( std::vector& ps ) { tstring downcase_string(tstring& orig) { tstring retval = orig; for (size_t i=0; i < retval.length(); i++) { - retval[i] = tolower(retval[i]); + retval[i] = (wchar_t)tolower(retval[i]); } return retval; } diff --git a/lib/parse.h b/lib/parse.h index 896d76d408..94a881805f 100644 --- a/lib/parse.h +++ b/lib/parse.h @@ -70,7 +70,7 @@ struct XML_PARSER { if (--len <= 0) { return XML_PARSE_OVERFLOW; } - *buf++ = c; + *buf++ = (char)c; } } @@ -144,7 +144,7 @@ struct XML_PARSER { if (retval == XML_PARSE_OVERFLOW) return retval; if (retval == XML_PARSE_COMMENT) continue; } else { - buf[0] = c; + buf[0] = (char)c; retval = copy_until_tag(buf+1, len-1); if (retval != XML_PARSE_DATA) return retval; } diff --git a/samples/vboxwrapper/vbox_mscom_impl.cpp b/samples/vboxwrapper/vbox_mscom_impl.cpp index e7cb7eb241..8d4b08231d 100644 --- a/samples/vboxwrapper/vbox_mscom_impl.cpp +++ b/samples/vboxwrapper/vbox_mscom_impl.cpp @@ -306,7 +306,6 @@ int VBOX_VM::create_vm() { CComPtr pFloppyController; CComPtr pBandwidthControl; CComPtr pVRDEServer; - ULONG lOHCICtrls = 0; bool disable_acceleration = false; string virtual_machine_slot_directory; string default_interface; @@ -459,6 +458,7 @@ int VBOX_VM::create_vm() { pUSBContoller->put_Enabled(FALSE); } #else + ULONG lOHCICtrls = 0; rc = pMachine->GetUSBControllerCountByType(USBControllerType_OHCI, &lOHCICtrls); if (SUCCEEDED(rc) && lOHCICtrls) { pMachine->RemoveUSBController(CComBSTR("OHCI")); diff --git a/sched/edf_sim.cpp b/sched/edf_sim.cpp index 3015570ad4..130885bed9 100644 --- a/sched/edf_sim.cpp +++ b/sched/edf_sim.cpp @@ -58,9 +58,10 @@ using std::vector; #define TIME_SCALE 1 //#define TIME_SCALE 3600 -static void log_msg(int level, const char* format, ...) { #ifdef SIM +static void log_msg(int, const char* format, ...) { #else +static void log_msg(int level, const char* format, ...) { switch(level) { case SUMMARY: if (!config.debug_send) return;