aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/list.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-02-22 14:31:16 +0100
committermarha <marha@users.sourceforge.net>2015-02-22 14:31:16 +0100
commitf1c2db43dcf35d2cf4715390bd2391c28e42a8c2 (patch)
tree46b537271afe0f6534231b1bd4cc4f91ae1fb446 /mesalib/src/glsl/list.h
parent5e5a48ff8cd08f123601cd0625ca62a86675aac9 (diff)
downloadvcxsrv-f1c2db43dcf35d2cf4715390bd2391c28e42a8c2.tar.gz
vcxsrv-f1c2db43dcf35d2cf4715390bd2391c28e42a8c2.tar.bz2
vcxsrv-f1c2db43dcf35d2cf4715390bd2391c28e42a8c2.zip
xwininfo fontconfig libX11 libXdmcp libfontenc libxcb libxcb/xcb-proto mesalib xserver xkeyboard-config mkfontscale git update 22 Feb 2015
xserver commit 3a06faf3fcdb7451125a46181f9152e8e59e9770 libxcb commit e3ec1f74637237ce500dfd0ca59f2e422da4e019 libxcb/xcb-proto commit 4c550465934164aab2449a125f75f4ca07816233 xkeyboard-config commit 26f344c93f8c6141e9233eb68088ba4fd56bc9ef libX11 commit c8e19b393defd53f046ddc2da3a16881221b3c34 libXdmcp commit 9f4cac7656b221ce2a8f97e7bd31e5e23126d001 libfontenc commit de1843aaf76015c9d99416f3122d169fe331b849 mkfontscale commit 87d628f8eec170ec13bb9feefb1ce05aed07d1d6 xwininfo commit 0c49f8f2bd56b1e77721e81030ea948386dcdf4e fontconfig commit d6d5adeb7940c0d0beb86489c2a1c2ce59e5c044 mesa commit 4359954d842caa2a9f8d4b50d70ecc789884b68b
Diffstat (limited to 'mesalib/src/glsl/list.h')
-rw-r--r--mesalib/src/glsl/list.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/mesalib/src/glsl/list.h b/mesalib/src/glsl/list.h
index 995c666ea..ddb98f76f 100644
--- a/mesalib/src/glsl/list.h
+++ b/mesalib/src/glsl/list.h
@@ -51,6 +51,10 @@
* Therefore, if \c head->next is \c NULL or \c tail_prev->prev is \c NULL,
* the list is empty.
*
+ * Do note that this means that the list nodes will contain pointers into the
+ * list structure itself and as a result you may not \c realloc() an \c
+ * exec_list or any structure in which an \c exec_list is embedded.
+ *
* To anyone familiar with "exec lists" on the Amiga, this structure should
* be immediately recognizable. See the following link for the original Amiga
* operating system documentation on the subject.
@@ -534,9 +538,7 @@ exec_list_validate(const struct exec_list *list)
* either require C++ or assume the exec_node is embedded in a structure
* which is not the case for this function.
*/
- for (node = exec_list_get_head_const(list);
- !exec_node_is_tail_sentinel(node);
- node = exec_node_get_next_const(node)) {
+ for (node = list->head; node->next != NULL; node = node->next) {
assert(node->next->prev == node);
assert(node->prev->next == node);
}
@@ -638,6 +640,12 @@ inline void exec_node::insert_before(exec_list *before)
__next != NULL; \
__node = __next, __next = (__type *)__next->next)
+#define foreach_in_list_reverse_safe(__type, __node, __list) \
+ for (__type *__node = (__type *)(__list)->tail_pred, \
+ *__prev = (__type *)__node->prev; \
+ __prev != NULL; \
+ __node = __prev, __prev = (__type *)__prev->prev)
+
#define foreach_in_list_use_after(__type, __inst, __list) \
__type *(__inst); \
for ((__inst) = (__type *)(__list)->head; \
@@ -665,6 +673,12 @@ inline void exec_node::insert_before(exec_list *before)
(__node)->__field.next != NULL; \
(__node) = exec_node_data(__type, (__node)->__field.next, __field))
+#define foreach_list_typed_reverse(__type, __node, __field, __list) \
+ for (__type * __node = \
+ exec_node_data(__type, (__list)->tail_pred, __field); \
+ (__node)->__field.prev != NULL; \
+ (__node) = exec_node_data(__type, (__node)->__field.prev, __field))
+
#define foreach_list_typed_safe(__type, __node, __field, __list) \
for (__type * __node = \
exec_node_data(__type, (__list)->head, __field), \
@@ -674,4 +688,13 @@ inline void exec_node::insert_before(exec_list *before)
__node = __next, __next = \
exec_node_data(__type, (__next)->__field.next, __field))
+#define foreach_list_typed_safe_reverse(__type, __node, __field, __list) \
+ for (__type * __node = \
+ exec_node_data(__type, (__list)->tail_pred, __field), \
+ * __prev = \
+ exec_node_data(__type, (__node)->__field.prev, __field); \
+ __prev != NULL; \
+ __node = __prev, __prev = \
+ exec_node_data(__type, (__prev)->__field.prev, __field))
+
#endif /* LIST_CONTAINER_H */