From 833cf5d2c817a44abb086ee89c5e47bfd4581faf Mon Sep 17 00:00:00 2001 From: Robert Swiecki Date: Tue, 8 Mar 2016 18:23:26 +0100 Subject: [PATCH] Indent --- common.h | 15 +++++++++------ net.c | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/common.h b/common.h index ca95342..a5b2087 100644 --- a/common.h +++ b/common.h @@ -34,13 +34,16 @@ #define _STRMERGE(a, b) a##b #ifdef __clang__ - static void __attribute__((unused)) _clang_cleanup_func(void (^*dfunc)(void)) { (*dfunc)(); } - #define defer(a) void (^_STRMERGE(__df_, __COUNTER__))(void) __attribute__((cleanup(_clang_cleanup_func))) __attribute__((unused)) = ^{ a; } -#else - #define __block - #define defer(a) void _STRMERGE(_cleanup_func_, __LINE__)(void *_STRMERGE(_cleanup_unused_, __LINE__) __attribute__((unused))) { a; } ; int _STRMERGE(_cleanup_var_, __LINE__) __attribute__((cleanup(_STRMERGE(_cleanup_func_, __LINE__)))) __attribute__((unused)) -#endif +static void __attribute__ ((unused)) _clang_cleanup_func(void (^*dfunc) (void)) +{ + (*dfunc) (); +} +#define defer(a) void (^_STRMERGE(__df_, __COUNTER__))(void) __attribute__((cleanup(_clang_cleanup_func))) __attribute__((unused)) = ^{ a; } +#else +#define __block +#define defer(a) void _STRMERGE(_cleanup_func_, __LINE__)(void *_STRMERGE(_cleanup_unused_, __LINE__) __attribute__((unused))) { a; } ; int _STRMERGE(_cleanup_var_, __LINE__) __attribute__((cleanup(_STRMERGE(_cleanup_func_, __LINE__)))) __attribute__((unused)) +#endif struct pids_t { pid_t pid; diff --git a/net.c b/net.c index a41a4c6..2ff6400 100644 --- a/net.c +++ b/net.c @@ -327,7 +327,7 @@ static bool netIfaceUp(const char *ifacename) PLOG_E("socket(AF_INET, SOCK_STREAM, IPPROTO_IP)"); return false; } - defer(close(sock)); + defer(close(sock)); struct ifreq ifr; memset(&ifr, '\0', sizeof(ifr));