diff options
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | include/stc/ccommon.h | 3 | ||||
| -rw-r--r-- | include/stc/cspan.h | 4 |
3 files changed, 6 insertions, 4 deletions
@@ -608,9 +608,12 @@ STC is generally very memory efficient. Memory usage for the different container - Much improved documentation - Added Coroutines + documentation - Added `c_const_cast()` typesafe macro. +- Added crand.h header: new API for crandom.h, which is deprecated. - Renamed c_foreach_r => `c_foreach_rv` - Renamed c_flt_count(i) => `c_flt_counter(i)` - Renamed c_flt_last(i) => `c_flt_getcount(i)` +- Renamed c_ARRAYLEN() => c_arraylen() +- Renamed deprecated c_ARGSV => c_SV - Removed c_PAIR ## Version 4.1.1 diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h index 1a2b3c3f..d5508807 100644 --- a/include/stc/ccommon.h +++ b/include/stc/ccommon.h @@ -123,8 +123,7 @@ C##_from_n((C##_raw[])__VA_ARGS__, c_sizeof((C##_raw[])__VA_ARGS__)/c_sizeof(C##_raw)) #define c_litstrlen(literal) (c_sizeof("" literal) - 1) -#define c_arraylen(a) (c_ARRAYLEN(a) + c_static_assert(sizeof(a) != sizeof(uintptr_t))) -#define c_ARRAYLEN(a) (intptr_t)(sizeof(a)/sizeof 0[a]) +#define c_arraylen(a) (intptr_t)(sizeof(a)/sizeof 0[a]) // Non-owning c-string typedef const char* crawstr; diff --git a/include/stc/cspan.h b/include/stc/cspan.h index ce3c33ce..ac3e9206 100644 --- a/include/stc/cspan.h +++ b/include/stc/cspan.h @@ -129,10 +129,10 @@ typedef struct { int32_t d[6]; } cspan_idx6; {.data=(container)->data, .shape={(int32_t)(container)->_len}} #define cspan_from_array(array) \ - {.data=(array) + c_static_assert(sizeof(array) != sizeof(void*)), .shape={c_ARRAYLEN(array)}} + {.data=(array) + c_static_assert(sizeof(array) != sizeof(void*)), .shape={c_arraylen(array)}} #define cspan_size(self) _cspan_size((self)->shape, cspan_rank(self)) -#define cspan_rank(self) c_ARRAYLEN((self)->shape) +#define cspan_rank(self) c_arraylen((self)->shape) #define cspan_index(self, ...) c_PASTE(cspan_idx_, c_NUMARGS(__VA_ARGS__))(self, __VA_ARGS__) #define cspan_idx_1 cspan_idx_4 |
