You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2017/07/25 02:56:03 UTC

[7/7] arrow git commit: ARROW-1219: [C++] Use Google C++ code formatting

ARROW-1219: [C++] Use Google C++ code formatting

Our coding style guide has a ton of rules. I put up this patch to discuss since we don't have too many patches outstanding right now. This uses the exact Google style used in TensorFlow and other projects, but relaxes the column limit to 90 characters.

The main change is horizontal alignment in function signatures:

```diff
 void ValidateBasicStructArray(const StructArray* result,
-    const vector<uint8_t>& struct_is_valid, const vector<char>& list_values,
-    const vector<uint8_t>& list_is_valid, const vector<int>& list_lengths,
-    const vector<int>& list_offsets, const vector<int32_t>& int_values) {
+                              const vector<uint8_t>& struct_is_valid,
+                              const vector<char>& list_values,
+                              const vector<uint8_t>& list_is_valid,
+                              const vector<int>& list_lengths,
+                              const vector<int>& list_offsets,
+                              const vector<int32_t>& int_values) {
```

I find the paren-aligned version a bit more readable, but it's a matter of taste

Author: Wes McKinney <we...@twosigma.com>

Closes #848 from wesm/google-style and squashes the following commits:

9e8fe4fe [Wes McKinney] Move import to platform.h
8690257d [Wes McKinney] Use Google C++ code formatting


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/07b89bf3
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/07b89bf3
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/07b89bf3

Branch: refs/heads/master
Commit: 07b89bf3aaa6639303014bc173e3e371aed363c1
Parents: 204f148
Author: Wes McKinney <we...@twosigma.com>
Authored: Mon Jul 24 22:55:51 2017 -0400
Committer: Wes McKinney <we...@twosigma.com>
Committed: Mon Jul 24 22:55:51 2017 -0400

----------------------------------------------------------------------
 cpp/.clang-format                             |  65 +------
 cpp/src/arrow/allocator-test.cc               |   2 +-
 cpp/src/arrow/array-decimal-test.cc           |  73 ++++----
 cpp/src/arrow/array-test.cc                   | 108 +++++------
 cpp/src/arrow/array.cc                        | 141 +++++++++------
 cpp/src/arrow/array.h                         | 110 ++++++------
 cpp/src/arrow/buffer.cc                       |  41 +++--
 cpp/src/arrow/buffer.h                        |  62 ++++---
 cpp/src/arrow/builder-benchmark.cc            |  16 +-
 cpp/src/arrow/builder.cc                      | 196 +++++++++++---------
 cpp/src/arrow/builder.h                       |  63 ++++---
 cpp/src/arrow/compare.cc                      | 168 ++++++++++-------
 cpp/src/arrow/compare.h                       |  15 +-
 cpp/src/arrow/io/file.cc                      | 146 +++++++--------
 cpp/src/arrow/io/file.h                       |  12 +-
 cpp/src/arrow/io/hdfs-internal.cc             |  66 ++++---
 cpp/src/arrow/io/hdfs-internal.h              |  12 +-
 cpp/src/arrow/io/hdfs.cc                      | 155 ++++++++--------
 cpp/src/arrow/io/hdfs.h                       |  18 +-
 cpp/src/arrow/io/interfaces.cc                |  20 +--
 cpp/src/arrow/io/interfaces.h                 |   4 +-
 cpp/src/arrow/io/io-file-test.cc              |  29 +--
 cpp/src/arrow/io/io-hdfs-test.cc              |  29 +--
 cpp/src/arrow/io/memory.cc                    |  20 +--
 cpp/src/arrow/io/memory.h                     |   2 +-
 cpp/src/arrow/io/test-common.h                |   4 +-
 cpp/src/arrow/ipc/feather-internal.h          |   8 +-
 cpp/src/arrow/ipc/feather-test.cc             |   7 +-
 cpp/src/arrow/ipc/feather.cc                  | 146 +++++++--------
 cpp/src/arrow/ipc/feather.h                   |   6 +-
 cpp/src/arrow/ipc/file-to-stream.cc           |   2 +-
 cpp/src/arrow/ipc/ipc-json-test.cc            |  42 +++--
 cpp/src/arrow/ipc/ipc-read-write-benchmark.cc |   4 +-
 cpp/src/arrow/ipc/ipc-read-write-test.cc      |  92 +++++-----
 cpp/src/arrow/ipc/json-integration-test.cc    |  35 ++--
 cpp/src/arrow/ipc/json-internal.cc            |  92 +++++-----
 cpp/src/arrow/ipc/json-internal.h             |  10 +-
 cpp/src/arrow/ipc/json.cc                     |  32 ++--
 cpp/src/arrow/ipc/json.h                      |  10 +-
 cpp/src/arrow/ipc/metadata.cc                 | 198 +++++++++++----------
 cpp/src/arrow/ipc/metadata.h                  |  45 +++--
 cpp/src/arrow/ipc/reader.cc                   |  92 +++++-----
 cpp/src/arrow/ipc/reader.h                    |  29 +--
 cpp/src/arrow/ipc/stream-to-file.cc           |   2 +-
 cpp/src/arrow/ipc/test-common.h               |  87 ++++-----
 cpp/src/arrow/ipc/writer.cc                   | 159 +++++++++--------
 cpp/src/arrow/ipc/writer.h                    |  23 +--
 cpp/src/arrow/memory_pool-test.cc             |  10 +-
 cpp/src/arrow/memory_pool.cc                  |  30 ++--
 cpp/src/arrow/pretty_print-test.cc            |   2 +-
 cpp/src/arrow/pretty_print.cc                 |  62 ++++---
 cpp/src/arrow/python/arrow_to_pandas.cc       |  86 +++++----
 cpp/src/arrow/python/arrow_to_pandas.h        |  12 +-
 cpp/src/arrow/python/builtin_convert.cc       |  39 ++--
 cpp/src/arrow/python/builtin_convert.h        |  19 +-
 cpp/src/arrow/python/config.cc                |   2 -
 cpp/src/arrow/python/helpers.cc               |  16 +-
 cpp/src/arrow/python/helpers.h                |  13 +-
 cpp/src/arrow/python/init.cc                  |   4 +-
 cpp/src/arrow/python/io.cc                    |  24 +--
 cpp/src/arrow/python/numpy_convert.cc         |  43 +++--
 cpp/src/arrow/python/numpy_convert.h          |   4 +-
 cpp/src/arrow/python/pandas_to_arrow.cc       |  77 ++++----
 cpp/src/arrow/python/pandas_to_arrow.h        |   5 +-
 cpp/src/arrow/python/platform.h               |   1 +
 cpp/src/arrow/python/pyarrow.cc               |  40 ++---
 cpp/src/arrow/python/pyarrow.h                |   4 +-
 cpp/src/arrow/python/python-test.cc           |  11 +-
 cpp/src/arrow/python/util/datetime.h          |   8 +-
 cpp/src/arrow/status.cc                       |   8 +-
 cpp/src/arrow/status.h                        |  24 ++-
 cpp/src/arrow/table-test.cc                   |  10 +-
 cpp/src/arrow/table.cc                        |  99 +++++++----
 cpp/src/arrow/table.h                         |  23 +--
 cpp/src/arrow/tensor.cc                       |  26 +--
 cpp/src/arrow/tensor.h                        |   8 +-
 cpp/src/arrow/test-util.h                     |  74 ++++----
 cpp/src/arrow/type-test.cc                    |   8 +-
 cpp/src/arrow/type.cc                         | 118 ++++++------
 cpp/src/arrow/type.h                          |  36 ++--
 cpp/src/arrow/type_traits.h                   |   7 +-
 cpp/src/arrow/util/bit-stream-utils.h         |  25 +--
 cpp/src/arrow/util/bit-util-test.cc           |  24 +--
 cpp/src/arrow/util/bit-util.cc                |  30 ++--
 cpp/src/arrow/util/bit-util.h                 | 179 ++++++-------------
 cpp/src/arrow/util/bpacking.h                 |  99 ++++-------
 cpp/src/arrow/util/compression-test.cc        |  38 ++--
 cpp/src/arrow/util/compression.h              |   5 +-
 cpp/src/arrow/util/compression_brotli.cc      |   9 +-
 cpp/src/arrow/util/compression_brotli.h       |   4 +-
 cpp/src/arrow/util/compression_lz4.cc         |  27 +--
 cpp/src/arrow/util/compression_lz4.h          |   4 +-
 cpp/src/arrow/util/compression_snappy.cc      |  14 +-
 cpp/src/arrow/util/compression_snappy.h       |   4 +-
 cpp/src/arrow/util/compression_zlib.cc        |  35 ++--
 cpp/src/arrow/util/compression_zlib.h         |   4 +-
 cpp/src/arrow/util/compression_zstd.cc        |  14 +-
 cpp/src/arrow/util/compression_zstd.h         |   4 +-
 cpp/src/arrow/util/cpu-info.cc                |  32 +++-
 cpp/src/arrow/util/decimal.cc                 |  60 ++++---
 cpp/src/arrow/util/decimal.h                  |  22 +--
 cpp/src/arrow/util/key_value_metadata.cc      |   4 +-
 cpp/src/arrow/util/key_value_metadata.h       |   4 +-
 cpp/src/arrow/util/logging.h                  |  33 ++--
 cpp/src/arrow/util/memory.h                   |  10 +-
 cpp/src/arrow/util/random.h                   |  14 +-
 cpp/src/arrow/util/rle-encoding-test.cc       |  31 ++--
 cpp/src/arrow/util/rle-encoding.h             |  26 +--
 cpp/src/arrow/util/sse-util.h                 |   4 +-
 cpp/src/arrow/util/stl.h                      |   4 +-
 cpp/src/arrow/util/string.h                   |   4 +-
 cpp/src/plasma/client.cc                      |  70 ++++----
 cpp/src/plasma/client.h                       |  18 +-
 cpp/src/plasma/common.cc                      |  10 +-
 cpp/src/plasma/common.h                       |   2 +-
 cpp/src/plasma/events.cc                      |  22 +--
 cpp/src/plasma/events.h                       |   2 +-
 cpp/src/plasma/eviction_policy.cc             |  22 +--
 cpp/src/plasma/eviction_policy.h              |  18 +-
 cpp/src/plasma/io.cc                          |  40 +++--
 cpp/src/plasma/malloc.cc                      |  20 +--
 cpp/src/plasma/plasma.cc                      |  14 +-
 cpp/src/plasma/plasma.h                       |   6 +-
 cpp/src/plasma/protocol.cc                    | 116 ++++++------
 cpp/src/plasma/protocol.h                     |  53 +++---
 cpp/src/plasma/store.cc                       |  68 ++++---
 cpp/src/plasma/store.h                        |   8 +-
 cpp/src/plasma/test/client_tests.cc           |   2 +-
 cpp/src/plasma/test/serialization_tests.cc    |  18 +-
 129 files changed, 2565 insertions(+), 2362 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/07b89bf3/cpp/.clang-format
