implemented Array_slice* methods
This commit is contained in:
parent
75c94e88d9
commit
b801719712
@ -37,3 +37,12 @@ static inline Array_ Array_copy(Array_ src){
|
|||||||
#define Array_memset(A, VAL) memset((A)->data, VAL, (A)->size)
|
#define Array_memset(A, VAL) memset((A)->data, VAL, (A)->size)
|
||||||
|
|
||||||
#define struct_castTo_Array(STRUCT_PTR) Array_construct_size((STRUCT_PTR), sizeof(*STRUCT_PTR))
|
#define struct_castTo_Array(STRUCT_PTR) Array_construct_size((STRUCT_PTR), sizeof(*STRUCT_PTR))
|
||||||
|
|
||||||
|
static inline Array(u8) Array_sliceBefore(Array(u8) a, u32 n){
|
||||||
|
return Array_construct_size(a.data, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static inline Array(u8) Array_sliceAfter(Array(u8) a, u32 n){
|
||||||
|
return Array_construct_size((u8*)a.data + n, a.size - n);
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user