From 239ff93f772d84de9e52eb9c9fe7f5e5f358f123 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 20 Apr 2023 23:22:18 +0900 Subject: [PATCH] format: indent pre-processor block Closes GH-33 --- .clang-format | 1 + src/afs.cc | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.clang-format b/.clang-format index b7364a5..c13feef 100644 --- a/.clang-format +++ b/.clang-format @@ -37,3 +37,4 @@ UseTab: AlignWithSpaces # Project style BinPackArguments: false BinPackParameters: false +IndentPPDirectives: AfterHash diff --git a/src/afs.cc b/src/afs.cc index bb8b5fc..12798c8 100644 --- a/src/afs.cc +++ b/src/afs.cc @@ -52,15 +52,15 @@ extern "C" #include #ifdef __GNUC__ -#define AFS_FUNC __PRETTY_FUNCTION__ +# define AFS_FUNC __PRETTY_FUNCTION__ #else -#define AFS_FUNC __func__ +# define AFS_FUNC __func__ #endif #ifdef AFS_DEBUG -#define P(...) ereport(DEBUG5, errmsg_internal(__VA_ARGS__)) +# define P(...) ereport(DEBUG5, errmsg_internal(__VA_ARGS__)) #else -#define P(...) +# define P(...) #endif extern "C" @@ -747,16 +747,24 @@ class Executor : public WorkerProcessor { } } - if (((iTuple + 1) % MaxNRowsPerRecordBatch) == 0) { + if (((iTuple + 1) % MaxNRowsPerRecordBatch) == 0) + { ARROW_ASSIGN_OR_RAISE(recordBatch, builder->Flush()); - P("%s: %s: write: data: WriteRecordBatch: %d/%d", Tag, tag_, iTuple, SPI_processed); + P("%s: %s: write: data: WriteRecordBatch: %d/%d", + Tag, + tag_, + iTuple, + SPI_processed); ARROW_RETURN_NOT_OK(writer->WriteRecordBatch(*recordBatch)); needLastFlush = false; - } else { + } + else + { needLastFlush = true; } } - if (needLastFlush) { + if (needLastFlush) + { ARROW_ASSIGN_OR_RAISE(recordBatch, builder->Flush()); P("%s: %s: write: data: WriteRecordBatch", Tag, tag_); ARROW_RETURN_NOT_OK(writer->WriteRecordBatch(*recordBatch));