From 949cceeaa87a76d647660d3585ef9338bfaa3781 Mon Sep 17 00:00:00 2001 From: Fabrice Date: Tue, 10 Feb 2026 12:54:18 +0100 Subject: formatting --- src/vec.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/vec.h') diff --git a/src/vec.h b/src/vec.h index 6224574..2d71822 100644 --- a/src/vec.h +++ b/src/vec.h @@ -6,33 +6,36 @@ #define WAYC_VEC_GROWTH 2 struct raw_vec_s { - u8 *ptr; + u8* ptr; usize size; usize len, cap; }; #define WAYC_RAW_VEC_INIT(size) raw_vec_s{nullptr, size, 0, 0} -void wayc_raw_vec_push(raw_vec_s *vec, const u8 *at); -bool wayc_raw_vec_pop(raw_vec_s *vec, u8 *out); -void wayc_raw_vec_deinit(raw_vec_s *vec); +void wayc_raw_vec_push(raw_vec_s* vec, const u8* at); +bool wayc_raw_vec_pop(raw_vec_s* vec, u8* out); +void wayc_raw_vec_deinit(raw_vec_s* vec); -template struct vec_s { +template +struct vec_s { raw_vec_s raw; }; -#define WAYC_VEC_INIT(type) \ +#define WAYC_VEC_INIT(type) \ vec_s { WAYC_RAW_VEC_INIT(sizeof(type)) } template -static inline void wayc_vec_push(vec_s *vec, const T *at) { - wayc_raw_vec_push(&vec->raw, (u8 *)at); +static inline void wayc_vec_push(vec_s* vec, const T* at) { + wayc_raw_vec_push(&vec->raw, (u8*)at); } -template static inline bool wayc_vec_pop(vec_s *vec, T *out) { - return wayc_raw_vec_pop(&vec->raw, (u8 *)out); +template +static inline bool wayc_vec_pop(vec_s* vec, T* out) { + return wayc_raw_vec_pop(&vec->raw, (u8*)out); } -template static inline void wayc_vec_deinit(vec_s *vec) { +template +static inline void wayc_vec_deinit(vec_s* vec) { wayc_raw_vec_deinit(&vec->raw); } \ No newline at end of file -- cgit v1.2.3