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>
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));