style: add clang-format style rules

This commit is contained in:
Bert Belder 2017-09-01 14:15:59 +02:00
parent 3177e98bb4
commit c7ebd8f042
3 changed files with 30 additions and 0 deletions

22
.clang-format Normal file
View File

@ -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

View File

@ -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) \

View File

@ -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_ */