From c79b9e561a2d4ca8eb36eb9afe45a07888c97277 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Thu, 1 Oct 2020 20:00:23 +0200 Subject: Minor refactoring. --- stc/cdefs.h | 6 +++--- stc/clist.h | 2 +- stc/cmap.h | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/stc/cdefs.h b/stc/cdefs.h index 1dcfeaef..909ba69e 100644 --- a/stc/cdefs.h +++ b/stc/cdefs.h @@ -96,13 +96,13 @@ enum {_c_max_buffer = 512}; #define c_push_items(self, ctype, ...) do { \ const ctype##_input_t __arr[] = __VA_ARGS__; \ - ctype##_push_n(self, __arr, sizeof(__arr)/sizeof(__arr[0])); \ + ctype##_push_n(self, __arr, sizeof __arr/sizeof *__arr); \ } while (0) #define c_del(ctype, ...) do { \ ctype##_t* __arr[] = {__VA_ARGS__}; \ - for (size_t i=0; isecond = val; \ } while (0) + #define c_insert_items(self, ctype, ...) do { \ const ctype##_input_t __arr[] = __VA_ARGS__; \ - for (size_t i=0;i