From e0dca2ff0b695b60830cf8f10a2c0585602a4d40 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Mon, 30 Oct 2006 10:53:18 -0800 Subject: Fix some warnings noted when compiling the code against older Xorg versions. --- src/vmware.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/vmware.c') diff --git a/src/vmware.c b/src/vmware.c index 244548c..e778625 100644 --- a/src/vmware.c +++ b/src/vmware.c @@ -166,7 +166,7 @@ typedef enum { OPTION_HW_CURSOR, OPTION_NOACCEL, OPTION_XINERAMA, - OPTION_STATIC_XINERAMA, + OPTION_STATIC_XINERAMA } VMWAREOpts; static const OptionInfoRec VMWAREOptions[] = { @@ -448,6 +448,12 @@ VMWAREParseTopologyElement(ScrnInfoPtr pScrn, strncpy(buf, str, i); *outValue = atoi(buf); + if (*outValue > (unsigned short)-1) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Output %u: %s must be less than %hu.\n", + output, elementName, (unsigned short)-1); + goto exit; + } + str += i; if (needTerminator || str[0] != '\0') { @@ -477,8 +483,8 @@ VMWAREParseTopologyElement(ScrnInfoPtr pScrn, static xXineramaScreenInfo * VMWAREParseTopologyString(ScrnInfoPtr pScrn, - const char *topology, // IN: - unsigned int *retNumOutputs) // OUT: + const char *topology, + unsigned int *retNumOutputs) { xXineramaScreenInfo *extents = NULL; unsigned int numOutputs = 0; @@ -515,7 +521,7 @@ VMWAREParseTopologyString(ScrnInfoPtr pScrn, } str += i; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Output %u: %hux%hu+%hu+%hu\n", + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Output %u: %ux%u+%u+%u\n", numOutputs, width, height, x, y); numOutputs++; -- cgit v1.2.3