Mesa (master): r300/compiler: Move declaration before code.

Vinson Lee vlee at kemper.freedesktop.org
Wed Sep 29 20:35:36 UTC 2010


Module: Mesa
Branch: master
Commit: 0d0273142a4a9a8c895eb6eb90c45772061ae234
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0d0273142a4a9a8c895eb6eb90c45772061ae234

Author: Vinson Lee <vlee at vmware.com>
Date:   Wed Sep 29 13:34:56 2010 -0700

r300/compiler: Move declaration before code.

Fixes this GCC warning on linux-x86 build.
radeon_remove_constants.c: In function ‘rc_remove_unused_constants’:
radeon_remove_constants.c:100: warning: ISO C90 forbids mixed declarations and code

---

 .../dri/r300/compiler/radeon_remove_constants.c    |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c b/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c
index c591616..d6c808a 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_remove_constants.c
@@ -68,6 +68,7 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user)
 	unsigned are_externals_remapped = 0;
 	struct rc_constant *constants = c->Program.Constants.Constants;
 	struct mark_used_data d;
+	unsigned new_count;
 
 	if (!c->Program.Constants.Count) {
 		*out_remap_table = NULL;
@@ -97,7 +98,7 @@ void rc_remove_unused_constants(struct radeon_compiler *c, void *user)
 	 * This pass removes unused constants simply by overwriting them by other constants. */
 	remap_table = malloc(c->Program.Constants.Count * sizeof(unsigned));
 	inv_remap_table = malloc(c->Program.Constants.Count * sizeof(unsigned));
-	unsigned new_count = 0;
+	new_count = 0;
 
 	for (unsigned i = 0; i < c->Program.Constants.Count; i++) {
 		if (const_used[i]) {




More information about the mesa-commit mailing list