File tree 1 file changed +5
-11
lines changed
1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change 18
18
free((obj).data); \
19
19
}
20
20
21
- #define gen_slice (name , type ) \
21
+ #define gen_simple_slice (name , type ) \
22
22
typedef struct { \
23
23
type *data; \
24
24
size_t size; \
25
25
} name##_slice_t; \
26
26
static name##_slice_t slice_##name(type *input, size_t from, size_t to) { \
27
27
return (name##_slice_t){.data = input + from, .size = to - from}; \
28
- } \
29
- static name##_slice_t slice_##name##_right(type *input, size_t to) { \
30
- return slice_##name(input, 0, to); \
31
28
}
32
29
33
- #define gen_simple_slice (name , type ) \
34
- typedef struct { \
35
- type *data; \
36
- size_t size; \
37
- } name##_slice_t; \
38
- static name##_slice_t slice_##name(type *input, size_t from, size_t to) { \
39
- return (name##_slice_t){.data = input + from, .size = to - from}; \
30
+ #define gen_slice (name , type ) \
31
+ gen_simple_slice(name, type); \
32
+ static name##_slice_t slice_##name##_right(type *input, size_t to) { \
33
+ return slice_##name(input, 0, to); \
40
34
}
41
35
42
36
gen_slice (i16 , int16_t );
You can’t perform that action at this time.
0 commit comments