From: Oliver Kurth Date: Tue, 6 Mar 2018 18:38:42 +0000 (-0800) Subject: Compilation fixes to build Tools with VS2015 X-Git-Tag: stable-10.3.0~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d585ee8fcc4135d6d52fdc38ec2e0ca747663bf7;p=thirdparty%2Fopen-vm-tools.git Compilation fixes to build Tools with VS2015 This change consists of fixing warnings/errors as a result of building Tools with VS2015. --- diff --git a/open-vm-tools/lib/appUtil/appUtil.c b/open-vm-tools/lib/appUtil/appUtil.c index 9270d7d1d..5b370319c 100644 --- a/open-vm-tools/lib/appUtil/appUtil.c +++ b/open-vm-tools/lib/appUtil/appUtil.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2016 VMware, Inc. All rights reserved. + * Copyright (C) 2008-2017 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -22,12 +22,10 @@ * Utility functions for guest applications. */ -#include "appUtil.h" #include #include -#include "vmware.h" #include "appUtil.h" #include "debug.h" #include "rpcout.h" diff --git a/open-vm-tools/lib/include/system.h b/open-vm-tools/lib/include/system.h index 785140172..c186fa7dc 100644 --- a/open-vm-tools/lib/include/system.h +++ b/open-vm-tools/lib/include/system.h @@ -68,8 +68,6 @@ typedef struct MonListNode { #define VM_SERVICE_STATE_UNKNOWN 0xffffffff BOOL System_SetProcessPrivilege(wchar_t *privName, Bool enable); -int32 System_GetSPVersion(void); -Bool System_IsLoginScreenActive(void); Bool System_IsScreenSaverActive(void); Bool System_IsScreenSaverRunning(void); Bool System_IsSecureDesktopActive(void); diff --git a/open-vm-tools/services/plugins/vix/vixToolsEnvVars.c b/open-vm-tools/services/plugins/vix/vixToolsEnvVars.c index cfb5006ee..2167d0c4c 100644 --- a/open-vm-tools/services/plugins/vix/vixToolsEnvVars.c +++ b/open-vm-tools/services/plugins/vix/vixToolsEnvVars.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2016 VMware, Inc. All rights reserved. + * Copyright (C) 2010-2017 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -54,7 +54,7 @@ struct VixToolsEnvIterator { wchar_t *currEnvVar; } eb; /* Used when envType is VIX_TOOLS_ENV_TYPE_ENVIRON. */ - wchar_t **environ; + wchar_t **env; } data; #else char **environ; @@ -130,7 +130,7 @@ VixToolsNewEnvIterator(void *userToken, // IN * or system's environment made after the process is running? */ it->envType = VIX_TOOLS_ENV_TYPE_ENVIRON; - it->data.environ = _wenviron; + it->data.env = _wenviron; } #elif defined(__APPLE__) it->environ = *_NSGetEnviron(); @@ -184,11 +184,11 @@ VixToolsGetNextEnvVar(VixToolsEnvIterator *envItr) // IN while(*envItr->data.eb.currEnvVar++); } } else if (VIX_TOOLS_ENV_TYPE_ENVIRON == envItr->envType) { - if (NULL == *envItr->data.environ) { + if (NULL == *envItr->data.env) { envVar = NULL; } else { - envVar = Unicode_AllocWithUTF16(*envItr->data.environ); - envItr->data.environ++; + envVar = Unicode_AllocWithUTF16(*envItr->data.env); + envItr->data.env++; } } else { /* Is someone using uninitialized memory? */ @@ -391,7 +391,7 @@ VixToolsDestroyUserEnvironment(VixToolsUserEnvironment *env) // IN */ VixError -VixToolsEnvironToEnvBlock(char const * const *environ, // IN: UTF-8 +VixToolsEnvironToEnvBlock(char const * const *env, // IN: UTF-8 wchar_t **envBlock) // OUT { VixError err; @@ -401,15 +401,15 @@ VixToolsEnvironToEnvBlock(char const * const *environ, // IN: UTF-8 DynBuf_Init(&buf); - if ((NULL == environ) || (NULL == envBlock)) { + if ((NULL == env) || (NULL == envBlock)) { err = VIX_E_FAIL; goto abort; } *envBlock = NULL; - while (NULL != *environ) { - wchar_t *envVar = Unicode_GetAllocUTF16(*environ); + while (NULL != *env) { + wchar_t *envVar = Unicode_GetAllocUTF16(*env); res = DynBuf_Append(&buf, envVar, (wcslen(envVar) + 1) * sizeof(*envVar)); @@ -418,7 +418,7 @@ VixToolsEnvironToEnvBlock(char const * const *environ, // IN: UTF-8 err = VIX_E_OUT_OF_MEMORY; goto abort; } - environ++; + env++; } /* @@ -463,21 +463,21 @@ abort: */ VixError -VixToolsValidateEnviron(char const * const *environ) // IN +VixToolsValidateEnviron(char const * const *env) // IN { - if (NULL == environ) { + if (NULL == env) { return VIX_E_FAIL; } - while (NULL != *environ) { + while (NULL != *env) { /* * Each string should contain at least one '=', to delineate between * the name and the value. */ - if (NULL == Str_Strchr(*environ, '=')) { + if (NULL == Str_Strchr(*env, '=')) { return VIX_E_INVALID_ARG; } - environ++; + env++; } return VIX_OK; diff --git a/open-vm-tools/services/plugins/vix/vixToolsInt.h b/open-vm-tools/services/plugins/vix/vixToolsInt.h index 4f43121dc..840792394 100644 --- a/open-vm-tools/services/plugins/vix/vixToolsInt.h +++ b/open-vm-tools/services/plugins/vix/vixToolsInt.h @@ -143,7 +143,7 @@ char *VixToolsGetEnvFromUserEnvironment(const VixToolsUserEnvironment *env, void VixToolsDestroyUserEnvironment(VixToolsUserEnvironment *env); -VixError VixToolsValidateEnviron(char const * const *environ); +VixError VixToolsValidateEnviron(char const * const *env); char *VixToolsGetEnvVarFromEnvBlock(const wchar_t *envBlock, const char *envVarName); @@ -160,7 +160,7 @@ VixError VixToolsGetEnvBlock(void *userToken, Bool VixToolsDestroyEnvironmentBlock(wchar_t *envBlock); -VixError VixToolsEnvironToEnvBlock(char const * const *environ, +VixError VixToolsEnvironToEnvBlock(char const * const *env, wchar_t **envBlock); VixError VixToolsGetUserTmpDir(void *userToken,