Mesa (glsl2): exec_list: Add a new replace_with method.
Ian Romanick
idr at kemper.freedesktop.org
Thu Jul 15 00:18:23 UTC 2010
Module: Mesa
Branch: glsl2
Commit: 1fdcdb2dca97cdf4b8f4790aa66587ff3e89e526
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1fdcdb2dca97cdf4b8f4790aa66587ff3e89e526
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Wed Jul 14 12:14:26 2010 -0700
exec_list: Add a new replace_with method.
---
src/glsl/list.h | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/glsl/list.h b/src/glsl/list.h
index 48502fb..29997c7 100644
--- a/src/glsl/list.h
+++ b/src/glsl/list.h
@@ -165,6 +165,17 @@ struct exec_node {
this->prev->next = before;
this->prev = before;
}
+ /**
+ * Replace the current node with the given node.
+ */
+ void replace_with(exec_node *replacement)
+ {
+ replacement->prev = this->prev;
+ replacement->next = this->next;
+
+ this->prev->next = replacement;
+ this->next->prev = replacement;
+ }
/**
* Is this the sentinal at the tail of the list?
More information about the mesa-commit
mailing list