Mesa (master): glsl: Don' t print a useless space at the end of an S-Expression list.

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Nov 3 20:38:44 UTC 2010


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Sat Oct 30 21:45:34 2010 -0700

glsl: Don't print a useless space at the end of an S-Expression list.

We really only want to print spaces -between- elements, not after each
element.  This cleans up error messages from IR reader, making them
(mildly) easier to read.

---

 src/glsl/s_expression.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/glsl/s_expression.cpp b/src/glsl/s_expression.cpp
index 4458c48..4c8829f 100644
--- a/src/glsl/s_expression.cpp
+++ b/src/glsl/s_expression.cpp
@@ -133,7 +133,8 @@ void s_list::print()
    foreach_iter(exec_list_iterator, it, this->subexpressions) {
       s_expression *expr = (s_expression*) it.get();
       expr->print();
-      printf(" ");
+      if (!expr->next->is_tail_sentinel())
+	 printf(" ");
    }
    printf(")");
 }




More information about the mesa-commit mailing list