From 5692a1e8f5befd3698134b1a5516a4dadda00115 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 6 Dec 2012 16:15:50 -0800 Subject: [PATCH 1/3] Support compilers with alternate spellings of typeof The AC_C_TYPEOF adds a #undef typeof to its autogenerated config.h.in template, but b8ab93dfbc7f292 didn't copy that to dix-config.h.in when HAVE_TYPEOF was, so the macro could claim typeof support but not make it work, when used with compilers like Solaris Studio 12.1 which only recognize it as __typeof__. Signed-off-by: Alan Coopersmith Acked-by: Peter Hutterer --- include/dix-config.h.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/dix-config.h.in b/include/dix-config.h.in index b270a3238..e1cb9eb51 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -429,6 +429,9 @@ /* Define to 1 if typeof works with your compiler. */ #undef HAVE_TYPEOF +/* Define to __typeof__ if your compiler spells it that way. */ +#undef typeof + /* The compiler supported TLS storage class, prefering initial-exec if tls_model is supported */ #undef TLS From 07a91fa6c6d535f3f05d4c3bd9c4d2b8c382c475 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 5 Dec 2012 23:21:27 +0000 Subject: [PATCH 2/3] hw/dmx: fix build without GLX Fixes this compile break that showed up on arm recently: dmxinit.c:746:26: error: 'glxSupported' undeclared (first use in this function) dmxinit.c:746:26: note: each undeclared identifier is reported only once for each function it appears in Signed-off-by: Rob Clark Reviewed-by: Alex Deucher --- hw/dmx/dmxinit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c index 7a50aebc3..7de402b06 100644 --- a/hw/dmx/dmxinit.c +++ b/hw/dmx/dmxinit.c @@ -740,10 +740,10 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) /* Check if GLX extension exists on all back-end servers */ for (i = 0; i < dmxNumScreens; i++) glxSupported &= (dmxScreens[i].glxMajorOpcode > 0); -#endif if (serverGeneration == 1) dmxAddExtensions(glxSupported); +#endif /* Tell dix layer about the backend displays */ for (i = 0; i < dmxNumScreens; i++) { From 9ff2e831517875f96477862f979abff394e8d551 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 18 Dec 2012 00:41:08 -0800 Subject: [PATCH 3/3] EnableDisableExtensionError: Use ARRAY_SIZE rather than sentinel d785368e0e converted the other miinitext functions to use ARRAY_SIZE, and removed the sentinel, but missed EnableDisableExtensionError so passing an invalid extension name could cause the server to walk off the end off the list looking for a sentinel that wasn't there. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer --- mi/miinitext.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mi/miinitext.c b/mi/miinitext.c index 369da5ede..81c663abe 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -212,10 +212,12 @@ EnableDisableExtension(const char *name, Bool enable) void EnableDisableExtensionError(const char *name, Bool enable) { - ExtensionToggle *ext = &ExtensionToggleList[0]; + ExtensionToggle *ext; + int i; Bool found = FALSE; - for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) { + for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) { + ext = &ExtensionToggleList[i]; if ((strcmp(name, ext->name) == 0) && (ext->disablePtr == NULL)) { ErrorF("[mi] Extension \"%s\" can not be disabled\n", name); found = TRUE; @@ -226,7 +228,8 @@ EnableDisableExtensionError(const char *name, Bool enable) ErrorF("[mi] Extension \"%s\" is not recognized\n", name); ErrorF("[mi] Only the following extensions can be run-time %s:\n", enable ? "enabled" : "disabled"); - for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) { + for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) { + ext = &ExtensionToggleList[i]; if (ext->disablePtr != NULL) { ErrorF("[mi] %s\n", ext->name); }