refactoring

This commit is contained in:
Devaev Maxim 2018-10-01 18:10:12 +03:00
parent 895db6a8c9
commit 28daefc5ff
2 changed files with 6 additions and 6 deletions

View File

@ -29,12 +29,12 @@
#include "formatters.h"
#define CASE_TO_STRING(_val) \
case _val: { return #_val; }
#define CASE_TO_STRING(_value) \
case _value: { return #_value; }
#define CASE_ASSERT(_msg, _val) default: { \
#define CASE_ASSERT(_msg, _value) default: { \
char *_buf; A_CALLOC(_buf, 128); \
sprintf(_buf, _msg ": 0x%08x", _val); \
sprintf(_buf, _msg ": 0x%08x", _value); \
assert(0 && _buf); \
}

View File

@ -49,8 +49,8 @@
#define A_CALLOC(_dest, _nmemb) assert((_dest = calloc(_nmemb, sizeof(*(_dest)))))
#define A_REALLOC(_dest, _nmemb) assert((_dest = realloc(_dest, _nmemb * sizeof(*(_dest)))))
#define MEMSET_ZERO(_x_obj) memset(&(_x_obj), 0, sizeof(_x_obj))
#define MEMSET_ZERO_PTR(_x_ptr) memset(_x_ptr, 0, sizeof(*(_x_ptr)))
#define MEMSET_ZERO(_obj) memset(&(_obj), 0, sizeof(_obj))
#define MEMSET_ZERO_PTR(_ptr) memset(_ptr, 0, sizeof(*(_ptr)))
#define INLINE inline __attribute__((always_inline))