From: Philip Langdale Date: Mon, 30 Oct 2006 18:53:18 +0000 (-0800) Subject: Fix some warnings noted when compiling the code against X-Git-Tag: vmware-10_14_0~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0dca2ff0b695b60830cf8f10a2c0585602a4d40;p=platform%2Fupstream%2Fxf86-video-vmware.git Fix some warnings noted when compiling the code against older Xorg versions. --- 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++;