diff --git a/.clang-format b/.clang-format index 91fa8f2..1d831c8 100644 --- a/.clang-format +++ b/.clang-format @@ -94,7 +94,7 @@ IncludeIsMainSourceRegex: "" IndentCaseLabels: false IndentCaseBlocks: false IndentGotoLabels: true -IndentPPDirectives: None +IndentPPDirectives: AfterHash IndentExternBlock: AfterExternBlock IndentRequires: false IndentWidth: 4 diff --git a/src/base64.c b/src/base64.c index 42a8429..c06a4cb 100644 --- a/src/base64.c +++ b/src/base64.c @@ -52,7 +52,7 @@ b64_to_bin(unsigned char *const bin, const char *b64, size_t bin_maxlen, size_t REV64_NONE, REV64_NONE, REV64_NONE, REV64_NONE }; const unsigned char *b64_u = (const unsigned char *) b64; - unsigned char * bin_w = bin; + unsigned char *bin_w = bin; unsigned char mask = 0U; unsigned char t0 = 0, t1 = 0, t2 = 0, t3 = 0; uint32_t t = 0; diff --git a/src/get_line.c b/src/get_line.c index 328de78..e29e2eb 100644 --- a/src/get_line.c +++ b/src/get_line.c @@ -1,6 +1,6 @@ #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__HAIKU__) -#include +# include #endif #include @@ -10,19 +10,19 @@ #include #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__HAIKU__) -#include -#include -#include -#include +# include +# include +# include +# include #elif defined(_WIN32) -#include +# include #endif #include "get_line.h" #include "helpers.h" #ifndef TCSAFLUSH -#define TCSAFLUSH 0 +# define TCSAFLUSH 0 #endif #ifndef VERIFY_ONLY @@ -33,7 +33,7 @@ disable_echo(void) fflush(stdout); fflush(stderr); -#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__HAIKU__) +# if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__HAIKU__) { struct termios p; @@ -43,7 +43,7 @@ disable_echo(void) p.c_lflag &= ~ECHO; tcsetattr(0, TCSAFLUSH, &p); } -#elif defined(_WIN32) +# elif defined(_WIN32) { HANDLE handle = GetStdHandle(STD_INPUT_HANDLE); DWORD mode = 0; @@ -51,7 +51,7 @@ disable_echo(void) GetConsoleMode(handle, &mode); SetConsoleMode(handle, mode & ~ENABLE_ECHO_INPUT); } -#endif +# endif } static void @@ -60,7 +60,7 @@ enable_echo(void) fflush(stdout); fflush(stderr); -#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__HAIKU__) +# if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__HAIKU__) { struct termios p; @@ -70,7 +70,7 @@ enable_echo(void) p.c_lflag |= ECHO; tcsetattr(0, TCSAFLUSH, &p); } -#elif defined(_WIN32) +# elif defined(_WIN32) { HANDLE handle = GetStdHandle(STD_INPUT_HANDLE); DWORD mode = 0; @@ -78,7 +78,7 @@ enable_echo(void) GetConsoleMode(handle, &mode); SetConsoleMode(handle, mode | ENABLE_ECHO_INPUT); } -#endif +# endif } int diff --git a/src/helpers.h b/src/helpers.h index ec76326..5ef815d 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -6,12 +6,12 @@ #include #if !defined(__GNUC__) && !defined(__attribute__) -#define __attribute__(X) +# define __attribute__(X) #endif #ifdef _WIN32 -#define DIR_SEP '\\' +# define DIR_SEP '\\' #else -#define DIR_SEP '/' +# define DIR_SEP '/' #endif uint64_t le64_load(const unsigned char *p);