From 880c7f01a8ee71f9001ad7d9558753cf8d512845 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 27 Dec 2019 13:55:18 +0000 Subject: Fix array lengths with enum value counts. --- src/types.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/types.cpp') diff --git a/src/types.cpp b/src/types.cpp index f4423ba69..7c4e47f12 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -336,6 +336,14 @@ Selection selection_combine(Selection const &lhs, Selection const &rhs) { return new_sel; } +Selection sub_selection(Selection const &sel, isize offset) { + Selection res = {}; + res.index.data = sel.index.data + offset; + res.index.count = sel.index.count - offset; + res.index.capacity = res.index.count; + return res; +} + gb_global Type basic_types[] = { -- cgit v1.2.3