Skip to content

Commit

Permalink
Enable IndentPPDirectives
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Jun 9, 2018
1 parent bda7e07 commit 880f948
Show file tree
Hide file tree
Showing 107 changed files with 315 additions and 315 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ IncludeCategories:
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentPPDirectives: AfterHash
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
Expand Down
4 changes: 2 additions & 2 deletions examples/asio-sv2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif // HAVE_FCNTL_H
#include <iostream>
#include <string>
Expand Down
12 changes: 6 additions & 6 deletions examples/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@
* intentionally made simple.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <inttypes.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif /* HAVE_FCNTL_H */
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif /* HAVE_NETDB_H */
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#include <netinet/tcp.h>
#include <poll.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* !HAVE_CONFIG_H */

#include <stdio.h>
Expand Down
24 changes: 12 additions & 12 deletions examples/libevent-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,33 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef __sgi
#include <string.h>
#define errx(exitcode, format, args...) \
{ \
warnx(format, ##args); \
exit(exitcode); \
}
#define warnx(format, args...) fprintf(stderr, format "\n", ##args)
# include <string.h>
# define errx(exitcode, format, args...) \
{ \
warnx(format, ##args); \
exit(exitcode); \
}
# define warnx(format, args...) fprintf(stderr, format "\n", ##args)
char *strndup(const char *s, size_t size);
#endif

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#include <netinet/tcp.h>
#ifndef __sgi
#include <err.h>
# include <err.h>
#endif
#include <signal.h>
#include <string.h>
Expand Down
28 changes: 14 additions & 14 deletions examples/libevent-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,41 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef __sgi
#define errx(exitcode, format, args...) \
{ \
warnx(format, ##args); \
exit(exitcode); \
}
#define warn(format, args...) warnx(format ": %s", ##args, strerror(errno))
#define warnx(format, args...) fprintf(stderr, format "\n", ##args)
# define errx(exitcode, format, args...) \
{ \
warnx(format, ##args); \
exit(exitcode); \
}
# define warn(format, args...) warnx(format ": %s", ##args, strerror(errno))
# define warnx(format, args...) fprintf(stderr, format "\n", ##args)
#endif

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif /* HAVE_NETDB_H */
#include <signal.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#include <sys/stat.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif /* HAVE_FCNTL_H */
#include <ctype.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#include <netinet/tcp.h>
#ifndef __sgi
#include <err.h>
# include <err.h>
#endif
#include <string.h>
#include <errno.h>
Expand Down
32 changes: 16 additions & 16 deletions lib/includes/nghttp2/nghttp2.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/* Define WIN32 when build target is Win32 API (borrowed from
libcurl) */
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
#define WIN32
# define WIN32
#endif

#ifdef __cplusplus
Expand All @@ -40,30 +40,30 @@ extern "C" {
/* MSVC < 2013 does not have inttypes.h because it is not C99
compliant. See compiler macros and version number in
https://sourceforge.net/p/predef/wiki/Compilers/ */
#include <stdint.h>
# include <stdint.h>
#else /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */
#include <inttypes.h>
# include <inttypes.h>
#endif /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */
#include <sys/types.h>
#include <stdarg.h>

#include <nghttp2/nghttp2ver.h>

#ifdef NGHTTP2_STATICLIB
#define NGHTTP2_EXTERN
# define NGHTTP2_EXTERN
#elif defined(WIN32)
#ifdef BUILDING_NGHTTP2
#define NGHTTP2_EXTERN __declspec(dllexport)
#else /* !BUILDING_NGHTTP2 */
#define NGHTTP2_EXTERN __declspec(dllimport)
#endif /* !BUILDING_NGHTTP2 */
#else /* !defined(WIN32) */
#ifdef BUILDING_NGHTTP2
#define NGHTTP2_EXTERN __attribute__((visibility("default")))
#else /* !BUILDING_NGHTTP2 */
#define NGHTTP2_EXTERN
#endif /* !BUILDING_NGHTTP2 */
#endif /* !defined(WIN32) */
# ifdef BUILDING_NGHTTP2
# define NGHTTP2_EXTERN __declspec(dllexport)
# else /* !BUILDING_NGHTTP2 */
# define NGHTTP2_EXTERN __declspec(dllimport)
# endif /* !BUILDING_NGHTTP2 */
#else /* !defined(WIN32) */
# ifdef BUILDING_NGHTTP2
# define NGHTTP2_EXTERN __attribute__((visibility("default")))
# else /* !BUILDING_NGHTTP2 */
# define NGHTTP2_EXTERN
# endif /* !BUILDING_NGHTTP2 */
#endif /* !defined(WIN32) */

/**
* @macro
Expand Down
2 changes: 1 addition & 1 deletion lib/nghttp2_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_BUF_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/nghttp2_callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_CALLBACKS_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>
Expand Down
10 changes: 5 additions & 5 deletions lib/nghttp2_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
#define NGHTTP2_DEBUG_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>

#ifdef DEBUGBUILD
#define DEBUGF(...) nghttp2_debug_vprintf(__VA_ARGS__)
# define DEBUGF(...) nghttp2_debug_vprintf(__VA_ARGS__)
void nghttp2_debug_vprintf(const char *format, ...);
#else
#define DEBUGF(...) \
do { \
} while (0)
# define DEBUGF(...) \
do { \
} while (0)
#endif

#endif /* NGHTTP2_DEBUG_H */
2 changes: 1 addition & 1 deletion lib/nghttp2_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_FRAME_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/nghttp2_hd.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_HD_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/nghttp2_hd_huffman.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_HD_HUFFMAN_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/nghttp2_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_HELPER_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/nghttp2_http.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_HTTP_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/nghttp2_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_INT_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/nghttp2_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_MAP_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/nghttp2_mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_MEM_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>
Expand Down
16 changes: 8 additions & 8 deletions lib/nghttp2_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
#define NGHTTP2_NET_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
# include <arpa/inet.h>
#endif /* HAVE_ARPA_INET_H */

#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */

#include <nghttp2/nghttp2.h>
Expand All @@ -44,11 +44,11 @@
define inline functions for those function so that we don't have
dependeny on that lib. */

#ifdef _MSC_VER
#define STIN static __inline
#else
#define STIN static inline
#endif
# ifdef _MSC_VER
# define STIN static __inline
# else
# define STIN static inline
# endif

STIN uint32_t htonl(uint32_t hostlong) {
uint32_t res;
Expand Down
2 changes: 1 addition & 1 deletion lib/nghttp2_npn.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_NPN_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/nghttp2_option.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_OPTION_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/nghttp2_outbound_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define NGHTTP2_OUTBOUND_ITEM_H

#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */

#include <nghttp2/nghttp2.h>
Expand Down
Loading

0 comments on commit 880f948

Please sign in to comment.