From 51cdfa6f5102bde92c98630ace6650e4b286f6e2 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 21 Feb 2014 18:10:07 +0100 Subject: vmware: Fix compilation on newer X servers Found by Bryan Lee. Later versions of X.org turns dispMode pointers into const upsetting gcc, turn them into size_t's instead. Reviewed-by: Thomas Hellstrom --- src/vmwaremodes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vmwaremodes.c b/src/vmwaremodes.c index 2965dca..41a9b4f 100644 --- a/src/vmwaremodes.c +++ b/src/vmwaremodes.c @@ -102,7 +102,9 @@ vmwareAddDefaultMode(ScrnInfoPtr pScrn, uint32 dwidth, uint32 dheight) dispModeList = pScrn->display->modes; while(*dispModeList) dispModeList++; - dispModeCount = dispModeList - pScrn->display->modes; + dispModeCount = (unsigned)(((size_t)dispModeList - + (size_t)pScrn->display->modes) / + sizeof(*dispModeList)); } dispModeList = xnfcalloc(dispModeCount + 2, sizeof(*dispModeList)); -- cgit v1.2.3