diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2017-03-31 16:37:23 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2017-03-31 17:59:48 +0200 |
commit | fa7fe831aace83d919df3792fccd264dc5ce94ea (patch) | |
tree | c2dcce94871dddab76c171d7794e0426a1387770 /lib/memory.h | |
parent | lib: memtypes: restore atomicity (diff) | |
download | frr-fa7fe831aace83d919df3792fccd264dc5ce94ea.tar.xz frr-fa7fe831aace83d919df3792fccd264dc5ce94ea.zip |
lib: Linux indentation on memory.[ch]
The fact that I originally wrote this in Linux Kernel style and then
reindented it to GNU makes me want to gouge my eyes out every time I
look at it. Restore original indentation.
[This patch is whitespace-only.]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/memory.h')
-rw-r--r-- | lib/memory.h | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/lib/memory.h b/lib/memory.h index 284a1b13c..9e8803a8b 100644 --- a/lib/memory.h +++ b/lib/memory.h @@ -23,19 +23,17 @@ #define array_size(ar) (sizeof(ar) / sizeof(ar[0])) #define SIZE_VAR ~0UL -struct memtype -{ - struct memtype *next, **ref; - const char *name; - _Atomic size_t n_alloc; - _Atomic size_t size; +struct memtype { + struct memtype *next, **ref; + const char *name; + _Atomic size_t n_alloc; + _Atomic size_t size; }; -struct memgroup -{ - struct memgroup *next, **ref; - struct memtype *types, **insert; - const char *name; +struct memgroup { + struct memgroup *next, **ref; + struct memtype *types, **insert; + const char *name; }; #if defined(__clang__) @@ -83,14 +81,14 @@ struct memgroup * DEFINE_MGROUP(MYDAEMON, "my daemon memory") * DEFINE_MTYPE(MYDAEMON, MYDAEMON_COMMON, * "this mtype is used in multiple files in mydaemon") - * foo = qmalloc (MTYPE_MYDAEMON_COMMON, sizeof (*foo)) + * foo = qmalloc(MTYPE_MYDAEMON_COMMON, sizeof(*foo)) * * mydaemon_io.c - * bar = qmalloc (MTYPE_MYDAEMON_COMMON, sizeof (*bar)) + * bar = qmalloc(MTYPE_MYDAEMON_COMMON, sizeof(*bar)) * * DEFINE_MTYPE_STATIC(MYDAEMON, MYDAEMON_IO, * "this mtype is used only in this file") - * baz = qmalloc (MTYPE_MYDAEMON_IO, sizeof (*baz)) + * baz = qmalloc(MTYPE_MYDAEMON_IO, sizeof(*baz)) * * Note: Naming conventions (MGROUP_ and MTYPE_ prefixes are enforced * by not having these as part of the macro arguments) @@ -156,15 +154,15 @@ DECLARE_MGROUP(LIB) DECLARE_MTYPE(TMP) -extern void *qmalloc (struct memtype *mt, size_t size) +extern void *qmalloc(struct memtype *mt, size_t size) __attribute__ ((malloc, _ALLOC_SIZE(2), nonnull (1) _RET_NONNULL)); -extern void *qcalloc (struct memtype *mt, size_t size) +extern void *qcalloc(struct memtype *mt, size_t size) __attribute__ ((malloc, _ALLOC_SIZE(2), nonnull (1) _RET_NONNULL)); -extern void *qrealloc (struct memtype *mt, void *ptr, size_t size) +extern void *qrealloc(struct memtype *mt, void *ptr, size_t size) __attribute__ ((_ALLOC_SIZE(3), nonnull (1) _RET_NONNULL)); extern void *qstrdup (struct memtype *mt, const char *str) __attribute__ ((malloc, nonnull (1) _RET_NONNULL)); -extern void qfree (struct memtype *mt, void *ptr) +extern void qfree(struct memtype *mt, void *ptr) __attribute__ ((nonnull (1))); #define XMALLOC(mtype, size) qmalloc(mtype, size) @@ -184,10 +182,10 @@ static inline size_t mtype_stats_alloc(struct memtype *mt) * * return value: 0: continue, !0: abort walk. qmem_walk will return the * last value from qmem_walk_fn. */ -typedef int qmem_walk_fn (void *arg, struct memgroup *mg, struct memtype *mt); -extern int qmem_walk (qmem_walk_fn *func, void *arg); -extern void log_memstats_stderr (const char *); +typedef int qmem_walk_fn(void *arg, struct memgroup *mg, struct memtype *mt); +extern int qmem_walk(qmem_walk_fn *func, void *arg); +extern void log_memstats_stderr(const char *); -extern void memory_oom (size_t size, const char *name); +extern void memory_oom(size_t size, const char *name); #endif /* _QUAGGA_MEMORY_H */ |