summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDeepak Singh Rawat <drawat@vmware.com>2017-08-07 15:57:56 -0700
committerSinclair Yeh <syeh@vmware.com>2017-08-07 15:57:56 -0700
commitd8c2f8501307a9c0c65601e897e7d919e42ba0b3 (patch)
tree2e011477c8845b049461536e7471c53344d84357 /src
parented0fd2f2823917a5dfefa3d3af774d4cdb40f958 (diff)
vmware: Fix build warnings
Due to following commit in xserver there were build warnings, as variables now declared const. d89b42bda46d36fc0879611cc3b3566957ce36d0 e1e01d2e33c632e395d7e396f73fba8ae606b15a Added a compat header file. Signed-off-by: Deepak Rawat <drawat@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>:q
Diffstat (limited to 'src')
-rw-r--r--src/common_compat.h11
-rw-r--r--src/vmware.c15
-rw-r--r--src/vmwaremodes.c3
3 files changed, 22 insertions, 7 deletions
diff --git a/src/common_compat.h b/src/common_compat.h
new file mode 100644
index 0000000..d7b4867
--- /dev/null
+++ b/src/common_compat.h
@@ -0,0 +1,11 @@
+#ifndef _COMMON_COMPAT_H_
+#define _COMMOM_COMPAT_H_
+
+#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 18)
+#define CONST_ABI_18_0 const
+#else
+#define CONST_ABI_18_0
+#endif
+
+#endif
+
diff --git a/src/vmware.c b/src/vmware.c
index 12f12ed..1af20d8 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -36,6 +36,7 @@ char rcsId_vmware[] =
#include "svga_modes.h"
#include "vmware_bootstrap.h"
#include "vmware_common.h"
+#include "common_compat.h"
#ifndef HAVE_XORG_SERVER_1_5_0
#include <xf86_ansic.h>
@@ -1222,12 +1223,14 @@ VMWAREAddDisplayMode(ScrnInfoPtr pScrn,
int height)
{
DisplayModeRec *mode;
+ char * modeName;
mode = malloc(sizeof(DisplayModeRec));
memset(mode, 0, sizeof *mode);
- mode->name = malloc(strlen(name) + 1);
- strcpy(mode->name, name);
+ modeName = malloc(strlen(name) + 1);
+ strcpy(modeName, name);
+ mode->name = modeName;
mode->status = MODE_OK;
mode->type = M_T_DEFAULT;
mode->HDisplay = width;
@@ -1324,7 +1327,7 @@ VMWAREScreenInit(SCREEN_INIT_ARGS_DECL)
if (useXinerama && xf86IsOptionSet(options, OPTION_GUI_LAYOUT)) {
- char *topology = xf86GetOptValString(options, OPTION_GUI_LAYOUT);
+ CONST_ABI_18_0 char *topology = xf86GetOptValString(options, OPTION_GUI_LAYOUT);
if (topology) {
pVMWARE->xineramaState =
VMWAREParseTopologyString(pScrn, topology,
@@ -1332,11 +1335,11 @@ VMWAREScreenInit(SCREEN_INIT_ARGS_DECL)
pVMWARE->xineramaStatic = pVMWARE->xineramaState != NULL;
- free(topology);
+ free((void *)topology);
}
} else if (useXinerama &&
xf86IsOptionSet(options, OPTION_STATIC_XINERAMA)) {
- char *topology = xf86GetOptValString(options, OPTION_STATIC_XINERAMA);
+ CONST_ABI_18_0 char *topology = xf86GetOptValString(options, OPTION_STATIC_XINERAMA);
if (topology) {
pVMWARE->xineramaState =
VMWAREParseTopologyString(pScrn, topology,
@@ -1345,7 +1348,7 @@ VMWAREScreenInit(SCREEN_INIT_ARGS_DECL)
pVMWARE->xineramaStatic = pVMWARE->xineramaState != NULL;
- free(topology);
+ free((void *)topology);
}
}
diff --git a/src/vmwaremodes.c b/src/vmwaremodes.c
index 41a9b4f..1d296ac 100644
--- a/src/vmwaremodes.c
+++ b/src/vmwaremodes.c
@@ -40,6 +40,7 @@
#endif
#include "vm_basic_types.h"
#include "vmware.h"
+#include "common_compat.h"
#ifndef M_T_DRIVER
# define M_T_DRIVER 0x40 /* Supplied by the driver (EDID, etc) */
@@ -83,7 +84,7 @@ vmwareAddDefaultMode(ScrnInfoPtr pScrn, uint32 dwidth, uint32 dheight)
DisplayModeRec dynamic =
{ MODEPREFIX, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, MODESUFFIX };
unsigned dispModeCount = 0;
- char **dispModeList;
+ CONST_ABI_18_0 char **dispModeList;
char *dynModeName;
char name[80];
VMWAREPtr pVMWARE = VMWAREPTR(pScrn);