Skip to content
Snippets Groups Projects
Commit b2c4468c authored by rswindell's avatar rswindell
Browse files

Create ZERO_VAR and ZERO_ARRAY convenience macros

(getting tired of typing "memset(var,0,sizeof(var))").
parent a7523fde
No related branches found
No related tags found
No related merge requests found
...@@ -217,6 +217,10 @@ typedef struct { ...@@ -217,6 +217,10 @@ typedef struct {
#define SKIP_HEXDIGIT(p) while(*(p) && isxdigit(*(p))) (p)++; #define SKIP_HEXDIGIT(p) while(*(p) && isxdigit(*(p))) (p)++;
#define FIND_HEXDIGIT(p) while(*(p) && !isxdigit(*(p))) (p)++; #define FIND_HEXDIGIT(p) while(*(p) && !isxdigit(*(p))) (p)++;
/* Variable/buffer initialization (with zeros) */
#define ZERO_VAR(var) memset(&var,0,sizeof(var))
#define ZERO_ARRAY(array) memset(array,0,sizeof(array))
/****************************************************************************/ /****************************************************************************/
/* MALLOC/FREE Macros for various compilers and environments */ /* MALLOC/FREE Macros for various compilers and environments */
/* MALLOC is used for allocations of 64k or less */ /* MALLOC is used for allocations of 64k or less */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment