Merge pull request #2629 from BOINC/dpa_warnings

Remove VS2010 compiler warnings.  A few remain.
This commit is contained in:
Kevin Reed 2018-08-14 17:18:42 -05:00 committed by GitHub
commit 0bd858759e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 41 additions and 40 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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<br>", new_results.size());
html_msg += buf;

View File

@ -61,7 +61,7 @@ CACleanupOldBinaries::~CACleanupOldBinaries()
UINT CACleanupOldBinaries::OnExecution()
{
tstring strInstallDirectory;
UINT uiReturnValue = -1;
UINT uiReturnValue;
uiReturnValue = GetProperty( _T("INSTALLDIR"), strInstallDirectory );

View File

@ -65,7 +65,7 @@ UINT CACreateAcctMgrLoginFile::OnExecution()
tstring strAcctMgrLogin;
tstring strAcctMgrPasswordHash;
tstring strAcctMgrLoginFile;
UINT uiReturnValue = -1;
UINT uiReturnValue;
uiReturnValue = GetProperty( _T("DATADIR"), strDataDirectory );

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 );

View File

@ -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 );

View File

@ -64,7 +64,7 @@ UINT CAGrantBOINCAdminsRights::OnExecution()
{
PSID pSid;
tstring strOSVersion;
UINT uiReturnValue = -1;
UINT uiReturnValue;
uiReturnValue = GetProperty( _T("VersionNT"), strOSVersion );

View File

@ -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 );

View File

@ -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 );

View File

@ -64,7 +64,7 @@ UINT CAGrantBOINCProjectsRights::OnExecution()
{
PSID pSid;
tstring strOSVersion;
UINT uiReturnValue = -1;
UINT uiReturnValue;
uiReturnValue = GetProperty( _T("VersionNT"), strOSVersion );

View File

@ -64,7 +64,7 @@ UINT CAGrantBOINCUsersRights::OnExecution()
{
PSID pSid;
tstring strOSVersion;
UINT uiReturnValue = -1;
UINT uiReturnValue;
uiReturnValue = GetProperty( _T("VersionNT"), strOSVersion );

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -63,7 +63,6 @@ CARevokeBOINCAdminsRights::~CARevokeBOINCAdminsRights()
UINT CARevokeBOINCAdminsRights::OnExecution()
{
PSID pSid;
UINT uiReturnValue = -1;
//
// Obtain the SID of the user/group.

View File

@ -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 );

View File

@ -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 );

View File

@ -63,7 +63,6 @@ CARevokeBOINCProjectsRights::~CARevokeBOINCProjectsRights()
UINT CARevokeBOINCProjectsRights::OnExecution()
{
PSID pSid;
UINT uiReturnValue = -1;
//
// Obtain the SID of the user/group.

View File

@ -63,8 +63,6 @@ CARevokeBOINCUsersRights::~CARevokeBOINCUsersRights()
UINT CARevokeBOINCUsersRights::OnExecution()
{
PSID pSid;
UINT uiReturnValue = -1;
//
// Obtain the SID of the user/group.

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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"));

View File

@ -64,7 +64,7 @@ UINT CAValidateRebootRequest::OnExecution()
tstring strRebootRequested;
tstring strRebootPendingFilename;
FILE* fRebootPending;
UINT uiReturnValue = -1;
UINT uiReturnValue;
uiReturnValue = GetProperty( _T("INSTALLDIR"), strInstallDirectory );

View File

@ -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))

View File

@ -117,7 +117,7 @@ int diagnostics_update_process_list( std::vector<BOINC_PROCESS>& 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;
}

View File

@ -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;
}

View File

@ -306,7 +306,6 @@ int VBOX_VM::create_vm() {
CComPtr<IStorageController> pFloppyController;
CComPtr<IBandwidthControl> pBandwidthControl;
CComPtr<IVRDEServer> 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"));

View File

@ -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;