[Mesa-dev] [PATCH 19/21] freedreno: Make print_sequence a macro to fix clang.

Johannes Obermayr johannesobermayr at gmx.de
Wed Sep 11 15:32:57 PDT 2013


---
 src/gallium/drivers/freedreno/a3xx/disasm-a3xx.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a3xx/disasm-a3xx.c b/src/gallium/drivers/freedreno/a3xx/disasm-a3xx.c
index 4db095f..ed76a78 100644
--- a/src/gallium/drivers/freedreno/a3xx/disasm-a3xx.c
+++ b/src/gallium/drivers/freedreno/a3xx/disasm-a3xx.c
@@ -154,28 +154,26 @@ static struct {
 	regmask_t cnst;     /* used consts */
 } regs;
 
+#define fd_print_sequence \
+	if (first != MAX_REG) { \
+		if (first == last) { \
+			printf(" %d", first); \
+		} else { \
+			printf(" %d-%d", first, last); \
+		} \
+	}
+
 static void print_regs(regmask_t *regmask, bool full)
 {
 	int num, max = 0, cnt = 0;
 	int first, last;
 
-	void print_sequence(void)
-	{
-		if (first != MAX_REG) {
-			if (first == last) {
-				printf(" %d", first);
-			} else {
-				printf(" %d-%d", first, last);
-			}
-		}
-	}
-
 	first = last = MAX_REG;
 
 	for (num = 0; num < MAX_REG; num++) {
 		if (regmask_get(regmask, num, full)) {
 			if (num != (last + 1)) {
-				print_sequence();
+				fd_print_sequence;
 				first = num;
 			}
 			last = num;
@@ -184,7 +182,7 @@ static void print_regs(regmask_t *regmask, bool full)
 		}
 	}
 
-	print_sequence();
+	fd_print_sequence;
 
 	printf(" (cnt=%d, max=%d)", cnt, max);
 }
-- 
1.8.1.4



More information about the mesa-dev mailing list