From 179737d4a07ed10a734fe017b5680f8e78ffda96 Mon Sep 17 00:00:00 2001 From: Jens Granseuer Date: Wed, 7 Jun 2006 01:46:00 -0700 Subject: [PATCH] Bug 7145: fix build with gcc 2.95 & other c89 compilers Move variable declarations to start of blocks as required by c89 --- exa/exa.c | 5 ++++- hw/xfree86/common/xf86Config.c | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/exa/exa.c b/exa/exa.c index aa5532a98..1022b2ec3 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -523,6 +523,9 @@ exaDriverInit (ScreenPtr pScreen, ExaDriverPtr pScreenInfo) { ExaScreenPrivPtr pExaScr; +#ifdef RENDER + PictureScreenPtr ps; +#endif if (pScreenInfo->exa_major != EXA_VERSION_MAJOR || pScreenInfo->exa_minor > EXA_VERSION_MINOR) @@ -536,7 +539,7 @@ exaDriverInit (ScreenPtr pScreen, } #ifdef RENDER - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); + ps = GetPictureScreenIfSet(pScreen); #endif if (exaGeneration != serverGeneration) { diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 36dde3031..d9f1dd903 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -617,6 +617,9 @@ static Bool configFiles(XF86ConfFilesPtr fileconf) { MessageType pathFrom = X_DEFAULT; + int countDirs; + char *temp_path; + char *log_buf; /* FontPath */ @@ -676,13 +679,13 @@ configFiles(XF86ConfFilesPtr fileconf) FatalError("No valid FontPath could be found."); /* make fontpath more readable in the logfiles */ - int countDirs = 1; - char *temp_path = defaultFontPath; + countDirs = 1; + temp_path = defaultFontPath; while((temp_path = index(temp_path, ',')) != NULL) { countDirs++; temp_path++; } - char *log_buf = xnfalloc(strlen(defaultFontPath) + (2 * countDirs) + 1); + log_buf = xnfalloc(strlen(defaultFontPath) + (2 * countDirs) + 1); if(!log_buf) /* fallback to old method */ xf86Msg(pathFrom, "FontPath set to \"%s\"\n", defaultFontPath); else {