diff options
| author | Wiimm <wiimm@wiimm.de> | 2024-02-23 16:02:06 +0100 |
|---|---|---|
| committer | Wiimm <wiimm@wiimm.de> | 2024-02-23 16:02:06 +0100 |
| commit | b8aca433e32346c9293acc34a9e2242809ac5692 (patch) | |
| tree | c6520d8571fa3e13ec189529aaf52fb86d828085 /project/dclib/dclib-basics.h | |
| parent | 685554b2c272fdefc23bb1d237c059b52ab5fc58 (diff) | |
SZS v2.41b
Diffstat (limited to 'project/dclib/dclib-basics.h')
| -rw-r--r-- | project/dclib/dclib-basics.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/project/dclib/dclib-basics.h b/project/dclib/dclib-basics.h index dd56ecb..b47e74a 100644 --- a/project/dclib/dclib-basics.h +++ b/project/dclib/dclib-basics.h @@ -80,6 +80,8 @@ #define SIZEOFRANGE(type,a,b) \ ( offsetof(type,b) + sizeof(((type*)0)->b) - offsetof(type,a) ) +#define NUM_OF_ELEMENTS(a) (sizeof(a)/sizeof(*(a))) + #define END_OF_VAR(v) ((void*)( (char*)(v) + sizeof(v) )) #define PTR_DISTANCE(a,b) ( (char*)(a) - (char*)(b) ) @@ -817,11 +819,14 @@ static inline mem_t MemByE ( ccp str, ccp end ) // Index helpers // For the 'End' variants, index 0 is end_of_source +// For the 'ex' variants, index 0 is end_of_source, but only for parem 'p_end' int CheckIndex1 ( int max, int index ); int CheckIndex1End ( int max, int index ); int CheckIndex2 ( int max, int * p_begin, int * p_end ); int CheckIndex2End ( int max, int * p_begin, int * p_end ); +int CheckIndex2 ( int max, int * p_begin, int * p_end ); +int CheckIndex2ex ( int max, int * p_begin, int * p_end ); int CheckIndexC ( int max, int * p_begin, int count ); int CheckIndexCEnd ( int max, int * p_begin, int count ); |
