summaryrefslogtreecommitdiff
path: root/src/vmware_bootstrap.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2018-02-14 10:14:20 +0100
committerThomas Hellstrom <thellstrom@vmware.com>2018-02-15 08:27:30 +0100
commitdc85a6da15768f7a9622677e79c618bfb35ce513 (patch)
tree20128de6331e8f5472068bc7ddba5f4aeac29c9b /src/vmware_bootstrap.c
parent98199b4c0aca89b70d4f0a0e37e1e27ac15a23c7 (diff)
Fix a number of compilation warnings
There are a number of compilation warnings caused by const char pointers being either explicitly or implicitly cast to char pointers. There are a number of ABI differences that have hindered this so far, but make a new attempt using the common_compat.h defines. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Deepak Rawat <drawat@vmware.com>
Diffstat (limited to 'src/vmware_bootstrap.c')
-rw-r--r--src/vmware_bootstrap.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
index d7ab070..4f59e73 100644
--- a/src/vmware_bootstrap.c
+++ b/src/vmware_bootstrap.c
@@ -82,6 +82,10 @@
#define VMWARE_NAME "vmware"
#define VMWARE_DRIVER_NAME "vmware"
+
+static char vmware_name[] = VMWARE_NAME;
+static char vmware_driver_name[] = VMWARE_DRIVER_NAME;
+
#define VMWARE_DRIVER_VERSION \
(PACKAGE_VERSION_MAJOR * 65536 + PACKAGE_VERSION_MINOR * 256 + PACKAGE_VERSION_PATCHLEVEL)
#define VMWARE_DRIVER_VERSION_STRING \
@@ -255,8 +259,10 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
if (pciInfo == NULL)
return FALSE;
- pScrn->chipset = (char*)xf86TokenToString(VMWAREChipsets,
- DEVICE_ID(pciInfo));
+ pScrn->chipset = xstrdup(xf86TokenToString(VMWAREChipsets,
+ DEVICE_ID(pciInfo)));
+ if (pScrn->chipset == NULL)
+ return FALSE;
return (*pScrn->PreInit)(pScrn, flags);
};
@@ -274,8 +280,8 @@ VMwarePciProbe (DriverPtr drv,
NULL, NULL, NULL, NULL, NULL);
if (scrn != NULL) {
scrn->driverVersion = VMWARE_DRIVER_VERSION;
- scrn->driverName = VMWARE_DRIVER_NAME;
- scrn->name = VMWARE_NAME;
+ scrn->driverName = vmware_driver_name;
+ scrn->name = vmware_name;
scrn->Probe = NULL;
}
@@ -509,7 +515,7 @@ VMWareDriverFunc(ScrnInfoPtr pScrn,
_X_EXPORT DriverRec vmware = {
VMWARE_DRIVER_VERSION,
- VMWARE_DRIVER_NAME,
+ vmware_driver_name,
VMWAREIdentify,
#if XSERVER_LIBPCIACCESS
NULL,