diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..21fe245 --- /dev/null +++ b/.clang-format @@ -0,0 +1,22 @@ +--- +Language: Cpp +BasedOnStyle: Google + +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakTemplateDeclarations: true +BinPackArguments: false +BinPackParameters: false +BreakBeforeBraces: Attach +ColumnLimit: 79 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +IndentWrappedFunctionNames: true +MaxEmptyLinesToKeep: 1 +PointerAlignment: Left +SpaceAfterCStyleCast: true +SpacesInContainerLiterals: false + +# Alas, not supported: +# ForceEmptyLineAtEOF: true diff --git a/src/msafd.h b/src/msafd.h index 83b2088..9baf1f4 100644 --- a/src/msafd.h +++ b/src/msafd.h @@ -9,6 +9,8 @@ # define SIO_BASE_HANDLE 0x48000022 #endif +/* clang-format off */ + #define AFD_NO_FAST_IO 0x00000001 #define AFD_OVERLAPPED 0x00000002 #define AFD_IMMEDIATE 0x00000004 @@ -39,6 +41,8 @@ #define AFD_NUM_POLL_EVENTS 11 #define AFD_POLL_ALL ((1 << AFD_NUM_POLL_EVENTS) - 1) +/* clang-format on */ + #define FSCTL_AFD_BASE FILE_DEVICE_NETWORK #define _AFD_CONTROL_CODE(operation, method) \ diff --git a/src/tree.h b/src/tree.h index 4d7ea1b..65a4a8d 100644 --- a/src/tree.h +++ b/src/tree.h @@ -53,6 +53,8 @@ #ifndef EPOLL_TREE_H_ #define EPOLL_TREE_H_ +/* clang-format off */ + #define SPLAY_HEAD(name, type) \ struct name { \ struct type *sph_root; /* root of the tree */ \ @@ -757,4 +759,6 @@ name##_RB_MINMAX(struct name *head, int val) \ ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \ (x) = (y)) +/* clang-format on */ + #endif /* EPOLL_TREE_H_ */