summaryrefslogtreecommitdiffstats
path: root/bytecode/slice.h
diff options
context:
space:
mode:
Diffstat (limited to 'bytecode/slice.h')
-rw-r--r--bytecode/slice.h33
1 files changed, 0 insertions, 33 deletions
diff --git a/bytecode/slice.h b/bytecode/slice.h
deleted file mode 100644
index 4f4624c..0000000
--- a/bytecode/slice.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef _SLICE_H_
-#define _SLICE_H_
-
-#include <assert.h>
-#include <stddef.h>
-
-#define DEFINE_SLICE(t) \
- typedef struct { \
- size_t size; \
- t *buf; \
- } t##_slice; \
- \
- static inline t##_slice \
- t##_slice2(t##_slice slice, size_t i, size_t j) \
- { \
- assert(i <= slice.size && j <= slice.size && i <= j); \
- return (t##_slice) { \
- .size = j - i, \
- .buf = slice.buf + i, \
- }; \
- } \
- \
- static inline t##_slice \
- t##_slice1(t##_slice slice, size_t i) \
- { \
- assert(i <= slice.size); \
- return (t##_slice) { \
- .size = slice.size - i, \
- .buf = slice.buf + i, \
- }; \
- }
-
-#endif