aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-12-27 13:55:18 +0000
committergingerBill <bill@gingerbill.org>2019-12-27 13:55:18 +0000
commit880c7f01a8ee71f9001ad7d9558753cf8d512845 (patch)
tree647119090edcc7df800bccc8f264bf2604fa51db /src/types.cpp
parent10f0961184a5f486bad2050d1bb42320b833a370 (diff)
Fix array lengths with enum value counts.
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp8
1 files changed, 8 insertions, 0 deletions
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[] = {