Mesa (master): glcpp: Regenerate glcpp-parse.c

Chad Versace chadversary at kemper.freedesktop.org
Tue Jan 11 01:29:00 UTC 2011


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

Author: Chad Versace <chad.versace at intel.com>
Date:   Mon Jan 10 17:09:24 2011 -0800

glcpp: Regenerate glcpp-parse.c

---

 src/glsl/glcpp/glcpp-parse.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/glsl/glcpp/glcpp-parse.c b/src/glsl/glcpp/glcpp-parse.c
index ab7c30e..55ec165 100644
--- a/src/glsl/glcpp/glcpp-parse.c
+++ b/src/glsl/glcpp/glcpp-parse.c
@@ -3150,10 +3150,31 @@ _token_list_trim_trailing_space (token_list_t *list)
 }
 
 int
+_token_list_is_empty_ignoring_space (token_list_t *l)
+{
+	token_node_t *n;
+
+	if (l == NULL)
+		return 1;
+
+	n = l->head;
+	while (n != NULL && n->token->type == SPACE)
+		n = n->next;
+
+	return n == NULL;
+}
+
+int
 _token_list_equal_ignoring_space (token_list_t *a, token_list_t *b)
 {
 	token_node_t *node_a, *node_b;
 
+	if (a == NULL || b == NULL) {
+		int a_empty = _token_list_is_empty_ignoring_space(a);
+		int b_empty = _token_list_is_empty_ignoring_space(b);
+		return a_empty == b_empty;
+	}
+
 	node_a = a->head;
 	node_b = b->head;
 




More information about the mesa-commit mailing list