diff options
author | marha <marha@users.sourceforge.net> | 2014-07-19 15:12:53 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-07-19 15:12:53 +0200 |
commit | 61c36feba19d918885022042ea62d068a698c83d (patch) | |
tree | fd351953eb2193fe548e7d0e2dca06b34b7c4f4d /mesalib/src/glsl/list.h | |
parent | 3865d60ef607cbb00c819e905e40d3628b8eca29 (diff) | |
parent | d0c30e7945e76ac119f6d867e27137c8a76f7e15 (diff) | |
download | vcxsrv-61c36feba19d918885022042ea62d068a698c83d.tar.gz vcxsrv-61c36feba19d918885022042ea62d068a698c83d.tar.bz2 vcxsrv-61c36feba19d918885022042ea62d068a698c83d.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/glsl/ir.cpp
xorg-server/config/config.c
xorg-server/include/callback.h
xorg-server/include/colormap.h
xorg-server/include/cursor.h
xorg-server/include/dix.h
xorg-server/include/dixfont.h
xorg-server/include/dixgrabs.h
xorg-server/include/gc.h
xorg-server/include/gcstruct.h
xorg-server/include/input.h
xorg-server/include/os.h
xorg-server/include/pixmap.h
xorg-server/include/property.h
xorg-server/include/resource.h
xorg-server/include/scrnintstr.h
xorg-server/include/window.h
xorg-server/include/xkbsrv.h
xorg-server/mi/mi.h
Diffstat (limited to 'mesalib/src/glsl/list.h')
-rw-r--r-- | mesalib/src/glsl/list.h | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/mesalib/src/glsl/list.h b/mesalib/src/glsl/list.h index 9f08d45f7..500a85717 100644 --- a/mesalib/src/glsl/list.h +++ b/mesalib/src/glsl/list.h @@ -333,6 +333,8 @@ struct exec_list { const exec_node *get_tail() const; exec_node *get_tail(); + unsigned length() const; + void push_head(exec_node *n); void push_tail(exec_node *n); void push_degenerate_list_at_head(exec_node *n); @@ -353,9 +355,15 @@ struct exec_list { void move_nodes_to(exec_list *target); /** - * Append all nodes from the source list to the target list + * Append all nodes from the source list to the end of the target list */ void append_list(exec_list *source); + + /** + * Prepend all nodes from the source list to the beginning of the target + * list + */ + void prepend_list(exec_list *source); #endif }; @@ -407,6 +415,19 @@ exec_list_get_tail(struct exec_list *list) return !exec_list_is_empty(list) ? list->tail_pred : NULL; } +static inline unsigned +exec_list_length(const struct exec_list *list) +{ + unsigned size = 0; + struct exec_node *node; + + for (node = list->head; node->next != NULL; node = node->next) { + size++; + } + + return size; +} + static inline void exec_list_push_head(struct exec_list *list, struct exec_node *n) { @@ -487,6 +508,13 @@ exec_list_append(struct exec_list *list, struct exec_list *source) } static inline void +exec_list_prepend(struct exec_list *list, struct exec_list *source) +{ + exec_list_append(source, list); + exec_list_move_nodes_to(source, list); +} + +static inline void exec_node_insert_list_before(struct exec_node *n, struct exec_list *before) { if (exec_list_is_empty(before)) @@ -532,6 +560,11 @@ inline exec_node *exec_list::get_tail() return exec_list_get_tail(this); } +inline unsigned exec_list::length() const +{ + return exec_list_length(this); +} + inline void exec_list::push_head(exec_node *n) { exec_list_push_head(this, n); @@ -562,6 +595,11 @@ inline void exec_list::append_list(exec_list *source) exec_list_append(this, source); } +inline void exec_list::prepend_list(exec_list *source) +{ + exec_list_prepend(this, source); +} + inline void exec_node::insert_before(exec_list *before) { exec_node_insert_list_before(this, before); |