[Mesa-dev] [PATCH 3/4] Let this build with gcc 3.3

Owain G. Ainsworth zerooa at googlemail.com
Sun Apr 18 16:55:38 PDT 2010


From: Matthieu Herrb <matthieu.herrb at laas.fr>

Declaring the loop index inside for () is not supported by this version.
---
 src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
index 7f5fb99..6cd1d87 100644
--- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
+++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
@@ -526,8 +526,10 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj,
 	unsigned mtCount = 0;
 	unsigned maxMtIndex = 0;
 	radeon_mipmap_tree *tmp;
+	unsigned int level;
+	int i;
 
-	for (unsigned level = firstLevel; level <= lastLevel; ++level) {
+	for (level = firstLevel; level <= lastLevel; ++level) {
 		radeon_texture_image *img = get_radeon_texture_image(texObj->base.Image[0][level]);
 		unsigned found = 0;
 		// TODO: why this hack??
@@ -537,7 +539,7 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj,
 		if (!img->mt)
 			continue;
 
-		for (int i = 0; i < mtCount; ++i) {
+		for (i = 0; i < mtCount; ++i) {
 			if (mts[i] == img->mt) {
 				found = 1;
 				mtSizes[i] += img->mt->levels[img->mtlevel].size;
@@ -558,7 +560,7 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj,
 		return NULL;
 	}
 
-	for (int i = 1; i < mtCount; ++i) {
+	for (i = 1; i < mtCount; ++i) {
 		if (mtSizes[i] > mtSizes[maxMtIndex]) {
 			maxMtIndex = i;
 		}
-- 
1.6.5.7



More information about the mesa-dev mailing list