Fix a bunch of trivial whitespace mistakes and update the miniobj.h
file before the real work starts.
This commit is contained in:
parent
d25b0b98bc
commit
fb4f617201
@ -48,7 +48,7 @@ struct fifolog_reader {
|
||||
#define FIFOLOG_READER_MAGIC 0x1036d139
|
||||
struct fifolog_file *ff;
|
||||
unsigned olen;
|
||||
unsigned char *obuf;
|
||||
unsigned char *obuf;
|
||||
time_t now;
|
||||
};
|
||||
|
||||
|
@ -52,12 +52,12 @@
|
||||
|
||||
|
||||
const char *fifolog_write_statnames[] = {
|
||||
[FIFOLOG_PT_BYTES_PRE] = "Bytes before compression",
|
||||
[FIFOLOG_PT_BYTES_POST] = "Bytes after compression",
|
||||
[FIFOLOG_PT_WRITES] = "Writes",
|
||||
[FIFOLOG_PT_FLUSH] = "Flushes",
|
||||
[FIFOLOG_PT_SYNC] = "Syncs",
|
||||
[FIFOLOG_PT_RUNTIME] = "Runtime"
|
||||
[FIFOLOG_PT_BYTES_PRE] = "Bytes before compression",
|
||||
[FIFOLOG_PT_BYTES_POST] = "Bytes after compression",
|
||||
[FIFOLOG_PT_WRITES] = "Writes",
|
||||
[FIFOLOG_PT_FLUSH] = "Flushes",
|
||||
[FIFOLOG_PT_SYNC] = "Syncs",
|
||||
[FIFOLOG_PT_RUNTIME] = "Runtime"
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -26,11 +26,11 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#define ALLOC_OBJ(to, type_magic) \
|
||||
#define ALLOC_OBJ(to, type_magic) \
|
||||
do { \
|
||||
(to) = calloc(sizeof *(to), 1); \
|
||||
assert((to) != NULL); \
|
||||
(to)->magic = (type_magic); \
|
||||
if ((to) != NULL) \
|
||||
(to)->magic = (type_magic); \
|
||||
} while (0)
|
||||
|
||||
#define FREE_OBJ(to) \
|
||||
@ -39,6 +39,9 @@
|
||||
free(to); \
|
||||
} while (0)
|
||||
|
||||
#define VALID_OBJ(ptr, type_magic) \
|
||||
((ptr) != NULL && (ptr)->magic == (type_magic))
|
||||
|
||||
#define CHECK_OBJ(ptr, type_magic) \
|
||||
do { \
|
||||
assert((ptr)->magic == type_magic); \
|
||||
@ -50,6 +53,12 @@
|
||||
assert((ptr)->magic == type_magic); \
|
||||
} while (0)
|
||||
|
||||
#define CHECK_OBJ_ORNULL(ptr, type_magic) \
|
||||
do { \
|
||||
if ((ptr) != NULL) \
|
||||
assert((ptr)->magic == type_magic); \
|
||||
} while (0)
|
||||
|
||||
#define CAST_OBJ(to, from, type_magic) \
|
||||
do { \
|
||||
(to) = (from); \
|
||||
@ -57,10 +66,9 @@
|
||||
CHECK_OBJ((to), (type_magic)); \
|
||||
} while (0)
|
||||
|
||||
#define CAST_OBJ_NOTNULL(to, from, type_magic) \
|
||||
#define CAST_OBJ_NOTNULL(to, from, type_magic) \
|
||||
do { \
|
||||
(to) = (from); \
|
||||
assert((to) != NULL); \
|
||||
CHECK_OBJ((to), (type_magic)); \
|
||||
} while (0)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user