]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Compilation fixes to build Tools with VS2015
authorOliver Kurth <okurth@vmware.com>
Tue, 6 Mar 2018 18:38:42 +0000 (10:38 -0800)
committerOliver Kurth <okurth@vmware.com>
Tue, 6 Mar 2018 18:38:42 +0000 (10:38 -0800)
This change consists of fixing warnings/errors as a result of building Tools with VS2015.

open-vm-tools/lib/appUtil/appUtil.c
open-vm-tools/lib/include/system.h
open-vm-tools/services/plugins/vix/vixToolsEnvVars.c
open-vm-tools/services/plugins/vix/vixToolsInt.h

index 9270d7d1dba22c8e449fcfaa525071809166e31c..5b370319c6b31753e7cdae074d8f8d15cda74415 100644 (file)
@@ -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
  *    Utility functions for guest applications.
  */
 
-#include "appUtil.h"
 
 #include <stdlib.h>
 #include <string.h>
 
-#include "vmware.h"
 #include "appUtil.h"
 #include "debug.h"
 #include "rpcout.h"
index 785140172957a7049158a85dbea34c6fbfd86be4..c186fa7dc7c9a6becb32cfba62a83c9deeebc8b6 100644 (file)
@@ -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);
index cfb5006eeefef65cf8a5c53a5c9f5e00796bec19..2167d0c4cafeec75eacd33241226f4121ee7d02d 100644 (file)
@@ -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;
index 4f43121dc99fa98e18478f21992f2c1f403e3ec8..840792394cf9b472927e001d36856478e98b12ec 100644 (file)
@@ -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,