]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes in shared code that don't affect open-vm-tools functionality.
authorVMware, Inc <>
Mon, 22 Mar 2010 19:14:38 +0000 (12:14 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 22 Mar 2010 19:14:38 +0000 (12:14 -0700)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/include/file.h
open-vm-tools/lib/include/region.h
open-vm-tools/lib/include/vm_version.h
open-vm-tools/lib/region/region.c

index accd0e12ae0b1daa2f02c15779fa4cc1999b2da9..77c02ad6bdb9262670d18b6c9e291b67c12f8487 100644 (file)
@@ -75,14 +75,14 @@ EXTERN FileMacosUnmountStatus FileMacos_UnmountDev(char const *bsdDev,
                                                    Bool eject,
                                                    Bool su);
 
-EXTERN void FileMacos_MountDevAsyncNoResult(char const *bsdSliceDev,
+EXTERN void FileMacos_MountDevAsyncNoResult(char const *bsdDev,
                                             Bool su);
 
 EXTERN Bool FileMacos_IsOnExternalDevice(int fd);
 EXTERN Bool FileMacos_IsOnSparseDmg(int fd);
 EXTERN Bool FileMacos_IsSliceDevice(char const *bsdDev);
 
-EXTERN char *FileMacos_DiskDevToDiskName(char const *bsdDiskDev);
+EXTERN char *FileMacos_DiskDevToUserFriendlyName(char const *bsdDiskDev);
 
 EXTERN char *FileMacos_DiskDeviceToUniqueID(char const *bsdPath);
 EXTERN char *FileMacos_UniqueIDToDiskDevice(char const *identifier);
index 23ad0b2d9f5b0668182f277cdfdfcffe2704799f..acbf65782410bc3e14c5a3db3eb0ea8efe965180 100644 (file)
@@ -68,6 +68,11 @@ SOFTWARE.
  *                               and MAXSHORT with winnt.h
  *      04/03/2007 shelleygong  - use int instead of short for data
  *                                inside the region
+ * 02/12/2010 michael - Since coordinates are kept as ints, coordinate values
+ *    shouldn't be clamped to the range of short. I removed R_{MIN,MAX}SHORT
+ *    and changed clamping to be in the range R_MININT..R_MAXINT instead.
+ *    Since some code does "n < R_MININT" and "n > R_MAXINT", R_MININT must be
+ *    greater than INT_MIN and R_MAXINT must be less than INT_MAX.
  */
 
 #ifndef __REGION_H__
@@ -91,11 +96,8 @@ SOFTWARE.
 #define NullBox ((BoxPtr)0)
 #define NullRegion ((RegionPtr)0)
 
-#define R_MAXSHORT SHRT_MAX
-#define R_MINSHORT SHRT_MIN
-
-#define R_MAXINT 0x7FFFFFFF
-#define R_MININT 0x8FFFFFFF
+#define R_MAXINT 0x0FFFFFFF   /* Must be less than INT_MAX */
+#define R_MININT 0x8FFFFFFF   /* Must be greater than INT_MIN */
 
 #define CT_YXBANDED 18
 
index 1096127aedf90d5f00e90caac023b13cf01dcea9..09c96d0a3252e661d81ff1bc8bf0eba3387c122b 100644 (file)
@@ -83,7 +83,7 @@
  * hard-coded value for every other product.
  */
 #if defined(VMX86_DESKTOP)
-   #define PRODUCT_VERSION    7,0,0,PRODUCT_BUILD_NUMBER_NUMERIC  /* WORKSTATION_VERSION_NUMERIC below has to match this */
+   #define PRODUCT_VERSION    7,0,0,PRODUCT_BUILD_NUMBER_NUMERIC  /* WORKSTATION_VERSION_NUMBER below has to match this */
 #elif defined(VMX86_TOOLS)
    #define PRODUCT_VERSION    TOOLS_VERSION_EXT_CURRENT_CSV
 #elif defined(VMX86_VCB)
@@ -91,7 +91,7 @@
 #elif defined(VMX86_VLICENSE)
    #define PRODUCT_VERSION    1,1,2,PRODUCT_BUILD_NUMBER_NUMERIC
 #else
-   #define PRODUCT_VERSION    3,1,0,PRODUCT_BUILD_NUMBER_NUMERIC  /* PLAYER_VERSION_NUMERIC below has to match this */
+   #define PRODUCT_VERSION    3,1,0,PRODUCT_BUILD_NUMBER_NUMERIC  /* PLAYER_VERSION_NUMBER below has to match this */
 #endif
 
 /*
 #define ESX_RELEASE ESX_RELEASE_UPDATE "." ESX_RELEASE_PATCH
 #define GSX_VERSION "e.x.p"
 #define VMSERVER_VERSION "e.x.p"
-#define WORKSTATION_VERSION_NUMERIC "7.1.0" /* this version number should always match real WS version number */
+#define WORKSTATION_VERSION_NUMBER "7.1.0" /* this version number should always match real WS version number */
 #define WORKSTATION_VERSION "e.x.p"
 #define WORKSTATION_ENTERPRISE_VERSION "e.x.p"
 #define ACE_MANAGEMENT_SERVER_VERSION "e.x.p"
 #define CONSOLE_VERSION "4.1.0"
 #define P2V_VERSION "e.x.p"
 #define P2V_FILE_VERSION 3,0,0,0
-#define PLAYER_VERSION_NUMERIC "3.1.0" /* this version number should always match real Player version number */
+#define PLAYER_VERSION_NUMBER "3.1.0" /* this version number should always match real Player version number */
 #define PLAYER_VERSION "e.x.p"
 #define V2V_VERSION "e.x.p"
 #define V2V_FILE_VERSION 1,0,0,0
index e32db817cccddbbd26c5357d91501a692e5e4b66..97942d99569dcca9aef038ee113d7b6f0a4180bc 100644 (file)
@@ -106,6 +106,11 @@ Equipment Corporation.
  *                               and MAXSHORT with winnt.h
  *      04/03/2007 shelleygong  - use int instead of short for data
  *                                inside the region *
+ * 02/12/2010 michael - Since coordinates are kept as ints, coordinate values
+ *    shouldn't be clamped to the range of short. I removed R_{MIN,MAX}SHORT
+ *    and changed clamping to be in the range R_MININT..R_MAXINT instead.
+ *    Since some code does "n < R_MININT" and "n > R_MAXINT", R_MININT must be
+ *    greater than INT_MIN and R_MAXINT must be less than INT_MAX.
  */
 
 #include <stdlib.h>
@@ -2080,7 +2085,7 @@ miRectsToRegionByBoundary(
 
 /*
  * Construct the region from rects using the default values
- * R_MINSHORT and R_MAXSHORT for boundary check
+ * R_MININT and R_MAXINT for boundary check
  */
 RegionPtr
 miRectsToRegion(
@@ -2089,7 +2094,7 @@ miRectsToRegion(
                 int                    ctype)
 {
    return miRectsToRegionByBoundary(nrects, prect, ctype,
-                                    R_MINSHORT, R_MAXSHORT);
+                                    R_MININT, R_MAXINT);
 }
 
 /*======================================================================
@@ -2561,7 +2566,7 @@ miTranslateRegionByBoundary(
 
 /*
  * Translate the region and use the default values which are
- * R_MINSHORT, R_MAXSHORT for boundary check 
+ * R_MININT, R_MAXINT for boundary check 
  */
 
 void
@@ -2570,17 +2575,7 @@ miTranslateRegion(
                   register int x,
                   register int y)
 {
-    /*
-     * This check is here to validate the fix for bug 357509. R_MINSHORT was
-     * defined incorrectly. I changed it to SHRT_MIN, but that introduced the
-     * possibility of a comparison in miTranslateRegionByBoundary underflowing.
-     * miTranslateRegionByBoundary currently uses ints, so it won't underflow
-     * as long as the range of int is larger than the range of short.
-     * This assert checks that that is indeed the case.
-     */
-    ASSERT_ON_COMPILE(INT_MIN < SHRT_MIN);
-
-    miTranslateRegionByBoundary(pReg, x, y, R_MINSHORT, R_MAXSHORT);
+    miTranslateRegionByBoundary(pReg, x, y, R_MININT, R_MAXINT);
 }