From 9f5e8d12f05fb24c915a5266a1e908a75c8aed08 Mon Sep 17 00:00:00 2001 From: Thibault "bui" Koechlin Date: Thu, 28 Dec 2017 17:04:06 +0100 Subject: Clang-format pass - `clang-format --style="{BasedOnStyle: google, SortIncludes: false}" -i snuffleu*.c sp_*.c sp_*.h` - Update the documentation accordingly--- src/sp_utils.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/sp_utils.h') diff --git a/src/sp_utils.h b/src/sp_utils.h index e54f307..e055e70 100644 --- a/src/sp_utils.h +++ b/src/sp_utils.h @@ -9,13 +9,13 @@ #include "sp_list.h" #if defined(__GNUC__) -# if __GNUC__ >= 3 -# define sp_pure __attribute__((pure)) -# define sp_const __attribute__((const)) -# else -# define sp_pure -# define sp_const -# endif +#if __GNUC__ >= 3 +#define sp_pure __attribute__((pure)) +#define sp_const __attribute__((const)) +#else +#define sp_pure +#define sp_const +#endif #endif /* The dump filename are of the form * `sp_dump_DATE_IPADDR.dump`, with: @@ -34,7 +34,8 @@ #define SHA256_SIZE 32 #define HOOK_FUNCTION(original_name, hook_table, new_function, execution) \ - hook_function(original_name, SNUFFLEUPAGUS_G(hook_table), new_function, execution) + hook_function(original_name, SNUFFLEUPAGUS_G(hook_table), new_function, \ + execution) #define HOOK_FUNCTION_BY_REGEXP(regexp, hook_table, new_function, execution) \ hook_regexp(regexp, SNUFFLEUPAGUS_G(hook_table), new_function, execution) @@ -46,14 +47,14 @@ #define sp_log_err(feature, ...) sp_log_msg(feature, SP_LOG_ERROR, __VA_ARGS__) #ifdef SP_DEBUG - #define sp_log_debug(...) sp_log_msg("DEBUG", SP_LOG_DEBUG, __VA_ARGS__) +#define sp_log_debug(...) sp_log_msg("DEBUG", SP_LOG_DEBUG, __VA_ARGS__) #else - #define sp_log_debug(...) +#define sp_log_debug(...) #endif -#define GET_SUFFIX(x) (x==1)?"st":((x==2)?"nd":"th") +#define GET_SUFFIX(x) (x == 1) ? "st" : ((x == 2) ? "nd" : "th") -void sp_log_msg(char const *feature, char const *level, const char* fmt, ...); +void sp_log_msg(char const *feature, char const *level, const char *fmt, ...); int compute_hash(const char *const filename, char *file_hash); char *sp_convert_to_string(zval *); bool sp_match_value(const char *, const char *, const pcre *); -- cgit v1.3