From 36f008b2987bec8e99ac0dd1403c2e3d68882298 Mon Sep 17 00:00:00 2001 From: Marrub Date: Fri, 21 Oct 2016 14:45:07 -0400 Subject: [PATCH] Types: Fix VectorForEach, add 'bufsz' to Vector and add Lth_Pair --- lithos_c/inc/Lth_types.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lithos_c/inc/Lth_types.h b/lithos_c/inc/Lth_types.h index f8531de..1bffc2e 100644 --- a/lithos_c/inc/Lth_types.h +++ b/lithos_c/inc/Lth_types.h @@ -18,9 +18,11 @@ #define Lth_Inherits(name) [[__anonymous]] name _super #define Lth_Mixin(name) [[__anonymous]] name _##name -#define Lth_Vector(type) struct { type *data; size_t size; } -#define Lth_VectorForEach(tmpv, vec) \ - for(tmpv = (vec).data; tmpv != (vec).data + (vec).size; tmpv++) +#define Lth_Vector(type) struct { type *data; size_t size, bufsz; } +#define Lth_VectorForEach(type, vec) \ + for(type itr = (vec).data; itr != (vec).data + (vec).size; itr++) + +#define Lth_Pair(typef, types) struct { typef first; types second; } // Type Definitions ----------------------------------------------------------|