mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-04-11 09:06:13 +00:00
refactoring
This commit is contained in:
@@ -29,12 +29,12 @@
|
|||||||
#include "formatters.h"
|
#include "formatters.h"
|
||||||
|
|
||||||
|
|
||||||
#define CASE_TO_STRING(_val) \
|
#define CASE_TO_STRING(_value) \
|
||||||
case _val: { return #_val; }
|
case _value: { return #_value; }
|
||||||
|
|
||||||
#define CASE_ASSERT(_msg, _val) default: { \
|
#define CASE_ASSERT(_msg, _value) default: { \
|
||||||
char *_buf; A_CALLOC(_buf, 128); \
|
char *_buf; A_CALLOC(_buf, 128); \
|
||||||
sprintf(_buf, _msg ": 0x%08x", _val); \
|
sprintf(_buf, _msg ": 0x%08x", _value); \
|
||||||
assert(0 && _buf); \
|
assert(0 && _buf); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,8 @@
|
|||||||
|
|
||||||
#define A_CALLOC(_dest, _nmemb) assert((_dest = calloc(_nmemb, sizeof(*(_dest)))))
|
#define A_CALLOC(_dest, _nmemb) assert((_dest = calloc(_nmemb, sizeof(*(_dest)))))
|
||||||
#define A_REALLOC(_dest, _nmemb) assert((_dest = realloc(_dest, _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(_obj) memset(&(_obj), 0, sizeof(_obj))
|
||||||
#define MEMSET_ZERO_PTR(_x_ptr) memset(_x_ptr, 0, sizeof(*(_x_ptr)))
|
#define MEMSET_ZERO_PTR(_ptr) memset(_ptr, 0, sizeof(*(_ptr)))
|
||||||
|
|
||||||
|
|
||||||
#define INLINE inline __attribute__((always_inline))
|
#define INLINE inline __attribute__((always_inline))
|
||||||
|
|||||||
Reference in New Issue
Block a user