From 93364b9d842771cdfe3786306dc224ebf1e24eb2 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Tue, 9 Apr 2024 14:01:19 -0400 Subject: [PATCH 01/10] Fix redundant move warnings --- cpp/src/arrow/util/decimal.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/src/arrow/util/decimal.h b/cpp/src/arrow/util/decimal.h index 345c74d95b1..14c7103d5ac 100644 --- a/cpp/src/arrow/util/decimal.h +++ b/cpp/src/arrow/util/decimal.h @@ -80,7 +80,7 @@ class ARROW_EXPORT Decimal128 : public BasicDecimal128 { std::pair result; auto dstatus = BasicDecimal128::Divide(divisor, &result.first, &result.second); ARROW_RETURN_NOT_OK(ToArrowStatus(dstatus)); - return std::move(result); + return result; } /// \brief Convert the Decimal128 value to a base 10 decimal string with the given @@ -118,7 +118,7 @@ class ARROW_EXPORT Decimal128 : public BasicDecimal128 { Decimal128 out; auto dstatus = BasicDecimal128::Rescale(original_scale, new_scale, &out); ARROW_RETURN_NOT_OK(ToArrowStatus(dstatus)); - return std::move(out); + return out; } /// \brief Convert to a signed integer @@ -218,7 +218,7 @@ class ARROW_EXPORT Decimal256 : public BasicDecimal256 { Decimal256 out; auto dstatus = BasicDecimal256::Rescale(original_scale, new_scale, &out); ARROW_RETURN_NOT_OK(ToArrowStatus(dstatus)); - return std::move(out); + return out; } /// Divide this number by right and return the result. @@ -235,7 +235,7 @@ class ARROW_EXPORT Decimal256 : public BasicDecimal256 { std::pair result; auto dstatus = BasicDecimal256::Divide(divisor, &result.first, &result.second); ARROW_RETURN_NOT_OK(ToArrowStatus(dstatus)); - return std::move(result); + return result; } /// \brief Convert from a big-endian byte representation. The length must be From 6f2416362de53596afd695be6c03960495813bcc Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Tue, 9 Apr 2024 19:05:45 -0400 Subject: [PATCH 02/10] MINOR: [C++] Clean up unused parameter warnings --- cpp/src/arrow/array/builder_base.h | 3 +++ cpp/src/arrow/array/builder_nested.h | 2 +- cpp/src/arrow/array/builder_primitive.h | 8 ++++++-- cpp/src/arrow/device.h | 3 +++ cpp/src/arrow/type.h | 15 ++++++++++++--- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/cpp/src/arrow/array/builder_base.h b/cpp/src/arrow/array/builder_base.h index 11036797e01..3122b83cea6 100644 --- a/cpp/src/arrow/array/builder_base.h +++ b/cpp/src/arrow/array/builder_base.h @@ -177,6 +177,9 @@ class ARROW_EXPORT ArrayBuilder { /// The given array must be the same type as the builder. virtual Status AppendArraySlice(const ArraySpan& array, int64_t offset, int64_t length) { + ARROW_UNUSED(array); + ARROW_UNUSED(offset); + ARROW_UNUSED(length); return Status::NotImplemented("AppendArraySlice for builder for ", *type()); } diff --git a/cpp/src/arrow/array/builder_nested.h b/cpp/src/arrow/array/builder_nested.h index 429aa5c0488..c636c40da99 100644 --- a/cpp/src/arrow/array/builder_nested.h +++ b/cpp/src/arrow/array/builder_nested.h @@ -251,7 +251,7 @@ class ARROW_EXPORT VarLengthListLikeBuilder : public ArrayBuilder { /// /// ListViewBuilder overrides this to also append the size. virtual void UnsafeAppendDimensions(int64_t offset, int64_t size) { - offsets_builder_.UnsafeAppend(static_cast(offset)); + offsets_builder_.UnsafeAppend(static_cast(offset), size); } TypedBufferBuilder offsets_builder_; diff --git a/cpp/src/arrow/array/builder_primitive.h b/cpp/src/arrow/array/builder_primitive.h index 29e01d55ede..b29962309e2 100644 --- a/cpp/src/arrow/array/builder_primitive.h +++ b/cpp/src/arrow/array/builder_primitive.h @@ -33,11 +33,15 @@ class ARROW_EXPORT NullBuilder : public ArrayBuilder { public: explicit NullBuilder(MemoryPool* pool = default_memory_pool(), int64_t alignment = kDefaultBufferAlignment) - : ArrayBuilder(pool) {} + : ArrayBuilder(pool) { + ARROW_UNUSED(alignment); + } explicit NullBuilder(const std::shared_ptr& type, MemoryPool* pool = default_memory_pool(), int64_t alignment = kDefaultBufferAlignment) - : NullBuilder(pool, alignment) {} + : NullBuilder(pool, alignment) { + ARROW_UNUSED(type); + } /// \brief Append the specified number of null elements Status AppendNulls(int64_t length) final { diff --git a/cpp/src/arrow/device.h b/cpp/src/arrow/device.h index 622551c6bd0..5008b00f6fb 100644 --- a/cpp/src/arrow/device.h +++ b/cpp/src/arrow/device.h @@ -140,6 +140,7 @@ class ARROW_EXPORT Device : public std::enable_shared_from_this, /// derived from Device::Stream to allow for stream ordered events /// and memory allocations. virtual Result> MakeStream(unsigned int flags) { + ARROW_UNUSED(flags); return NULLPTR; } @@ -151,6 +152,8 @@ class ARROW_EXPORT Device : public std::enable_shared_from_this, /// externally virtual Result> WrapStream(void* device_stream, Stream::release_fn_t release_fn) { + ARROW_UNUSED(device_stream); + ARROW_UNUSED(release_fn); return NULLPTR; } diff --git a/cpp/src/arrow/type.h b/cpp/src/arrow/type.h index 3f651741d3e..23c096c0be6 100644 --- a/cpp/src/arrow/type.h +++ b/cpp/src/arrow/type.h @@ -1723,7 +1723,10 @@ class ARROW_EXPORT MonthIntervalType : public IntervalType { MonthIntervalType() : IntervalType(type_id) {} - std::string ToString(bool show_metadata = false) const override { return name(); } + std::string ToString(bool show_metadata = false) const override { + ARROW_UNUSED(show_metadata); + return name(); + } std::string name() const override { return "month_interval"; } }; @@ -1759,7 +1762,10 @@ class ARROW_EXPORT DayTimeIntervalType : public IntervalType { int bit_width() const override { return static_cast(sizeof(c_type) * CHAR_BIT); } - std::string ToString(bool show_metadata = false) const override { return name(); } + std::string ToString(bool show_metadata = false) const override { + ARROW_UNUSED(show_metadata); + return name(); + } std::string name() const override { return "day_time_interval"; } }; @@ -1799,7 +1805,10 @@ class ARROW_EXPORT MonthDayNanoIntervalType : public IntervalType { int bit_width() const override { return static_cast(sizeof(c_type) * CHAR_BIT); } - std::string ToString(bool show_metadata = false) const override { return name(); } + std::string ToString(bool show_metadata = false) const override { + ARROW_UNUSED(show_metadata); + return name(); + } std::string name() const override { return "month_day_nano_interval"; } }; From a65c9d6bfe661177675565a1416fff9d7c99f0e9 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Tue, 9 Apr 2024 19:49:41 -0400 Subject: [PATCH 03/10] Set size to unused --- cpp/src/arrow/array/builder_nested.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/src/arrow/array/builder_nested.h b/cpp/src/arrow/array/builder_nested.h index c636c40da99..07b94780c9c 100644 --- a/cpp/src/arrow/array/builder_nested.h +++ b/cpp/src/arrow/array/builder_nested.h @@ -251,7 +251,8 @@ class ARROW_EXPORT VarLengthListLikeBuilder : public ArrayBuilder { /// /// ListViewBuilder overrides this to also append the size. virtual void UnsafeAppendDimensions(int64_t offset, int64_t size) { - offsets_builder_.UnsafeAppend(static_cast(offset), size); + ARROW_UNUSED(size); + offsets_builder_.UnsafeAppend(static_cast(offset)); } TypedBufferBuilder offsets_builder_; From 295ca4e26c628b940b4f120b9c7a1e5ad866c69c Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Tue, 9 Apr 2024 20:52:43 -0400 Subject: [PATCH 04/10] Revert decimal.h changes --- cpp/src/arrow/util/decimal.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/src/arrow/util/decimal.h b/cpp/src/arrow/util/decimal.h index 14c7103d5ac..345c74d95b1 100644 --- a/cpp/src/arrow/util/decimal.h +++ b/cpp/src/arrow/util/decimal.h @@ -80,7 +80,7 @@ class ARROW_EXPORT Decimal128 : public BasicDecimal128 { std::pair result; auto dstatus = BasicDecimal128::Divide(divisor, &result.first, &result.second); ARROW_RETURN_NOT_OK(ToArrowStatus(dstatus)); - return result; + return std::move(result); } /// \brief Convert the Decimal128 value to a base 10 decimal string with the given @@ -118,7 +118,7 @@ class ARROW_EXPORT Decimal128 : public BasicDecimal128 { Decimal128 out; auto dstatus = BasicDecimal128::Rescale(original_scale, new_scale, &out); ARROW_RETURN_NOT_OK(ToArrowStatus(dstatus)); - return out; + return std::move(out); } /// \brief Convert to a signed integer @@ -218,7 +218,7 @@ class ARROW_EXPORT Decimal256 : public BasicDecimal256 { Decimal256 out; auto dstatus = BasicDecimal256::Rescale(original_scale, new_scale, &out); ARROW_RETURN_NOT_OK(ToArrowStatus(dstatus)); - return out; + return std::move(out); } /// Divide this number by right and return the result. @@ -235,7 +235,7 @@ class ARROW_EXPORT Decimal256 : public BasicDecimal256 { std::pair result; auto dstatus = BasicDecimal256::Divide(divisor, &result.first, &result.second); ARROW_RETURN_NOT_OK(ToArrowStatus(dstatus)); - return result; + return std::move(result); } /// \brief Convert from a big-endian byte representation. The length must be From 699b39a540fc7dce1e186aac3ab9db0ccf2b7817 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Tue, 9 Apr 2024 21:00:14 -0400 Subject: [PATCH 05/10] ARROW_UNUSED -> ARROW_ARG_UNUSED --- cpp/src/arrow/array/builder_base.h | 8 +++----- cpp/src/arrow/array/builder_nested.h | 3 +-- cpp/src/arrow/array/builder_primitive.h | 13 +++++-------- cpp/src/arrow/device.h | 11 +++++------ cpp/src/arrow/type.h | 9 +++------ 5 files changed, 17 insertions(+), 27 deletions(-) diff --git a/cpp/src/arrow/array/builder_base.h b/cpp/src/arrow/array/builder_base.h index 3122b83cea6..3a85318735f 100644 --- a/cpp/src/arrow/array/builder_base.h +++ b/cpp/src/arrow/array/builder_base.h @@ -175,11 +175,9 @@ class ARROW_EXPORT ArrayBuilder { /// \brief Append a range of values from an array. /// /// The given array must be the same type as the builder. - virtual Status AppendArraySlice(const ArraySpan& array, int64_t offset, - int64_t length) { - ARROW_UNUSED(array); - ARROW_UNUSED(offset); - ARROW_UNUSED(length); + virtual Status AppendArraySlice(const ArraySpan& ARROW_ARG_UNUSED(array), + int64_t ARROW_ARG_UNUSED(offset), + int64_t ARROW_ARG_UNUSED(length)) { return Status::NotImplemented("AppendArraySlice for builder for ", *type()); } diff --git a/cpp/src/arrow/array/builder_nested.h b/cpp/src/arrow/array/builder_nested.h index 07b94780c9c..dd09bdbe028 100644 --- a/cpp/src/arrow/array/builder_nested.h +++ b/cpp/src/arrow/array/builder_nested.h @@ -250,8 +250,7 @@ class ARROW_EXPORT VarLengthListLikeBuilder : public ArrayBuilder { /// \brief Append dimensions for a single list slot. /// /// ListViewBuilder overrides this to also append the size. - virtual void UnsafeAppendDimensions(int64_t offset, int64_t size) { - ARROW_UNUSED(size); + virtual void UnsafeAppendDimensions(int64_t offset, int64_t ARROW_ARG_UNUSED(size)) { offsets_builder_.UnsafeAppend(static_cast(offset)); } diff --git a/cpp/src/arrow/array/builder_primitive.h b/cpp/src/arrow/array/builder_primitive.h index b29962309e2..de7af1b46bd 100644 --- a/cpp/src/arrow/array/builder_primitive.h +++ b/cpp/src/arrow/array/builder_primitive.h @@ -32,16 +32,13 @@ namespace arrow { class ARROW_EXPORT NullBuilder : public ArrayBuilder { public: explicit NullBuilder(MemoryPool* pool = default_memory_pool(), - int64_t alignment = kDefaultBufferAlignment) - : ArrayBuilder(pool) { - ARROW_UNUSED(alignment); - } - explicit NullBuilder(const std::shared_ptr& type, + int64_t ARROW_ARG_UNUSED(alignment) = kDefaultBufferAlignment) + : ArrayBuilder(pool) {} + + explicit NullBuilder(const std::shared_ptr& ARROW_ARG_UNUSED(type), MemoryPool* pool = default_memory_pool(), int64_t alignment = kDefaultBufferAlignment) - : NullBuilder(pool, alignment) { - ARROW_UNUSED(type); - } + : NullBuilder(pool, alignment) {} /// \brief Append the specified number of null elements Status AppendNulls(int64_t length) final { diff --git a/cpp/src/arrow/device.h b/cpp/src/arrow/device.h index 5008b00f6fb..7ca30997d0e 100644 --- a/cpp/src/arrow/device.h +++ b/cpp/src/arrow/device.h @@ -139,8 +139,8 @@ class ARROW_EXPORT Device : public std::enable_shared_from_this, /// This should create the appropriate stream type for the device, /// derived from Device::Stream to allow for stream ordered events /// and memory allocations. - virtual Result> MakeStream(unsigned int flags) { - ARROW_UNUSED(flags); + virtual Result> MakeStream( + unsigned int ARROW_ARG_UNUSED(flags)) { return NULLPTR; } @@ -150,10 +150,9 @@ class ARROW_EXPORT Device : public std::enable_shared_from_this, /// @param release_fn a function to call during destruction, `nullptr` or /// a no-op function can be passed to indicate ownership is maintained /// externally - virtual Result> WrapStream(void* device_stream, - Stream::release_fn_t release_fn) { - ARROW_UNUSED(device_stream); - ARROW_UNUSED(release_fn); + virtual Result> WrapStream( + void* ARROW_ARG_UNUSED(device) _stream, + Stream::release_fn_t ARROW_ARG_UNUSED(release_fn)) { return NULLPTR; } diff --git a/cpp/src/arrow/type.h b/cpp/src/arrow/type.h index 23c096c0be6..35d97c6d569 100644 --- a/cpp/src/arrow/type.h +++ b/cpp/src/arrow/type.h @@ -1723,8 +1723,7 @@ class ARROW_EXPORT MonthIntervalType : public IntervalType { MonthIntervalType() : IntervalType(type_id) {} - std::string ToString(bool show_metadata = false) const override { - ARROW_UNUSED(show_metadata); + std::string ToString(bool ARROW_ARG_UNUSED(show_metadata) = false) const override { return name(); } std::string name() const override { return "month_interval"; } @@ -1762,8 +1761,7 @@ class ARROW_EXPORT DayTimeIntervalType : public IntervalType { int bit_width() const override { return static_cast(sizeof(c_type) * CHAR_BIT); } - std::string ToString(bool show_metadata = false) const override { - ARROW_UNUSED(show_metadata); + std::string ToString(bool ARROW_ARG_UNUSED(show_metadata) = false) const override { return name(); } std::string name() const override { return "day_time_interval"; } @@ -1805,8 +1803,7 @@ class ARROW_EXPORT MonthDayNanoIntervalType : public IntervalType { int bit_width() const override { return static_cast(sizeof(c_type) * CHAR_BIT); } - std::string ToString(bool show_metadata = false) const override { - ARROW_UNUSED(show_metadata); + std::string ToString(bool ARROW_ARG_UNUSED(show_metadata) = false) const override { return name(); } std::string name() const override { return "month_day_nano_interval"; } From 2c79c0fd55e0d1390a3e3b1a1f3c50ba08237176 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Tue, 9 Apr 2024 21:54:20 -0400 Subject: [PATCH 06/10] typo fix --- cpp/src/arrow/device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/arrow/device.h b/cpp/src/arrow/device.h index 7ca30997d0e..a591167ef9a 100644 --- a/cpp/src/arrow/device.h +++ b/cpp/src/arrow/device.h @@ -151,7 +151,7 @@ class ARROW_EXPORT Device : public std::enable_shared_from_this, /// a no-op function can be passed to indicate ownership is maintained /// externally virtual Result> WrapStream( - void* ARROW_ARG_UNUSED(device) _stream, + void* ARROW_ARG_UNUSED(device_stream), Stream::release_fn_t ARROW_ARG_UNUSED(release_fn)) { return NULLPTR; } From 376cabacd999d96d8f1d2d683fc7f37eaefd24d4 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Tue, 9 Apr 2024 22:01:47 -0400 Subject: [PATCH 07/10] Try ARROW_UNUSED --- cpp/src/arrow/device.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/device.h b/cpp/src/arrow/device.h index a591167ef9a..2757c2696fe 100644 --- a/cpp/src/arrow/device.h +++ b/cpp/src/arrow/device.h @@ -150,9 +150,10 @@ class ARROW_EXPORT Device : public std::enable_shared_from_this, /// @param release_fn a function to call during destruction, `nullptr` or /// a no-op function can be passed to indicate ownership is maintained /// externally - virtual Result> WrapStream( - void* ARROW_ARG_UNUSED(device_stream), - Stream::release_fn_t ARROW_ARG_UNUSED(release_fn)) { + virtual Result> WrapStream(void* device_stream, + Stream::release_fn_t release_fn) { + ARROW_UNUSED(device_stream); + ARROW_UNUSED(release_fn); return NULLPTR; } From 77587138a2b1bcd9b5d97fce4b1a2d5acc12c5e4 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Mon, 15 Apr 2024 13:45:39 -0400 Subject: [PATCH 08/10] Use [[maybe_unused]] instead --- cpp/src/arrow/array/builder_base.h | 6 +++--- cpp/src/arrow/array/builder_nested.h | 2 +- cpp/src/arrow/array/builder_primitive.h | 4 ++-- cpp/src/arrow/device.h | 9 +++------ cpp/src/arrow/type.h | 6 +++--- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/cpp/src/arrow/array/builder_base.h b/cpp/src/arrow/array/builder_base.h index 3a85318735f..e6c0b2d2387 100644 --- a/cpp/src/arrow/array/builder_base.h +++ b/cpp/src/arrow/array/builder_base.h @@ -175,9 +175,9 @@ class ARROW_EXPORT ArrayBuilder { /// \brief Append a range of values from an array. /// /// The given array must be the same type as the builder. - virtual Status AppendArraySlice(const ArraySpan& ARROW_ARG_UNUSED(array), - int64_t ARROW_ARG_UNUSED(offset), - int64_t ARROW_ARG_UNUSED(length)) { + virtual Status AppendArraySlice([[maybe_unused]] const ArraySpan& array, + [[maybe_unused]] int64_t offset, + [[maybe_unused]] int64_t length) { return Status::NotImplemented("AppendArraySlice for builder for ", *type()); } diff --git a/cpp/src/arrow/array/builder_nested.h b/cpp/src/arrow/array/builder_nested.h index dd09bdbe028..84178a76ebc 100644 --- a/cpp/src/arrow/array/builder_nested.h +++ b/cpp/src/arrow/array/builder_nested.h @@ -250,7 +250,7 @@ class ARROW_EXPORT VarLengthListLikeBuilder : public ArrayBuilder { /// \brief Append dimensions for a single list slot. /// /// ListViewBuilder overrides this to also append the size. - virtual void UnsafeAppendDimensions(int64_t offset, int64_t ARROW_ARG_UNUSED(size)) { + virtual void UnsafeAppendDimensions(int64_t offset, [[maybe_unused]] int64_t size)) { offsets_builder_.UnsafeAppend(static_cast(offset)); } diff --git a/cpp/src/arrow/array/builder_primitive.h b/cpp/src/arrow/array/builder_primitive.h index de7af1b46bd..db8d2cbaabb 100644 --- a/cpp/src/arrow/array/builder_primitive.h +++ b/cpp/src/arrow/array/builder_primitive.h @@ -32,10 +32,10 @@ namespace arrow { class ARROW_EXPORT NullBuilder : public ArrayBuilder { public: explicit NullBuilder(MemoryPool* pool = default_memory_pool(), - int64_t ARROW_ARG_UNUSED(alignment) = kDefaultBufferAlignment) + [[maybe_unused]] int64_t alignment = kDefaultBufferAlignment) : ArrayBuilder(pool) {} - explicit NullBuilder(const std::shared_ptr& ARROW_ARG_UNUSED(type), + explicit NullBuilder([[maybe_unused]] const std::shared_ptr& type, MemoryPool* pool = default_memory_pool(), int64_t alignment = kDefaultBufferAlignment) : NullBuilder(pool, alignment) {} diff --git a/cpp/src/arrow/device.h b/cpp/src/arrow/device.h index 2757c2696fe..35cde391437 100644 --- a/cpp/src/arrow/device.h +++ b/cpp/src/arrow/device.h @@ -139,8 +139,7 @@ class ARROW_EXPORT Device : public std::enable_shared_from_this, /// This should create the appropriate stream type for the device, /// derived from Device::Stream to allow for stream ordered events /// and memory allocations. - virtual Result> MakeStream( - unsigned int ARROW_ARG_UNUSED(flags)) { + virtual Result> MakeStream([[maybe_unused]] unsigned int flags) { return NULLPTR; } @@ -150,10 +149,8 @@ class ARROW_EXPORT Device : public std::enable_shared_from_this, /// @param release_fn a function to call during destruction, `nullptr` or /// a no-op function can be passed to indicate ownership is maintained /// externally - virtual Result> WrapStream(void* device_stream, - Stream::release_fn_t release_fn) { - ARROW_UNUSED(device_stream); - ARROW_UNUSED(release_fn); + virtual Result> WrapStream([[maybe_unused]] void* device_stream, + [[maybe_unused]] Stream::release_fn_t release_fn) { return NULLPTR; } diff --git a/cpp/src/arrow/type.h b/cpp/src/arrow/type.h index 35d97c6d569..5629cade423 100644 --- a/cpp/src/arrow/type.h +++ b/cpp/src/arrow/type.h @@ -1723,7 +1723,7 @@ class ARROW_EXPORT MonthIntervalType : public IntervalType { MonthIntervalType() : IntervalType(type_id) {} - std::string ToString(bool ARROW_ARG_UNUSED(show_metadata) = false) const override { + std::string ToString([[maybe_unused]] bool show_metadata = false) const override { return name(); } std::string name() const override { return "month_interval"; } @@ -1761,7 +1761,7 @@ class ARROW_EXPORT DayTimeIntervalType : public IntervalType { int bit_width() const override { return static_cast(sizeof(c_type) * CHAR_BIT); } - std::string ToString(bool ARROW_ARG_UNUSED(show_metadata) = false) const override { + std::string ToString([[maybe_unused]] bool show_metadata = false) const override { return name(); } std::string name() const override { return "day_time_interval"; } @@ -1803,7 +1803,7 @@ class ARROW_EXPORT MonthDayNanoIntervalType : public IntervalType { int bit_width() const override { return static_cast(sizeof(c_type) * CHAR_BIT); } - std::string ToString(bool ARROW_ARG_UNUSED(show_metadata) = false) const override { + std::string ToString([[maybe_unused]] bool show_metadata = false) const override { return name(); } std::string name() const override { return "month_day_nano_interval"; } From 1f7e6786a821fc170ceb72516889b4062b77597c Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Mon, 15 Apr 2024 13:48:43 -0400 Subject: [PATCH 09/10] clang-format fix --- cpp/src/arrow/device.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/device.h b/cpp/src/arrow/device.h index 35cde391437..3003bad7c45 100644 --- a/cpp/src/arrow/device.h +++ b/cpp/src/arrow/device.h @@ -139,7 +139,8 @@ class ARROW_EXPORT Device : public std::enable_shared_from_this, /// This should create the appropriate stream type for the device, /// derived from Device::Stream to allow for stream ordered events /// and memory allocations. - virtual Result> MakeStream([[maybe_unused]] unsigned int flags) { + virtual Result> MakeStream( + [[maybe_unused]] unsigned int flags) { return NULLPTR; } @@ -149,8 +150,9 @@ class ARROW_EXPORT Device : public std::enable_shared_from_this, /// @param release_fn a function to call during destruction, `nullptr` or /// a no-op function can be passed to indicate ownership is maintained /// externally - virtual Result> WrapStream([[maybe_unused]] void* device_stream, - [[maybe_unused]] Stream::release_fn_t release_fn) { + virtual Result> WrapStream( + [[maybe_unused]] void* device_stream, + [[maybe_unused]] Stream::release_fn_t release_fn) { return NULLPTR; } From d58c32cfb7e30d0b7d19b658fccee21e06220784 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Mon, 15 Apr 2024 14:06:11 -0400 Subject: [PATCH 10/10] typo fix --- cpp/src/arrow/array/builder_nested.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/arrow/array/builder_nested.h b/cpp/src/arrow/array/builder_nested.h index 84178a76ebc..2c8c41c365f 100644 --- a/cpp/src/arrow/array/builder_nested.h +++ b/cpp/src/arrow/array/builder_nested.h @@ -250,7 +250,7 @@ class ARROW_EXPORT VarLengthListLikeBuilder : public ArrayBuilder { /// \brief Append dimensions for a single list slot. /// /// ListViewBuilder overrides this to also append the size. - virtual void UnsafeAppendDimensions(int64_t offset, [[maybe_unused]] int64_t size)) { + virtual void UnsafeAppendDimensions(int64_t offset, [[maybe_unused]] int64_t size) { offsets_builder_.UnsafeAppend(static_cast(offset)); }