aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-10-04 18:06:46 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-10-05 12:52:48 +0200
commit60e6eff80b7d00e2346af1936f37fc064a9aa50d (patch)
tree7fde66a9a26c2e367464d087eeca4d8942164bc1
parentb9453d0493bc672af908f83483e708880617ba8e (diff)
downloadsparse-60e6eff80b7d00e2346af1936f37fc064a9aa50d.tar.gz
add helper get_nth_expression()
This will be used for -Wformat. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--lib.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index b35debc8..957586db 100644
--- a/lib.h
+++ b/lib.h
@@ -199,6 +199,11 @@ static inline struct expression *first_expression(struct expression_list *head)
return first_ptr_list((struct ptr_list *)head);
}
+static inline struct expression *get_nth_expression(struct expression_list *head, unsigned int n)
+{
+ return ptr_list_nth_entry((struct ptr_list *)head, n);
+}
+
static inline pseudo_t first_pseudo(struct pseudo_list *head)
{
return first_ptr_list((struct ptr_list *)head);