----------------------------------------------------------------------
diff --git a/cpp/.clang-format b/cpp/.clang-format
index 33f282a..06453df 100644
--- a/cpp/.clang-format
+++ b/cpp/.clang-format
@@ -15,67 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 ---
-Language:        Cpp
-# BasedOnStyle:  Google
-AccessModifierOffset: -1
-AlignAfterOpenBracket: false
-AlignConsecutiveAssignments: false
-AlignEscapedNewlinesLeft: true
-AlignOperands:   true
-AlignTrailingComments: true
-AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: true
-AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: Inline
-AllowShortIfStatementsOnASingleLine: true
-AllowShortLoopsOnASingleLine: false
-AlwaysBreakAfterDefinitionReturnType: None
-AlwaysBreakBeforeMultilineStrings: true
-AlwaysBreakTemplateDeclarations: true
-BinPackArguments: true
-BinPackParameters: true
-BreakBeforeBinaryOperators: None
-BreakBeforeBraces: Attach
-BreakBeforeTernaryOperators: true
-BreakConstructorInitializersBeforeComma: false
-ColumnLimit: 90
-CommentPragmas:  '^ IWYU pragma:'
-ConstructorInitializerAllOnOneLineOrOnePerLine: true
-ConstructorInitializerIndentWidth: 4
-ContinuationIndentWidth: 4
-Cpp11BracedListStyle: true
+BasedOnStyle:  Google
 DerivePointerAlignment: false
-DisableFormat:   false
-ExperimentalAutoDetectBinPacking: false
-ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
-IndentCaseLabels: true
-IndentWidth:     2
-IndentWrappedFunctionNames: false
-KeepEmptyLinesAtTheStartOfBlocks: false
-MacroBlockBegin: ''
-MacroBlockEnd:   ''
-MaxEmptyLinesToKeep: 1
-NamespaceIndentation: None
-ObjCBlockIndentWidth: 2
-ObjCSpaceAfterProperty: false
-ObjCSpaceBeforeProtocolList: false
-PenaltyBreakBeforeFirstCallParameter: 1000
-PenaltyBreakComment: 300
-PenaltyBreakFirstLessLess: 120
-PenaltyBreakString: 1000
-PenaltyExcessCharacter: 1000000
-PenaltyReturnTypeOnItsOwnLine: 200
-PointerAlignment: Left
-SpaceAfterCStyleCast: false
-SpaceBeforeAssignmentOperators: true
-SpaceBeforeParens: ControlStatements
-SpaceInEmptyParentheses: false
-SpacesBeforeTrailingComments: 2
-SpacesInAngles:  false
-SpacesInContainerLiterals: true
-SpacesInCStyleCastParentheses: false
-SpacesInParentheses: false
-SpacesInSquareBrackets: false
-Standard:        Cpp11
-TabWidth:        8
-UseTab:          Never
+ColumnLimit: 90

http://git-wip-us.apache.org/repos/asf/arrow/blob/07b89bf3/cpp/src/arrow/allocator-test.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/allocator-test.cc b/cpp/src/arrow/allocator-test.cc
index 5a4e98d..f3a80cd 100644
--- a/cpp/src/arrow/allocator-test.cc
+++ b/cpp/src/arrow/allocator-test.cc
@@ -48,7 +48,7 @@ TEST(stl_allocator, FreeLargeMemory) {
 
 #ifndef NDEBUG
   EXPECT_EXIT(alloc.deallocate(data, 120), ::testing::ExitedWithCode(1),
-      ".*Check failed: \\(bytes_allocated_\\) >= \\(size\\)");
+              ".*Check failed: \\(bytes_allocated_\\) >= \\(size\\)");
 #endif
 
   alloc.deallocate(data, 100);

