summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2014-02-21 18:10:07 +0100
committerJakob Bornecrantz <jakob@vmware.com>2014-02-26 19:02:45 +0100
commit51cdfa6f5102bde92c98630ace6650e4b286f6e2 (patch)
tree1ce17f235dd1eac6d85057a33660216995c446a1
parent8da981712f62050076cff53e1b40ed1e307fcca8 (diff)
downloadxf86-video-vmware-51cdfa6f5102bde92c98630ace6650e4b286f6e2.tar.gz
xf86-video-vmware-51cdfa6f5102bde92c98630ace6650e4b286f6e2.tar.bz2
xf86-video-vmware-51cdfa6f5102bde92c98630ace6650e4b286f6e2.zip
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 <thellstrom@vmware.com>
-rw-r--r--src/vmwaremodes.c4
1 files changed, 3 insertions, 1 deletions
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));