http://git-wip-us.apache.org/repos/asf/arrow/blob/07b89bf3/cpp/src/arrow/array-decimal-test.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/array-decimal-test.cc b/cpp/src/arrow/array-decimal-test.cc
index 0959d68..436ce9c 100644
--- a/cpp/src/arrow/array-decimal-test.cc
+++ b/cpp/src/arrow/array-decimal-test.cc
@@ -28,12 +28,12 @@ namespace decimal {
 template <typename T>
 class DecimalTestBase {
  public:
-  virtual std::vector<uint8_t> data(
-      const std::vector<T>& input, size_t byte_width) const = 0;
+  virtual std::vector<uint8_t> data(const std::vector<T>& input,
+                                    size_t byte_width) const = 0;
 
   void test(int precision, const std::vector<T>& draw,
-      const std::vector<uint8_t>& valid_bytes,
-      const std::vector<uint8_t>& sign_bitmap = {}, int64_t offset = 0) const {
+            const std::vector<uint8_t>& valid_bytes,
+            const std::vector<uint8_t>& sign_bitmap = {}, int64_t offset = 0) const {
     auto type = std::make_shared<DecimalType>(precision, 4);
     int byte_width = type->byte_width();
     auto pool = default_memory_pool();
@@ -63,8 +63,9 @@ class DecimalTestBase {
     ASSERT_OK(BitUtil::BytesToBits(valid_bytes, &expected_null_bitmap));
 
     int64_t expected_null_count = test::null_count(valid_bytes);
-    auto expected = std::make_shared<DecimalArray>(type, size, expected_data,
-        expected_null_bitmap, expected_null_count, offset, expected_sign_bitmap);
+    auto expected =
+        std::make_shared<DecimalArray>(type, size, expected_data, expected_null_bitmap,
+                                       expected_null_count, offset, expected_sign_bitmap);
 
     std::shared_ptr<Array> out;
     ASSERT_OK(builder->Finish(&out));
@@ -75,8 +76,8 @@ class DecimalTestBase {
 template <typename T>
 class DecimalTest : public DecimalTestBase<T> {
  public:
-  std::vector<uint8_t> data(
-      const std::vector<T>& input, size_t byte_width) const override {
+  std::vector<uint8_t> data(const std::vector<T>& input,
+                            size_t byte_width) const override {
     std::vector<uint8_t> result(input.size() * byte_width);
     // TODO(phillipc): There's probably a better way to do this
     constexpr static const size_t bytes_per_element = sizeof(T);
@@ -90,8 +91,8 @@ class DecimalTest : public DecimalTestBase<T> {
 template <>
 class DecimalTest<Decimal128> : public DecimalTestBase<Decimal128> {
  public:
-  std::vector<uint8_t> data(
-      const std::vector<Decimal128>& input, size_t byte_width) const override {
+  std::vector<uint8_t> data(const std::vector<Decimal128>& input,
+                            size_t byte_width) const override {
     std::vector<uint8_t> result;
     result.reserve(input.size() * byte_width);
     constexpr static const size_t bytes_per_element = 16;
@@ -120,24 +121,24 @@ class Decimal128BuilderTest : public ::testing::TestWithParam<int>,
 
 TEST_P(Decimal32BuilderTest, NoNulls) {
   int precision = GetParam();
-  std::vector<Decimal32> draw = {
-      Decimal32(1), Decimal32(2), Decimal32(2389), Decimal32(4), Decimal32(-12348)};
+  std::vector<Decimal32> draw = {Decimal32(1), Decimal32(2), Decimal32(2389),
+                                 Decimal32(4), Decimal32(-12348)};
   std::vector<uint8_t> valid_bytes = {true, true, true, true, true};
   this->test(precision, draw, valid_bytes);
 }
 
 TEST_P(Decimal64BuilderTest, NoNulls) {
   int precision = GetParam();
-  std::vector<Decimal64> draw = {
-      Decimal64(1), Decimal64(2), Decimal64(2389), Decimal64(4), Decimal64(-12348)};
+  std::vector<Decimal64> draw = {Decimal64(1), Decimal64(2), Decimal64(2389),
+                                 Decimal64(4), Decimal64(-12348)};
   std::vector<uint8_t> valid_bytes = {true, true, true, true, true};
   this->test(precision, draw, valid_bytes);
 }
 
 TEST_P(Decimal128BuilderTest, NoNulls) {
   int precision = GetParam();
-  std::vector<Decimal128> draw = {
-      Decimal128(1), Decimal128(-2), Decimal128(2389), Decimal128(4), Decimal128(-12348)};
+  std::vector<Decimal128> draw = {Decimal128(1), Decimal128(-2), Decimal128(2389),
+                                  Decimal128(4), Decimal128(-12348)};
   std::vector<uint8_t> valid_bytes = {true, true, true, true, true};
   std::vector<uint8_t> sign_bitmap = {false, true, false, false, true};
   this->test(precision, draw, valid_bytes, sign_bitmap);
@@ -145,41 +146,47 @@ TEST_P(Decimal128BuilderTest, NoNulls) {
 
 TEST_P(Decimal32BuilderTest, WithNulls) {
   int precision = GetParam();
-  std::vector<Decimal32> draw = {
-      Decimal32(1), Decimal32(2), Decimal32(-1), Decimal32(4), Decimal32(-1)};
+  std::vector<Decimal32> draw = {Decimal32(1), Decimal32(2), Decimal32(-1), Decimal32(4),
+                                 Decimal32(-1)};
   std::vector<uint8_t> valid_bytes = {true, true, false, true, false};
   this->test(precision, draw, valid_bytes);
 }
 
 TEST_P(Decimal64BuilderTest, WithNulls) {
   int precision = GetParam();
-  std::vector<Decimal64> draw = {
-      Decimal64(-1), Decimal64(2), Decimal64(-1), Decimal64(4), Decimal64(-1)};
+  std::vector<Decimal64> draw = {Decimal64(-1), Decimal64(2), Decimal64(-1), Decimal64(4),
+                                 Decimal64(-1)};
   std::vector<uint8_t> valid_bytes = {true, true, false, true, false};
   this->test(precision, draw, valid_bytes);
 }
 
 TEST_P(Decimal128BuilderTest, WithNulls) {
   int precision = GetParam();
-  std::vector<Decimal128> draw = {Decimal128(1), Decimal128(2), Decimal128(-1),
-      Decimal128(4), Decimal128(-1), Decimal128(1), Decimal128(2),
-      Decimal128("230342903942.234234"), Decimal128("-23049302932.235234")};
-  std::vector<uint8_t> valid_bytes = {
-      true, true, false, true, false, true, true, true, true};
-  std::vector<uint8_t> sign_bitmap = {
-      false, false, false, false, false, false, false, false, true};
+  std::vector<Decimal128> draw = {Decimal128(1),
+                                  Decimal128(2),
+                                  Decimal128(-1),
+                                  Decimal128(4),
+                                  Decimal128(-1),
+                                  Decimal128(1),
+                                  Decimal128(2),
+                                  Decimal128("230342903942.234234"),
+                                  Decimal128("-23049302932.235234")};
+  std::vector<uint8_t> valid_bytes = {true, true, false, true, false,
+                                      true, true, true,  true};
+  std::vector<uint8_t> sign_bitmap = {false, false, false, false, false,
+                                      false, false, false, true};
   this->test(precision, draw, valid_bytes, sign_bitmap);
 }
 
 INSTANTIATE_TEST_CASE_P(Decimal32BuilderTest, Decimal32BuilderTest,
-    ::testing::Range(
-        DecimalPrecision<int32_t>::minimum, DecimalPrecision<int32_t>::maximum));
+                        ::testing::Range(DecimalPrecision<int32_t>::minimum,
+                                         DecimalPrecision<int32_t>::maximum));
 INSTANTIATE_TEST_CASE_P(Decimal64BuilderTest, Decimal64BuilderTest,
-    ::testing::Range(
-        DecimalPrecision<int64_t>::minimum, DecimalPrecision<int64_t>::maximum));
+                        ::testing::Range(DecimalPrecision<int64_t>::minimum,
+                                         DecimalPrecision<int64_t>::maximum));
 INSTANTIATE_TEST_CASE_P(Decimal128BuilderTest, Decimal128BuilderTest,
-    ::testing::Range(
-        DecimalPrecision<int128_t>::minimum, DecimalPrecision<int128_t>::maximum));
+                        ::testing::Range(DecimalPrecision<int128_t>::minimum,
+                                         DecimalPrecision<int128_t>::maximum));
 
 }  // namespace decimal
 }  // namespace arrow

http://git-wip-us.apache.org/repos/asf/arrow/blob/07b89bf3/cpp/src/arrow/array-test.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/array-test.cc b/cpp/src/arrow/array-test.cc
index acb4819..5d63d92 100644
--- a/cpp/src/arrow/array-test.cc
+++ b/cpp/src/arrow/array-test.cc
@@ -64,8 +64,8 @@ TEST_F(TestArray, TestLength) {
   ASSERT_EQ(arr->length(), 100);
 }
 
-Status MakeArrayFromValidBytes(
-    const vector<uint8_t>& v, MemoryPool* pool, std::shared_ptr<Array>* out) {
+Status MakeArrayFromValidBytes(const vector<uint8_t>& v, MemoryPool* pool,
+                               std::shared_ptr<Array>* out) {
   int64_t null_count = v.size() - std::accumulate(v.begin(), v.end(), 0);
 
   std::shared_ptr<Buffer> null_buf;
@@ -147,7 +147,9 @@ TEST_F(TestArray, TestIsNull) {
   // clang-format on
   int64_t null_count = 0;
   for (uint8_t x : null_bitmap) {
-    if (x == 0) { ++null_count; }
+    if (x == 0) {
+      ++null_count;
+    }
   }
 
   std::shared_ptr<Buffer> null_buf;
@@ -223,8 +225,8 @@ class TestPrimitiveBuilder : public TestBuilder {
   void Check(const std::unique_ptr<BuilderType>& builder, bool nullable) {
     int64_t size = builder->length();
 
-    auto ex_data = std::make_shared<Buffer>(
-        reinterpret_cast<uint8_t*>(draws_.data()), size * sizeof(T));
+    auto ex_data = std::make_shared<Buffer>(reinterpret_cast<uint8_t*>(draws_.data()),
+                                            size * sizeof(T));
 
     std::shared_ptr<Buffer> ex_null_bitmap;
     int64_t ex_null_count = 0;
@@ -316,8 +318,8 @@ void TestPrimitiveBuilder<PBoolean>::RandomData(int64_t N, double pct_null) {
 }
 
 template <>
-void TestPrimitiveBuilder<PBoolean>::Check(
-    const std::unique_ptr<BooleanBuilder>& builder, bool nullable) {
+void TestPrimitiveBuilder<PBoolean>::Check(const std::unique_ptr<BooleanBuilder>& builder,
+                                           bool nullable) {
   int64_t size = builder->length();
 
   std::shared_ptr<Buffer> ex_data;
@@ -351,7 +353,9 @@ void TestPrimitiveBuilder<PBoolean>::Check(
   ASSERT_EQ(expected->length(), result->length());
 
   for (int64_t i = 0; i < result->length(); ++i) {
-    if (nullable) { ASSERT_EQ(valid_bytes_[i] == 0, result->IsNull(i)) << i; }
+    if (nullable) {
+      ASSERT_EQ(valid_bytes_[i] == 0, result->IsNull(i)) << i;
+    }
     bool actual = BitUtil::GetBit(result->values()->data(), i);
     ASSERT_EQ(draws_[i] != 0, actual) << i;
   }
@@ -359,7 +363,7 @@ void TestPrimitiveBuilder<PBoolean>::Check(
 }
 
 typedef ::testing::Types<PBoolean, PUInt8, PUInt16, PUInt32, PUInt64, PInt8, PInt16,
-    PInt32, PInt64, PFloat, PDouble>
+                         PInt32, PInt64, PFloat, PDouble>
     Primitives;
 
 TYPED_TEST_CASE(TestPrimitiveBuilder, Primitives);
@@ -377,7 +381,7 @@ TYPED_TEST(TestPrimitiveBuilder, TestInit) {
   ASSERT_OK(this->builder_->Reserve(n));
   ASSERT_EQ(BitUtil::NextPower2(n), this->builder_->capacity());
   ASSERT_EQ(BitUtil::NextPower2(TypeTraits<Type>::bytes_required(n)),
-      this->builder_->data()->size());
+            this->builder_->data()->size());
 
   // unsure if this should go in all builder classes
   ASSERT_EQ(0, this->builder_->num_children());
@@ -440,8 +444,8 @@ TYPED_TEST(TestPrimitiveBuilder, Equality) {
   ASSERT_OK(MakeArray(valid_bytes, draws, size, builder, &equal_array));
 
   // Make the not equal array by negating the first valid element with itself.
-  const auto first_valid = std::find_if(
-      valid_bytes.begin(), valid_bytes.end(), [](uint8_t valid) { return valid > 0; });
+  const auto first_valid = std::find_if(valid_bytes.begin(), valid_bytes.end(),
+                                        [](uint8_t valid) { return valid > 0; });
   const int64_t first_valid_idx = std::distance(valid_bytes.begin(), first_valid);
   // This should be true with a very high probability, but might introduce flakiness
   ASSERT_LT(first_valid_idx, size - 1);
@@ -679,8 +683,8 @@ class TestStringArray : public ::testing::Test {
     ASSERT_OK(BitUtil::BytesToBits(valid_bytes_, &null_bitmap_));
     null_count_ = test::null_count(valid_bytes_);
 
-    strings_ = std::make_shared<StringArray>(
-        length_, offsets_buf_, value_buf_, null_bitmap_, null_count_);
+    strings_ = std::make_shared<StringArray>(length_, offsets_buf_, value_buf_,
+                                             null_bitmap_, null_count_);
   }
 
  protected:
@@ -723,8 +727,8 @@ TEST_F(TestStringArray, TestListFunctions) {
 }
 
 TEST_F(TestStringArray, TestDestructor) {
-  auto arr = std::make_shared<StringArray>(
-      length_, offsets_buf_, value_buf_, null_bitmap_, null_count_);
+  auto arr = std::make_shared<StringArray>(length_, offsets_buf_, value_buf_,
+                                           null_bitmap_, null_count_);
 }
 
 TEST_F(TestStringArray, TestGetString) {
@@ -742,10 +746,10 @@ TEST_F(TestStringArray, TestEmptyStringComparison) {
   offsets_buf_ = test::GetBufferFromVector(offsets_);
   length_ = static_cast<int64_t>(offsets_.size() - 1);
 
-  auto strings_a = std::make_shared<StringArray>(
-      length_, offsets_buf_, nullptr, null_bitmap_, null_count_);
-  auto strings_b = std::make_shared<StringArray>(
-      length_, offsets_buf_, nullptr, null_bitmap_, null_count_);
+  auto strings_a = std::make_shared<StringArray>(length_, offsets_buf_, nullptr,
+                                                 null_bitmap_, null_count_);
+  auto strings_b = std::make_shared<StringArray>(length_, offsets_buf_, nullptr,
+                                                 null_bitmap_, null_count_);
   ASSERT_TRUE(strings_a->Equals(strings_b));
 }
 
@@ -893,8 +897,8 @@ class TestBinaryArray : public ::testing::Test {
     ASSERT_OK(BitUtil::BytesToBits(valid_bytes_, &null_bitmap_));
     null_count_ = test::null_count(valid_bytes_);
 
-    strings_ = std::make_shared<BinaryArray>(
-        length_, offsets_buf_, value_buf_, null_bitmap_, null_count_);
+    strings_ = std::make_shared<BinaryArray>(length_, offsets_buf_, value_buf_,
+                                             null_bitmap_, null_count_);
   }
 
  protected:
@@ -937,8 +941,8 @@ TEST_F(TestBinaryArray, TestListFunctions) {
 }
 
 TEST_F(TestBinaryArray, TestDestructor) {
-  auto arr = std::make_shared<BinaryArray>(
-      length_, offsets_buf_, value_buf_, null_bitmap_, null_count_);
+  auto arr = std::make_shared<BinaryArray>(length_, offsets_buf_, value_buf_,
+                                           null_bitmap_, null_count_);
 }
 
 TEST_F(TestBinaryArray, TestGetValue) {
@@ -965,8 +969,9 @@ TEST_F(TestBinaryArray, TestEqualsEmptyStrings) {
   ASSERT_OK(builder.Finish(&left_arr));
 
   const BinaryArray& left = static_cast<const BinaryArray&>(*left_arr);
-  std::shared_ptr<Array> right = std::make_shared<BinaryArray>(left.length(),
-      left.value_offsets(), nullptr, left.null_bitmap(), left.null_count());
+  std::shared_ptr<Array> right =
+      std::make_shared<BinaryArray>(left.length(), left.value_offsets(), nullptr,
+                                    left.null_bitmap(), left.null_count());
 
   ASSERT_TRUE(left.Equals(right));
   ASSERT_TRUE(left.RangeEquals(0, left.length(), 0, right));
@@ -1082,17 +1087,11 @@ void CheckSliceEquality() {
   ASSERT_TRUE(array->RangeEquals(5, 25, 0, slice));
 }
 
-TEST_F(TestBinaryArray, TestSliceEquality) {
-  CheckSliceEquality<BinaryType>();
-}
+TEST_F(TestBinaryArray, TestSliceEquality) { CheckSliceEquality<BinaryType>(); }
 
-TEST_F(TestStringArray, TestSliceEquality) {
-  CheckSliceEquality<BinaryType>();
-}
+TEST_F(TestStringArray, TestSliceEquality) { CheckSliceEquality<BinaryType>(); }
 
-TEST_F(TestBinaryArray, LengthZeroCtor) {
-  BinaryArray array(0, nullptr, nullptr);
-}
+TEST_F(TestBinaryArray, LengthZeroCtor) { BinaryArray array(0, nullptr, nullptr); }
 
 // ----------------------------------------------------------------------
 // FixedSizeBinary tests
@@ -1126,8 +1125,8 @@ TEST_F(TestFWBinaryArray, Builder) {
 
   std::shared_ptr<Array> result;
 
-  auto CheckResult = [this, &length, &is_valid, &raw_data, &byte_width](
-      const Array& result) {
+  auto CheckResult = [this, &length, &is_valid, &raw_data,
+                      &byte_width](const Array& result) {
     // Verify output
     const auto& fw_result = static_cast<const FixedSizeBinaryArray&>(result);
 
@@ -1135,8 +1134,8 @@ TEST_F(TestFWBinaryArray, Builder) {
 
     for (int64_t i = 0; i < result.length(); ++i) {
       if (is_valid[i]) {
-        ASSERT_EQ(
-            0, memcmp(raw_data + byte_width * i, fw_result.GetValue(i), byte_width));
+        ASSERT_EQ(0,
+                  memcmp(raw_data + byte_width * i, fw_result.GetValue(i), byte_width));
       } else {
         ASSERT_TRUE(fw_result.IsNull(i));
       }
@@ -1323,8 +1322,8 @@ TEST_F(TestAdaptiveIntBuilder, TestInt16) {
   SetUp();
   ASSERT_OK(builder_->Append(std::numeric_limits<int16_t>::max()));
   ASSERT_OK(builder_->Append(std::numeric_limits<int16_t>::min()));
-  expected_values = {
-      std::numeric_limits<int16_t>::max(), std::numeric_limits<int16_t>::min()};
+  expected_values = {std::numeric_limits<int16_t>::max(),
+                     std::numeric_limits<int16_t>::min()};
   Done();
 
   ArrayFromVector<Int16Type, int16_t>(expected_values, &expected_);
@@ -1354,8 +1353,8 @@ TEST_F(TestAdaptiveIntBuilder, TestInt32) {
   SetUp();
   ASSERT_OK(builder_->Append(std::numeric_limits<int32_t>::max()));
   ASSERT_OK(builder_->Append(std::numeric_limits<int32_t>::min()));
-  expected_values = {
-      std::numeric_limits<int32_t>::max(), std::numeric_limits<int32_t>::min()};
+  expected_values = {std::numeric_limits<int32_t>::max(),
+                     std::numeric_limits<int32_t>::min()};
   Done();
 
   ArrayFromVector<Int32Type, int32_t>(expected_values, &expected_);
@@ -1385,8 +1384,8 @@ TEST_F(TestAdaptiveIntBuilder, TestInt64) {
   SetUp();
   ASSERT_OK(builder_->Append(std::numeric_limits<int64_t>::max()));
   ASSERT_OK(builder_->Append(std::numeric_limits<int64_t>::min()));
-  expected_values = {
-      std::numeric_limits<int64_t>::max(), std::numeric_limits<int64_t>::min()};
+  expected_values = {std::numeric_limits<int64_t>::max(),
+                     std::numeric_limits<int64_t>::min()};
   Done();
 
   ArrayFromVector<Int64Type, int64_t>(expected_values, &expected_);
@@ -1505,7 +1504,7 @@ template <typename Type>
 class TestDictionaryBuilder : public TestBuilder {};
 
 typedef ::testing::Types<Int8Type, UInt8Type, Int16Type, UInt16Type, Int32Type,
-    UInt32Type, Int64Type, UInt64Type, FloatType, DoubleType>
+                         UInt32Type, Int64Type, UInt64Type, FloatType, DoubleType>
     PrimitiveDictionaries;
 
 TYPED_TEST_CASE(TestDictionaryBuilder, PrimitiveDictionaries);
@@ -1784,7 +1783,7 @@ TEST_F(TestListBuilder, TestAppendNull) {
 }
 
 void ValidateBasicListArray(const ListArray* result, const vector<int32_t>& values,
-    const vector<uint8_t>& is_valid) {
+                            const vector<uint8_t>& is_valid) {
   ASSERT_OK(ValidateArray(*result));
   ASSERT_EQ(1, result->null_count());
   ASSERT_EQ(0, result->values()->null_count());
@@ -1997,9 +1996,12 @@ TEST(TestDictionary, Validate) {
 // Struct tests
 
 void ValidateBasicStructArray(const StructArray* result,
-    const vector<uint8_t>& struct_is_valid, const vector<char>& list_values,
-    const vector<uint8_t>& list_is_valid, const vector<int>& list_lengths,
-    const vector<int>& list_offsets, const vector<int32_t>& int_values) {
+                              const vector<uint8_t>& struct_is_valid,
+                              const vector<char>& list_values,
+                              const vector<uint8_t>& list_is_valid,
+                              const vector<int>& list_lengths,
+                              const vector<int>& list_offsets,
+                              const vector<int32_t>& int_values) {
   ASSERT_EQ(4, result->length());
   ASSERT_OK(ValidateArray(*result));
 
@@ -2134,7 +2136,7 @@ TEST_F(TestStructBuilder, TestBasics) {
   Done();
 
   ValidateBasicStructArray(result_.get(), struct_is_valid, list_values, list_is_valid,
-      list_lengths, list_offsets, int_values);
+                           list_lengths, list_offsets, int_values);
 }
 
 TEST_F(TestStructBuilder, BulkAppend) {
@@ -2166,7 +2168,7 @@ TEST_F(TestStructBuilder, BulkAppend) {
 
   Done();
   ValidateBasicStructArray(result_.get(), struct_is_valid, list_values, list_is_valid,
-      list_lengths, list_offsets, int_values);
+                           list_lengths, list_offsets, int_values);
 }
 
 TEST_F(TestStructBuilder, BulkAppendInvalid) {
@@ -2280,7 +2282,7 @@ TEST_F(TestStructBuilder, TestEquality) {
   // setup an unequal one with unequal offsets
   ASSERT_OK(builder_->Append(struct_is_valid.size(), struct_is_valid.data()));
   ASSERT_OK(list_vb->Append(unequal_list_offsets.data(), unequal_list_offsets.size(),
-      unequal_list_is_valid.data()));
+                            unequal_list_is_valid.data()));
   for (int8_t value : list_values) {
     char_vb->UnsafeAppend(value);
   }

http://git-wip-us.apache.org/repos/asf/arrow/blob/07b89bf3/cpp/src/arrow/array.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/array.cc b/cpp/src/arrow/array.cc
index 4a405f2..61791c9 100644
--- a/cpp/src/arrow/array.cc
+++ b/cpp/src/arrow/array.cc
@@ -57,45 +57,57 @@ int64_t Array::null_count() const {
 bool Array::Equals(const Array& arr) const {
   bool are_equal = false;
   Status error = ArrayEquals(*this, arr, &are_equal);
-  if (!error.ok()) { DCHECK(false) << "Arrays not comparable: " << error.ToString(); }
+  if (!error.ok()) {
+    DCHECK(false) << "Arrays not comparable: " << error.ToString();
+  }
   return are_equal;
 }
 
 bool Array::Equals(const std::shared_ptr<Array>& arr) const {
-  if (!arr) { return false; }
+  if (!arr) {
+    return false;
+  }
   return Equals(*arr);
 }
 
 bool Array::ApproxEquals(const Array& arr) const {
   bool are_equal = false;
   Status error = ArrayApproxEquals(*this, arr, &are_equal);
-  if (!error.ok()) { DCHECK(false) << "Arrays not comparable: " << error.ToString(); }
+  if (!error.ok()) {
+    DCHECK(false) << "Arrays not comparable: " << error.ToString();
+  }
   return are_equal;
 }
 
 bool Array::ApproxEquals(const std::shared_ptr<Array>& arr) const {
-  if (!arr) { return false; }
+  if (!arr) {
+    return false;
+  }
   return ApproxEquals(*arr);
 }
 
 bool Array::RangeEquals(int64_t start_idx, int64_t end_idx, int64_t other_start_idx,
-    const std::shared_ptr<Array>& other) const {
-  if (!other) { return false; }
+                        const std::shared_ptr<Array>& other) const {
+  if (!other) {
+    return false;
+  }
   return RangeEquals(*other, start_idx, end_idx, other_start_idx);
 }
 
 bool Array::RangeEquals(const Array& other, int64_t start_idx, int64_t end_idx,
-    int64_t other_start_idx) const {
+                        int64_t other_start_idx) const {
   bool are_equal = false;
   Status error =
       ArrayRangeEquals(*this, other, start_idx, end_idx, other_start_idx, &are_equal);
-  if (!error.ok()) { DCHECK(false) << "Arrays not comparable: " << error.ToString(); }
+  if (!error.ok()) {
+    DCHECK(false) << "Arrays not comparable: " << error.ToString();
+  }
   return are_equal;
 }
 
 // Last two parameters are in-out parameters
-static inline void ConformSliceParams(
-    int64_t array_offset, int64_t array_length, int64_t* offset, int64_t* length) {
+static inline void ConformSliceParams(int64_t array_offset, int64_t array_length,
+                                      int64_t* offset, int64_t* length) {
   DCHECK_LE(*offset, array_length);
   DCHECK_NE(offset, nullptr);
   *length = std::min(array_length - *offset, *length);
@@ -113,8 +125,8 @@ std::string Array::ToString() const {
   return ss.str();
 }
 
-static inline std::shared_ptr<ArrayData> SliceData(
-    const ArrayData& data, int64_t offset, int64_t length) {
+static inline std::shared_ptr<ArrayData> SliceData(const ArrayData& data, int64_t offset,
+                                                   int64_t length) {
   ConformSliceParams(data.offset, data.length, &offset, &length);
 
   auto new_data = data.ShallowCopy();
@@ -139,8 +151,9 @@ std::shared_ptr<Array> NullArray::Slice(int64_t offset, int64_t length) const {
 // Primitive array base
 
 PrimitiveArray::PrimitiveArray(const std::shared_ptr<DataType>& type, int64_t length,
-    const std::shared_ptr<Buffer>& data, const std::shared_ptr<Buffer>& null_bitmap,
-    int64_t null_count, int64_t offset) {
+                               const std::shared_ptr<Buffer>& data,
+                               const std::shared_ptr<Buffer>& null_bitmap,
+                               int64_t null_count, int64_t offset) {
   BufferVector buffers = {null_bitmap, data};
   SetData(
       std::make_shared<ArrayData>(type, length, std::move(buffers), null_count, offset));
@@ -166,7 +179,8 @@ BooleanArray::BooleanArray(const std::shared_ptr<internal::ArrayData>& data)
 }
 
 BooleanArray::BooleanArray(int64_t length, const std::shared_ptr<Buffer>& data,
-    const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count, int64_t offset)
+                           const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count,
+                           int64_t offset)
     : PrimitiveArray(boolean(), length, data, null_bitmap, null_count, offset) {}
 
 std::shared_ptr<Array> BooleanArray::Slice(int64_t offset, int64_t length) const {
@@ -182,8 +196,10 @@ ListArray::ListArray(const std::shared_ptr<ArrayData>& data) {
 }
 
 ListArray::ListArray(const std::shared_ptr<DataType>& type, int64_t length,
-    const std::shared_ptr<Buffer>& value_offsets, const std::shared_ptr<Array>& values,
-    const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count, int64_t offset) {
+                     const std::shared_ptr<Buffer>& value_offsets,
+                     const std::shared_ptr<Array>& values,
+                     const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count,
+                     int64_t offset) {
   BufferVector buffers = {null_bitmap, value_offsets};
   auto internal_data =
       std::make_shared<ArrayData>(type, length, std::move(buffers), null_count, offset);
@@ -192,7 +208,7 @@ ListArray::ListArray(const std::shared_ptr<DataType>& type, int64_t length,
 }
 
 Status ListArray::FromArrays(const Array& offsets, const Array& values, MemoryPool* pool,
-    std::shared_ptr<Array>* out) {
+                             std::shared_ptr<Array>* out) {
   if (ARROW_PREDICT_FALSE(offsets.length() == 0)) {
     return Status::Invalid("List offsets must have non-zero length");
   }
@@ -205,12 +221,13 @@ Status ListArray::FromArrays(const Array& offsets, const Array& values, MemoryPo
     return Status::Invalid("List offsets must be signed int32");
   }
 
-  BufferVector buffers = {
-      offsets.null_bitmap(), static_cast<const Int32Array&>(offsets).values()};
+  BufferVector buffers = {offsets.null_bitmap(),
+                          static_cast<const Int32Array&>(offsets).values()};
 
   auto list_type = list(values.type());
-  auto internal_data = std::make_shared<internal::ArrayData>(list_type,
-      offsets.length() - 1, std::move(buffers), offsets.null_count(), offsets.offset());
+  auto internal_data = std::make_shared<internal::ArrayData>(
+      list_type, offsets.length() - 1, std::move(buffers), offsets.null_count(),
+      offsets.offset());
   internal_data->child_data.push_back(values.data());
 
   *out = std::make_shared<ListArray>(internal_data);
@@ -230,14 +247,12 @@ std::shared_ptr<DataType> ListArray::value_type() const {
   return static_cast<const ListType&>(*type()).value_type();
 }
 
-std::shared_ptr<Array> ListArray::values() const {
-  return values_;
-}
+std::shared_ptr<Array> ListArray::values() const { return values_; }
 
 std::shared_ptr<Array> ListArray::Slice(int64_t offset, int64_t length) const {
   ConformSliceParams(data_->offset, data_->length, &offset, &length);
   return std::make_shared<ListArray>(type(), length, value_offsets(), values(),
-      null_bitmap(), kUnknownNullCount, offset);
+                                     null_bitmap(), kUnknownNullCount, offset);
 }
 
 // ----------------------------------------------------------------------
@@ -262,14 +277,17 @@ void BinaryArray::SetData(const std::shared_ptr<ArrayData>& data) {
 }
 
 BinaryArray::BinaryArray(int64_t length, const std::shared_ptr<Buffer>& value_offsets,
-    const std::shared_ptr<Buffer>& data, const std::shared_ptr<Buffer>& null_bitmap,
-    int64_t null_count, int64_t offset)
+                         const std::shared_ptr<Buffer>& data,
+                         const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count,
+                         int64_t offset)
     : BinaryArray(kBinary, length, value_offsets, data, null_bitmap, null_count, offset) {
 }
 
 BinaryArray::BinaryArray(const std::shared_ptr<DataType>& type, int64_t length,
-    const std::shared_ptr<Buffer>& value_offsets, const std::shared_ptr<Buffer>& data,
-    const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count, int64_t offset) {
+                         const std::shared_ptr<Buffer>& value_offsets,
+                         const std::shared_ptr<Buffer>& data,
+                         const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count,
+                         int64_t offset) {
   BufferVector buffers = {null_bitmap, value_offsets, data};
   SetData(
       std::make_shared<ArrayData>(type, length, std::move(buffers), null_count, offset));
@@ -285,8 +303,9 @@ StringArray::StringArray(const std::shared_ptr<internal::ArrayData>& data) {
 }
 
 StringArray::StringArray(int64_t length, const std::shared_ptr<Buffer>& value_offsets,
-    const std::shared_ptr<Buffer>& data, const std::shared_ptr<Buffer>& null_bitmap,
-    int64_t null_count, int64_t offset)
+                         const std::shared_ptr<Buffer>& data,
+                         const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count,
+                         int64_t offset)
     : BinaryArray(kString, length, value_offsets, data, null_bitmap, null_count, offset) {
 }
 
@@ -304,8 +323,10 @@ FixedSizeBinaryArray::FixedSizeBinaryArray(
 }
 
 FixedSizeBinaryArray::FixedSizeBinaryArray(const std::shared_ptr<DataType>& type,
-    int64_t length, const std::shared_ptr<Buffer>& data,
-    const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count, int64_t offset)
+                                           int64_t length,
+                                           const std::shared_ptr<Buffer>& data,
+                                           const std::shared_ptr<Buffer>& null_bitmap,
+                                           int64_t null_count, int64_t offset)
     : PrimitiveArray(type, length, data, null_bitmap, null_count, offset),
       byte_width_(static_cast<const FixedSizeBinaryType&>(*type).byte_width()) {}
 
@@ -335,8 +356,9 @@ void DecimalArray::SetData(const std::shared_ptr<ArrayData>& data) {
 }
 
 DecimalArray::DecimalArray(const std::shared_ptr<DataType>& type, int64_t length,
-    const std::shared_ptr<Buffer>& data, const std::shared_ptr<Buffer>& null_bitmap,
-    int64_t null_count, int64_t offset, const std::shared_ptr<Buffer>& sign_bitmap) {
+                           const std::shared_ptr<Buffer>& data,
+                           const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count,
+                           int64_t offset, const std::shared_ptr<Buffer>& sign_bitmap) {
   BufferVector buffers = {null_bitmap, data, sign_bitmap};
   SetData(
       std::make_shared<ArrayData>(type, length, std::move(buffers), null_count, offset));
@@ -392,8 +414,9 @@ StructArray::StructArray(const std::shared_ptr<ArrayData>& data) {
 }
 
 StructArray::StructArray(const std::shared_ptr<DataType>& type, int64_t length,
-    const std::vector<std::shared_ptr<Array>>& children,
-    std::shared_ptr<Buffer> null_bitmap, int64_t null_count, int64_t offset) {
+                         const std::vector<std::shared_ptr<Array>>& children,
+                         std::shared_ptr<Buffer> null_bitmap, int64_t null_count,
+                         int64_t offset) {
   BufferVector buffers = {null_bitmap};
   SetData(
       std::make_shared<ArrayData>(type, length, std::move(buffers), null_count, offset));
@@ -433,9 +456,11 @@ UnionArray::UnionArray(const std::shared_ptr<ArrayData>& data) {
 }
 
 UnionArray::UnionArray(const std::shared_ptr<DataType>& type, int64_t length,
-    const std::vector<std::shared_ptr<Array>>& children,
-    const std::shared_ptr<Buffer>& type_ids, const std::shared_ptr<Buffer>& value_offsets,
-    const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count, int64_t offset) {
+                       const std::vector<std::shared_ptr<Array>>& children,
+                       const std::shared_ptr<Buffer>& type_ids,
+                       const std::shared_ptr<Buffer>& value_offsets,
+                       const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count,
+                       int64_t offset) {
   BufferVector buffers = {null_bitmap, type_ids, value_offsets};
   auto internal_data =
       std::make_shared<ArrayData>(type, length, std::move(buffers), null_count, offset);
@@ -464,8 +489,8 @@ DictionaryArray::DictionaryArray(const std::shared_ptr<ArrayData>& data)
   SetData(data);
 }
 
-DictionaryArray::DictionaryArray(
-    const std::shared_ptr<DataType>& type, const std::shared_ptr<Array>& indices)
+DictionaryArray::DictionaryArray(const std::shared_ptr<DataType>& type,
+                                 const std::shared_ptr<Array>& indices)
     : dict_type_(static_cast<const DictionaryType*>(type.get())) {
   DCHECK_EQ(type->id(), Type::DICTIONARY);
   DCHECK_EQ(indices->type_id(), dict_type_->index_type()->id());
@@ -482,9 +507,7 @@ void DictionaryArray::SetData(const std::shared_ptr<ArrayData>& data) {
   DCHECK(internal::MakeArray(indices_data, &indices_).ok());
 }
 
-std::shared_ptr<Array> DictionaryArray::indices() const {
-  return indices_;
-}
+std::shared_ptr<Array> DictionaryArray::indices() const { return indices_; }
 
 std::shared_ptr<Array> DictionaryArray::dictionary() const {
   return dict_type_->dictionary();
@@ -517,7 +540,9 @@ struct ValidateVisitor {
   }
 
   Status Visit(const ListArray& array) {
-    if (array.length() < 0) { return Status::Invalid("Length was negative"); }
+    if (array.length() < 0) {
+      return Status::Invalid("Length was negative");
+    }
 
     auto value_offsets = array.value_offsets();
     if (array.length() && !value_offsets) {
@@ -550,7 +575,9 @@ struct ValidateVisitor {
     }
 
     int32_t prev_offset = array.value_offset(0);
-    if (prev_offset != 0) { return Status::Invalid("The first offset wasn't zero"); }
+    if (prev_offset != 0) {
+      return Status::Invalid("The first offset wasn't zero");
+    }
     for (int64_t i = 1; i <= array.length(); ++i) {
       int32_t current_offset = array.value_offset(i);
       if (array.IsNull(i - 1) && current_offset != prev_offset) {
@@ -573,7 +600,9 @@ struct ValidateVisitor {
   }
 
   Status Visit(const StructArray& array) {
-    if (array.length() < 0) { return Status::Invalid("Length was negative"); }
+    if (array.length() < 0) {
+      return Status::Invalid("Length was negative");
+    }
 
     if (array.null_count() > array.length()) {
       return Status::Invalid("Null count exceeds the length of this struct");
@@ -610,7 +639,9 @@ struct ValidateVisitor {
   }
 
   Status Visit(const UnionArray& array) {
-    if (array.length() < 0) { return Status::Invalid("Length was negative"); }
+    if (array.length() < 0) {
+      return Status::Invalid("Length was negative");
+    }
 
     if (array.null_count() > array.length()) {
       return Status::Invalid("Null count exceeds the length of this struct");
@@ -661,8 +692,9 @@ Status MakeArray(const std::shared_ptr<ArrayData>& data, std::shared_ptr<Array>*
 }  // namespace internal
 
 Status MakePrimitiveArray(const std::shared_ptr<DataType>& type, int64_t length,
-    const std::shared_ptr<Buffer>& data, const std::shared_ptr<Buffer>& null_bitmap,
-    int64_t null_count, int64_t offset, std::shared_ptr<Array>* out) {
+                          const std::shared_ptr<Buffer>& data,
+                          const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count,
+                          int64_t offset, std::shared_ptr<Array>* out) {
   BufferVector buffers = {null_bitmap, data};
   auto internal_data = std::make_shared<internal::ArrayData>(
       type, length, std::move(buffers), null_count, offset);
@@ -670,8 +702,9 @@ Status MakePrimitiveArray(const std::shared_ptr<DataType>& type, int64_t length,
 }
 
 Status MakePrimitiveArray(const std::shared_ptr<DataType>& type,
-    const std::vector<std::shared_ptr<Buffer>>& buffers, int64_t length,
-    int64_t null_count, int64_t offset, std::shared_ptr<Array>* out) {
+                          const std::vector<std::shared_ptr<Buffer>>& buffers,
+                          int64_t length, int64_t null_count, int64_t offset,
+                          std::shared_ptr<Array>* out) {
   auto internal_data =
       std::make_shared<internal::ArrayData>(type, length, buffers, null_count, offset);
   return internal::MakeArray(internal_data, out);

http://git-wip-us.apache.org/repos/asf/arrow/blob/07b89bf3/cpp/src/arrow/array.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/array.h b/cpp/src/arrow/array.h
index c32d5e1..a853f2b 100644
--- a/cpp/src/arrow/array.h
+++ b/cpp/src/arrow/array.h
@@ -88,8 +88,8 @@ struct ARROW_EXPORT ArrayData {
   ArrayData() {}
 
   ArrayData(const std::shared_ptr<DataType>& type, int64_t length,
-      const std::vector<std::shared_ptr<Buffer>>& buffers,
-      int64_t null_count = kUnknownNullCount, int64_t offset = 0)
+            const std::vector<std::shared_ptr<Buffer>>& buffers,
+            int64_t null_count = kUnknownNullCount, int64_t offset = 0)
       : type(type),
         length(length),
         buffers(buffers),
@@ -97,8 +97,8 @@ struct ARROW_EXPORT ArrayData {
         offset(offset) {}
 
   ArrayData(const std::shared_ptr<DataType>& type, int64_t length,
-      std::vector<std::shared_ptr<Buffer>>&& buffers,
-      int64_t null_count = kUnknownNullCount, int64_t offset = 0)
+            std::vector<std::shared_ptr<Buffer>>&& buffers,
+            int64_t null_count = kUnknownNullCount, int64_t offset = 0)
       : type(type),
         length(length),
         buffers(std::move(buffers)),
@@ -145,8 +145,8 @@ struct ARROW_EXPORT ArrayData {
   std::vector<std::shared_ptr<ArrayData>> child_data;
 };
 
-Status ARROW_EXPORT MakeArray(
-    const std::shared_ptr<ArrayData>& data, std::shared_ptr<Array>* out);
+Status ARROW_EXPORT MakeArray(const std::shared_ptr<ArrayData>& data,
+                              std::shared_ptr<Array>* out);
 
 }  // namespace internal
 
@@ -211,10 +211,10 @@ class ARROW_EXPORT Array {
   /// Compare if the range of slots specified are equal for the given array and
   /// this array.  end_idx exclusive.  This methods does not bounds check.
   bool RangeEquals(int64_t start_idx, int64_t end_idx, int64_t other_start_idx,
-      const std::shared_ptr<Array>& other) const;
+                   const std::shared_ptr<Array>& other) const;
 
   bool RangeEquals(const Array& other, int64_t start_idx, int64_t end_idx,
-      int64_t other_start_idx) const;
+                   int64_t other_start_idx) const;
 
   Status Accept(ArrayVisitor* visitor) const;
 
@@ -285,9 +285,9 @@ class ARROW_EXPORT NullArray : public FlatArray {
 class ARROW_EXPORT PrimitiveArray : public FlatArray {
  public:
   PrimitiveArray(const std::shared_ptr<DataType>& type, int64_t length,
-      const std::shared_ptr<Buffer>& data,
-      const std::shared_ptr<Buffer>& null_bitmap = nullptr, int64_t null_count = 0,
-      int64_t offset = 0);
+                 const std::shared_ptr<Buffer>& data,
+                 const std::shared_ptr<Buffer>& null_bitmap = nullptr,
+                 int64_t null_count = 0, int64_t offset = 0);
 
   /// Does not account for any slice offset
   std::shared_ptr<Buffer> values() const { return data_->buffers[1]; }
@@ -328,7 +328,7 @@ class ARROW_EXPORT NumericArray : public PrimitiveArray {
       const std::shared_ptr<Buffer>& null_bitmap = nullptr, int64_t null_count = 0,
       int64_t offset = 0)
       : PrimitiveArray(TypeTraits<T1>::type_singleton(), length, data, null_bitmap,
-            null_count, offset) {}
+                       null_count, offset) {}
 
   const value_type* raw_values() const {
     return reinterpret_cast<const value_type*>(raw_values_) + data_->offset;
@@ -349,14 +349,14 @@ class ARROW_EXPORT BooleanArray : public PrimitiveArray {
   explicit BooleanArray(const std::shared_ptr<internal::ArrayData>& data);
 
   BooleanArray(int64_t length, const std::shared_ptr<Buffer>& data,
-      const std::shared_ptr<Buffer>& null_bitmap = nullptr, int64_t null_count = 0,
-      int64_t offset = 0);
+               const std::shared_ptr<Buffer>& null_bitmap = nullptr,
+               int64_t null_count = 0, int64_t offset = 0);
 
   std::shared_ptr<Array> Slice(int64_t offset, int64_t length) const override;
 
   bool Value(int64_t i) const {
-    return BitUtil::GetBit(
-        reinterpret_cast<const uint8_t*>(raw_values_), i + data_->offset);
+    return BitUtil::GetBit(reinterpret_cast<const uint8_t*>(raw_values_),
+                           i + data_->offset);
   }
 
  protected:
@@ -373,9 +373,10 @@ class ARROW_EXPORT ListArray : public Array {
   explicit ListArray(const std::shared_ptr<internal::ArrayData>& data);
 
   ListArray(const std::shared_ptr<DataType>& type, int64_t length,
-      const std::shared_ptr<Buffer>& value_offsets, const std::shared_ptr<Array>& values,
-      const std::shared_ptr<Buffer>& null_bitmap = nullptr, int64_t null_count = 0,
-      int64_t offset = 0);
+            const std::shared_ptr<Buffer>& value_offsets,
+            const std::shared_ptr<Array>& values,
+            const std::shared_ptr<Buffer>& null_bitmap = nullptr, int64_t null_count = 0,
+            int64_t offset = 0);
 
   /// \brief Construct ListArray from array of offsets and child value array
   ///
@@ -388,7 +389,7 @@ class ARROW_EXPORT ListArray : public Array {
   /// allocated because of null values
   /// \param[out] out Will have length equal to offsets.length() - 1
   static Status FromArrays(const Array& offsets, const Array& values, MemoryPool* pool,
-      std::shared_ptr<Array>* out);
+                           std::shared_ptr<Array>* out);
 
   /// \brief Return array object containing the list's values
   std::shared_ptr<Array> values() const;
@@ -428,9 +429,9 @@ class ARROW_EXPORT BinaryArray : public FlatArray {
   explicit BinaryArray(const std::shared_ptr<internal::ArrayData>& data);
 
   BinaryArray(int64_t length, const std::shared_ptr<Buffer>& value_offsets,
-      const std::shared_ptr<Buffer>& data,
-      const std::shared_ptr<Buffer>& null_bitmap = nullptr, int64_t null_count = 0,
-      int64_t offset = 0);
+              const std::shared_ptr<Buffer>& data,
+              const std::shared_ptr<Buffer>& null_bitmap = nullptr,
+              int64_t null_count = 0, int64_t offset = 0);
 
   // Return the pointer to the given elements bytes
   // TODO(emkornfield) introduce a StringPiece or something similar to capture zero-copy
@@ -471,9 +472,10 @@ class ARROW_EXPORT BinaryArray : public FlatArray {
   // Constructor that allows sub-classes/builders to propagate there logical type up the
   // class hierarchy.
   BinaryArray(const std::shared_ptr<DataType>& type, int64_t length,
-      const std::shared_ptr<Buffer>& value_offsets, const std::shared_ptr<Buffer>& data,
-      const std::shared_ptr<Buffer>& null_bitmap = nullptr, int64_t null_count = 0,
-      int64_t offset = 0);
+              const std::shared_ptr<Buffer>& value_offsets,
+              const std::shared_ptr<Buffer>& data,
+              const std::shared_ptr<Buffer>& null_bitmap = nullptr,
+              int64_t null_count = 0, int64_t offset = 0);
 
   const int32_t* raw_value_offsets_;
   const uint8_t* raw_data_;
@@ -486,9 +488,9 @@ class ARROW_EXPORT StringArray : public BinaryArray {
   explicit StringArray(const std::shared_ptr<internal::ArrayData>& data);
 
   StringArray(int64_t length, const std::shared_ptr<Buffer>& value_offsets,
-      const std::shared_ptr<Buffer>& data,
-      const std::shared_ptr<Buffer>& null_bitmap = nullptr, int64_t null_count = 0,
-      int64_t offset = 0);
+              const std::shared_ptr<Buffer>& data,
+              const std::shared_ptr<Buffer>& null_bitmap = nullptr,
+              int64_t null_count = 0, int64_t offset = 0);
 
   // Construct a std::string
   // TODO: std::bad_alloc possibility
@@ -511,9 +513,9 @@ class ARROW_EXPORT FixedSizeBinaryArray : public PrimitiveArray {
   explicit FixedSizeBinaryArray(const std::shared_ptr<internal::ArrayData>& data);
 
   FixedSizeBinaryArray(const std::shared_ptr<DataType>& type, int64_t length,
-      const std::shared_ptr<Buffer>& data,
-      const std::shared_ptr<Buffer>& null_bitmap = nullptr, int64_t null_count = 0,
-      int64_t offset = 0);
+                       const std::shared_ptr<Buffer>& data,
+                       const std::shared_ptr<Buffer>& null_bitmap = nullptr,
+                       int64_t null_count = 0, int64_t offset = 0);
 
   const uint8_t* GetValue(int64_t i) const;
 
@@ -542,9 +544,10 @@ class ARROW_EXPORT DecimalArray : public FlatArray {
   explicit DecimalArray(const std::shared_ptr<internal::ArrayData>& data);
 
   DecimalArray(const std::shared_ptr<DataType>& type, int64_t length,
-      const std::shared_ptr<Buffer>& data,
-      const std::shared_ptr<Buffer>& null_bitmap = nullptr, int64_t null_count = 0,
-      int64_t offset = 0, const std::shared_ptr<Buffer>& sign_bitmap = nullptr);
+               const std::shared_ptr<Buffer>& data,
+               const std::shared_ptr<Buffer>& null_bitmap = nullptr,
+               int64_t null_count = 0, int64_t offset = 0,
+               const std::shared_ptr<Buffer>& sign_bitmap = nullptr);
 
   bool IsNegative(int64_t i) const;
 
@@ -582,9 +585,9 @@ class ARROW_EXPORT StructArray : public Array {
   explicit StructArray(const std::shared_ptr<internal::ArrayData>& data);
 
   StructArray(const std::shared_ptr<DataType>& type, int64_t length,
-      const std::vector<std::shared_ptr<Array>>& children,
-      std::shared_ptr<Buffer> null_bitmap = nullptr, int64_t null_count = 0,
-      int64_t offset = 0);
+              const std::vector<std::shared_ptr<Array>>& children,
+              std::shared_ptr<Buffer> null_bitmap = nullptr, int64_t null_count = 0,
+              int64_t offset = 0);
 
   // Return a shared pointer in case the requestor desires to share ownership
   // with this array.
@@ -604,11 +607,11 @@ class ARROW_EXPORT UnionArray : public Array {
   explicit UnionArray(const std::shared_ptr<internal::ArrayData>& data);
 
   UnionArray(const std::shared_ptr<DataType>& type, int64_t length,
-      const std::vector<std::shared_ptr<Array>>& children,
-      const std::shared_ptr<Buffer>& type_ids,
-      const std::shared_ptr<Buffer>& value_offsets = nullptr,
-      const std::shared_ptr<Buffer>& null_bitmap = nullptr, int64_t null_count = 0,
-      int64_t offset = 0);
+             const std::vector<std::shared_ptr<Array>>& children,
+             const std::shared_ptr<Buffer>& type_ids,
+             const std::shared_ptr<Buffer>& value_offsets = nullptr,
+             const std::shared_ptr<Buffer>& null_bitmap = nullptr, int64_t null_count = 0,
+             int64_t offset = 0);
 
   /// Note that this buffer does not account for any slice offset
   std::shared_ptr<Buffer> type_ids() const { return data_->buffers[1]; }
@@ -656,8 +659,8 @@ class ARROW_EXPORT DictionaryArray : public Array {
 
   explicit DictionaryArray(const std::shared_ptr<internal::ArrayData>& data);
 
-  DictionaryArray(
-      const std::shared_ptr<DataType>& type, const std::shared_ptr<Array>& indices);
+  DictionaryArray(const std::shared_ptr<DataType>& type,
+                  const std::shared_ptr<Array>& indices);
 
   std::shared_ptr<Array> indices() const;
   std::shared_ptr<Array> dictionary() const;
@@ -705,13 +708,16 @@ Status ARROW_EXPORT ValidateArray(const Array& array);
 
 /// Create new arrays for logical types that are backed by primitive arrays.
 Status ARROW_EXPORT MakePrimitiveArray(const std::shared_ptr<DataType>& type,
-    int64_t length, const std::shared_ptr<Buffer>& data,
-    const std::shared_ptr<Buffer>& null_bitmap, int64_t null_count, int64_t offset,
-    std::shared_ptr<Array>* out);
-
-Status ARROW_EXPORT MakePrimitiveArray(const std::shared_ptr<DataType>& type,
-    const std::vector<std::shared_ptr<Buffer>>& buffers, int64_t length,
-    int64_t null_count, int64_t offset, std::shared_ptr<Array>* out);
+                                       int64_t length,
+                                       const std::shared_ptr<Buffer>& data,
+                                       const std::shared_ptr<Buffer>& null_bitmap,
+                                       int64_t null_count, int64_t offset,
+                                       std::shared_ptr<Array>* out);
+
+Status ARROW_EXPORT
+MakePrimitiveArray(const std::shared_ptr<DataType>& type,
+                   const std::vector<std::shared_ptr<Buffer>>& buffers, int64_t length,
+                   int64_t null_count, int64_t offset, std::shared_ptr<Array>* out);
 
 }  // namespace arrow
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/07b89bf3/cpp/src/arrow/buffer.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/buffer.cc b/cpp/src/arrow/buffer.cc
index a1d119e..b9c5897 100644
--- a/cpp/src/arrow/buffer.cc
+++ b/cpp/src/arrow/buffer.cc
@@ -27,8 +27,8 @@
 
 namespace arrow {
 
-Status Buffer::Copy(
-    int64_t start, int64_t nbytes, MemoryPool* pool, std::shared_ptr<Buffer>* out) const {
+Status Buffer::Copy(int64_t start, int64_t nbytes, MemoryPool* pool,
+                    std::shared_ptr<Buffer>* out) const {
   // Sanity checks
   DCHECK_LT(start, size_);
   DCHECK_LE(nbytes, size_ - start);
@@ -47,25 +47,28 @@ Status Buffer::Copy(int64_t start, int64_t nbytes, std::shared_ptr<Buffer>* out)
 }
 
 bool Buffer::Equals(const Buffer& other, int64_t nbytes) const {
-  return this == &other ||
-         (size_ >= nbytes && other.size_ >= nbytes &&
-             (data_ == other.data_ ||
-                 !memcmp(data_, other.data_, static_cast<size_t>(nbytes))));
+  return this == &other || (size_ >= nbytes && other.size_ >= nbytes &&
+                            (data_ == other.data_ ||
+                             !memcmp(data_, other.data_, static_cast<size_t>(nbytes))));
 }
 
 bool Buffer::Equals(const Buffer& other) const {
-  return this == &other || (size_ == other.size_ && (data_ == other.data_ ||
-                                                        !memcmp(data_, other.data_,
-                                                            static_cast<size_t>(size_))));
+  return this == &other || (size_ == other.size_ &&
+                            (data_ == other.data_ ||
+                             !memcmp(data_, other.data_, static_cast<size_t>(size_))));
 }
 
 PoolBuffer::PoolBuffer(MemoryPool* pool) : ResizableBuffer(nullptr, 0) {
-  if (pool == nullptr) { pool = default_memory_pool(); }
+  if (pool == nullptr) {
+    pool = default_memory_pool();
+  }
   pool_ = pool;
 }
 
 PoolBuffer::~PoolBuffer() {
-  if (mutable_data_ != nullptr) { pool_->Free(mutable_data_, capacity_); }
+  if (mutable_data_ != nullptr) {
+    pool_->Free(mutable_data_, capacity_);
+  }
 }
 
 Status PoolBuffer::Reserve(int64_t new_capacity) {
@@ -109,28 +112,28 @@ Status PoolBuffer::Resize(int64_t new_size, bool shrink_to_fit) {
   return Status::OK();
 }
 
-std::shared_ptr<Buffer> SliceMutableBuffer(
-    const std::shared_ptr<Buffer>& buffer, int64_t offset, int64_t length) {
+std::shared_ptr<Buffer> SliceMutableBuffer(const std::shared_ptr<Buffer>& buffer,
+                                           int64_t offset, int64_t length) {
   return std::make_shared<MutableBuffer>(buffer, offset, length);
 }
 
-MutableBuffer::MutableBuffer(
-    const std::shared_ptr<Buffer>& parent, int64_t offset, int64_t size)
+MutableBuffer::MutableBuffer(const std::shared_ptr<Buffer>& parent, int64_t offset,
+                             int64_t size)
     : MutableBuffer(parent->mutable_data() + offset, size) {
   DCHECK(parent->is_mutable()) << "Must pass mutable buffer";
   parent_ = parent;
 }
 
-Status AllocateBuffer(
-    MemoryPool* pool, int64_t size, std::shared_ptr<MutableBuffer>* out) {
+Status AllocateBuffer(MemoryPool* pool, int64_t size,
+                      std::shared_ptr<MutableBuffer>* out) {
   auto buffer = std::make_shared<PoolBuffer>(pool);
   RETURN_NOT_OK(buffer->Resize(size));
   *out = buffer;
   return Status::OK();
 }
 
-Status AllocateResizableBuffer(
-    MemoryPool* pool, int64_t size, std::shared_ptr<ResizableBuffer>* out) {
+Status AllocateResizableBuffer(MemoryPool* pool, int64_t size,
+                               std::shared_ptr<ResizableBuffer>* out) {
   auto buffer = std::make_shared<PoolBuffer>(pool);
   RETURN_NOT_OK(buffer->Resize(size));
   *out = buffer;

http://git-wip-us.apache.org/repos/asf/arrow/blob/07b89bf3/cpp/src/arrow/buffer.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/buffer.h b/cpp/src/arrow/buffer.h
index 488a4c0..09e539d 100644
--- a/cpp/src/arrow/buffer.h
+++ b/cpp/src/arrow/buffer.h
@@ -72,7 +72,7 @@ class ARROW_EXPORT Buffer {
 
   /// Copy a section of the buffer into a new Buffer.
   Status Copy(int64_t start, int64_t nbytes, MemoryPool* pool,
-      std::shared_ptr<Buffer>* out) const;
+              std::shared_ptr<Buffer>* out) const;
 
   /// Copy a section of the buffer using the default memory pool into a new Buffer.
   Status Copy(int64_t start, int64_t nbytes, std::shared_ptr<Buffer>* out) const;
@@ -106,21 +106,21 @@ class ARROW_EXPORT Buffer {
 /// \param str std::string instance
 /// \return std::shared_ptr<Buffer>
 static inline std::shared_ptr<Buffer> GetBufferFromString(const std::string& str) {
-  return std::make_shared<Buffer>(
-      reinterpret_cast<const uint8_t*>(str.c_str()), static_cast<int64_t>(str.size()));
+  return std::make_shared<Buffer>(reinterpret_cast<const uint8_t*>(str.c_str()),
+                                  static_cast<int64_t>(str.size()));
 }
 
 /// Construct a view on passed buffer at the indicated offset and length. This
 /// function cannot fail and does not error checking (except in debug builds)
-static inline std::shared_ptr<Buffer> SliceBuffer(
-    const std::shared_ptr<Buffer>& buffer, int64_t offset, int64_t length) {
+static inline std::shared_ptr<Buffer> SliceBuffer(const std::shared_ptr<Buffer>& buffer,
+                                                  int64_t offset, int64_t length) {
   return std::make_shared<Buffer>(buffer, offset, length);
 }
 
 /// Construct a mutable buffer slice. If the parent buffer is not mutable, this
 /// will abort in debug builds
-std::shared_ptr<Buffer> ARROW_EXPORT SliceMutableBuffer(
-    const std::shared_ptr<Buffer>& buffer, int64_t offset, int64_t length);
+std::shared_ptr<Buffer> ARROW_EXPORT
+SliceMutableBuffer(const std::shared_ptr<Buffer>& buffer, int64_t offset, int64_t length);
 
 /// A Buffer whose contents can be mutated. May or may not own its data.
 class ARROW_EXPORT MutableBuffer : public Buffer {
@@ -186,8 +186,12 @@ class ARROW_EXPORT BufferBuilder {
   /// Resizes the buffer to the nearest multiple of 64 bytes per Layout.md
   Status Resize(int64_t elements) {
     // Resize(0) is a no-op
-    if (elements == 0) { return Status::OK(); }
-    if (capacity_ == 0) { buffer_ = std::make_shared<PoolBuffer>(pool_); }
+    if (elements == 0) {
+      return Status::OK();
+    }
+    if (capacity_ == 0) {
+      buffer_ = std::make_shared<PoolBuffer>(pool_);
+    }
     int64_t old_capacity = capacity_;
     RETURN_NOT_OK(buffer_->Resize(elements));
     capacity_ = buffer_->capacity();
@@ -199,14 +203,18 @@ class ARROW_EXPORT BufferBuilder {
   }
 
   Status Append(const uint8_t* data, int64_t length) {
-    if (capacity_ < length + size_) { RETURN_NOT_OK(Resize(length + size_)); }
+    if (capacity_ < length + size_) {
+      RETURN_NOT_OK(Resize(length + size_));
+    }
     UnsafeAppend(data, length);
     return Status::OK();
   }
 
   // Advance pointer and zero out memory
   Status Advance(int64_t length) {
-    if (capacity_ < length + size_) { RETURN_NOT_OK(Resize(length + size_)); }
+    if (capacity_ < length + size_) {
+      RETURN_NOT_OK(Resize(length + size_));
+    }
     memset(data_ + size_, 0, static_cast<size_t>(length));
     size_ += length;
     return Status::OK();
@@ -220,7 +228,9 @@ class ARROW_EXPORT BufferBuilder {
 
   Status Finish(std::shared_ptr<Buffer>* out) {
     // Do not shrink to fit to avoid unneeded realloc
-    if (size_ > 0) { RETURN_NOT_OK(buffer_->Resize(size_, false)); }
+    if (size_ > 0) {
+      RETURN_NOT_OK(buffer_->Resize(size_, false));
+    }
     *out = buffer_;
     Reset();
     return Status::OK();
@@ -250,29 +260,29 @@ class ARROW_EXPORT TypedBufferBuilder : public BufferBuilder {
 
   Status Append(T arithmetic_value) {
     static_assert(std::is_arithmetic<T>::value,
-        "Convenience buffer append only supports arithmetic types");
-    return BufferBuilder::Append(
-        reinterpret_cast<uint8_t*>(&arithmetic_value), sizeof(T));
+                  "Convenience buffer append only supports arithmetic types");
+    return BufferBuilder::Append(reinterpret_cast<uint8_t*>(&arithmetic_value),
+                                 sizeof(T));
   }
 
   Status Append(const T* arithmetic_values, int64_t num_elements) {
     static_assert(std::is_arithmetic<T>::value,
-        "Convenience buffer append only supports arithmetic types");
-    return BufferBuilder::Append(
-        reinterpret_cast<const uint8_t*>(arithmetic_values), num_elements * sizeof(T));
+                  "Convenience buffer append only supports arithmetic types");
+    return BufferBuilder::Append(reinterpret_cast<const uint8_t*>(arithmetic_values),
+                                 num_elements * sizeof(T));
   }
 
   void UnsafeAppend(T arithmetic_value) {
     static_assert(std::is_arithmetic<T>::value,
-        "Convenience buffer append only supports arithmetic types");
+                  "Convenience buffer append only supports arithmetic types");
     BufferBuilder::UnsafeAppend(reinterpret_cast<uint8_t*>(&arithmetic_value), sizeof(T));
   }
 
   void UnsafeAppend(const T* arithmetic_values, int64_t num_elements) {
     static_assert(std::is_arithmetic<T>::value,
-        "Convenience buffer append only supports arithmetic types");
-    BufferBuilder::UnsafeAppend(
-        reinterpret_cast<const uint8_t*>(arithmetic_values), num_elements * sizeof(T));
+                  "Convenience buffer append only supports arithmetic types");
+    BufferBuilder::UnsafeAppend(reinterpret_cast<const uint8_t*>(arithmetic_values),
+                                num_elements * sizeof(T));
   }
 
   const T* data() const { return reinterpret_cast<const T*>(data_); }
@@ -286,11 +296,11 @@ class ARROW_EXPORT TypedBufferBuilder : public BufferBuilder {
 /// \param[out] out the allocated buffer with padding
 ///
 /// \return Status message
-Status ARROW_EXPORT AllocateBuffer(
-    MemoryPool* pool, int64_t size, std::shared_ptr<MutableBuffer>* out);
+Status ARROW_EXPORT AllocateBuffer(MemoryPool* pool, int64_t size,
+                                   std::shared_ptr<MutableBuffer>* out);
 
-Status ARROW_EXPORT AllocateResizableBuffer(
-    MemoryPool* pool, int64_t size, std::shared_ptr<ResizableBuffer>* out);
+Status ARROW_EXPORT AllocateResizableBuffer(MemoryPool* pool, int64_t size,
+                                            std::shared_ptr<ResizableBuffer>* out);
 
 }  // namespace arrow
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/07b89bf3/cpp/src/arrow/builder-benchmark.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/builder-benchmark.cc b/cpp/src/arrow/builder-benchmark.cc
index 7ca7bb4..8ba9360 100644
--- a/cpp/src/arrow/builder-benchmark.cc
+++ b/cpp/src/arrow/builder-benchmark.cc
@@ -38,8 +38,8 @@ static void BM_BuildPrimitiveArrayNoNulls(
     std::shared_ptr<Array> out;
     ABORT_NOT_OK(builder.Finish(&out));
   }
-  state.SetBytesProcessed(
-      state.iterations() * data.size() * sizeof(int64_t) * kFinalSize);
+  state.SetBytesProcessed(state.iterations() * data.size() * sizeof(int64_t) *
+                          kFinalSize);
 }
 
 static void BM_BuildVectorNoNulls(
@@ -53,8 +53,8 @@ static void BM_BuildVectorNoNulls(
       builder.insert(builder.end(), data.cbegin(), data.cend());
     }
   }
-  state.SetBytesProcessed(
-      state.iterations() * data.size() * sizeof(int64_t) * kFinalSize);
+  state.SetBytesProcessed(state.iterations() * data.size() * sizeof(int64_t) *
+                          kFinalSize);
 }
 
 static void BM_BuildAdaptiveIntNoNulls(
@@ -127,8 +127,8 @@ static void BM_BuildDictionary(benchmark::State& state) {  // NOLINT non-const r
     std::shared_ptr<Array> out;
     ABORT_NOT_OK(builder.Finish(&out));
   }
-  state.SetBytesProcessed(
-      state.iterations() * iterations * (iterations + 1) / 2 * sizeof(int64_t));
+  state.SetBytesProcessed(state.iterations() * iterations * (iterations + 1) / 2 *
+                          sizeof(int64_t));
 }
 
 static void BM_BuildStringDictionary(
@@ -152,8 +152,8 @@ static void BM_BuildStringDictionary(
     ABORT_NOT_OK(builder.Finish(&out));
   }
   // Assuming a string here needs on average 2 bytes
-  state.SetBytesProcessed(
-      state.iterations() * iterations * (iterations + 1) / 2 * sizeof(int32_t));
+  state.SetBytesProcessed(state.iterations() * iterations * (iterations + 1) / 2 *
+                          sizeof(int32_t));
 }
 
 BENCHMARK(BM_BuildPrimitiveArrayNoNulls)->Repetitions(3)->Unit(benchmark::kMicrosecond);