This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-nanoarrow.git


The following commit(s) were added to refs/heads/main by this push:
     new cf79b980 Update dist/ for commit 
7f6e4df3f853d179ca3b17e0ab8ba06bc4e9b803
cf79b980 is described below

commit cf79b980f06cf37a9f66564bb936bd930c5da069
Author: GitHub Actions <[email protected]>
AuthorDate: Thu Apr 11 01:26:49 2024 +0000

    Update dist/ for commit 7f6e4df3f853d179ca3b17e0ab8ba06bc4e9b803
---
 dist/nanoarrow.hpp         |  2 ++
 dist/nanoarrow_ipc.c       | 14 +++++++-------
 dist/nanoarrow_testing.hpp | 22 +++++++++++++---------
 3 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/dist/nanoarrow.hpp b/dist/nanoarrow.hpp
index 09a03151..aa8b248a 100644
--- a/dist/nanoarrow.hpp
+++ b/dist/nanoarrow.hpp
@@ -244,6 +244,8 @@ class Unique {
 template <typename T>
 static inline void DeallocateWrappedBuffer(struct ArrowBufferAllocator* 
allocator,
                                            uint8_t* ptr, int64_t size) {
+  NANOARROW_UNUSED(ptr);
+  NANOARROW_UNUSED(size);
   auto obj = reinterpret_cast<T*>(allocator->private_data);
   delete obj;
 }
diff --git a/dist/nanoarrow_ipc.c b/dist/nanoarrow_ipc.c
index 039d13b5..38d2b586 100644
--- a/dist/nanoarrow_ipc.c
+++ b/dist/nanoarrow_ipc.c
@@ -189,7 +189,7 @@ static inline int N ## _ ## NK ## _is_present(N ## _table_t 
t__tmp)\
 __## NS ## field_present(ID, t__tmp)\
 static inline T ## _union_t N ## _ ## NK ## _union(N ## _table_t t__tmp)\
 { T ## _union_t u__tmp = { 0, 0 }; u__tmp.type = N ## _ ## NK ## 
_type_get(t__tmp);\
-  if (u__tmp.type == 0) return u__tmp; u__tmp.value = N ## _ ## NK ## 
_get(t__tmp); return u__tmp; }\
+  if (u__tmp.type == 0) { return u__tmp; } u__tmp.value = N ## _ ## NK ## 
_get(t__tmp); return u__tmp; }\
 static inline NS ## string_t N ## _ ## NK ## _as_string(N ## _table_t t__tmp)\
 { return NS ## string_cast_from_generic(N ## _ ## NK ## _get(t__tmp)); }\
 
@@ -200,7 +200,7 @@ static inline T ## _union_t T ## _union_vec_at(T ## 
_union_vec_t uv__tmp, size_t
 { T ## _union_t u__tmp = { 0, 0 }; size_t n__tmp = NS ## 
vec_len(uv__tmp.type);\
   FLATCC_ASSERT(n__tmp > (i__tmp) && "index out of range"); u__tmp.type = 
uv__tmp.type[i__tmp];\
   /* Unknown type is treated as NONE for schema evolution. */\
-  if (u__tmp.type == 0) return u__tmp;\
+  if (u__tmp.type == 0) { return u__tmp; }\
   u__tmp.value = NS ## generic_vec_at(uv__tmp.value, i__tmp); return u__tmp; }\
 static inline NS ## string_t T ## _union_vec_at_as_string(T ## _union_vec_t 
uv__tmp, size_t i__tmp)\
 { return (NS ## string_t) NS ## generic_vec_at_as_string(uv__tmp.value, 
i__tmp); }\
@@ -810,7 +810,7 @@ static inline N ## _union_vec_ref_t N ## _vec_clone(NS ## 
builder_t *B, N ##_uni
   _uvref.type = flatcc_builder_refmap_find(B, vec.type); _uvref.value = 
flatcc_builder_refmap_find(B, vec.value);\
   _len = N ## _union_vec_len(vec); if (_uvref.type == 0) {\
   _uvref.type = flatcc_builder_refmap_insert(B, vec.type, 
(flatcc_builder_create_type_vector(B, vec.type, _len))); }\
-  if (_uvref.type == 0) return _ret; if (_uvref.value == 0) {\
+  if (_uvref.type == 0) { return _ret; } if (_uvref.value == 0) {\
   if (flatcc_builder_start_offset_vector(B)) return _ret;\
   for (_i = 0; _i < _len; ++_i) { _uref = N ## _clone(B, N ## 
_union_vec_at(vec, _i));\
     if (!_uref.value || !(flatcc_builder_offset_vector_push(B, _uref.value))) 
return _ret; }\
@@ -915,11 +915,11 @@ __flatbuffers_build_offset_vector(NS, NS ## string)
 static inline T *N ## _array_copy(T *p, const T *p2, size_t n)\
 { memcpy(p, p2, n * sizeof(T)); return p; }\
 static inline T *N ## _array_copy_from_pe(T *p, const T *p2, size_t n)\
-{ size_t i; if (NS ## is_native_pe()) memcpy(p, p2, n * sizeof(T)); else\
-  for (i = 0; i < n; ++i) N ## _copy_from_pe(&p[i], &p2[i]); return p; }\
+{ size_t i; if (NS ## is_native_pe()) { memcpy(p, p2, n * sizeof(T)); } else\
+  { for (i = 0; i < n; ++i) { N ## _copy_from_pe(&p[i], &p2[i]); } } return p; 
}\
 static inline T *N ## _array_copy_to_pe(T *p, const T *p2, size_t n)\
-{ size_t i; if (NS ## is_native_pe()) memcpy(p, p2, n * sizeof(T)); else\
-  for (i = 0; i < n; ++i) N ## _copy_to_pe(&p[i], &p2[i]); return p; }
+{ size_t i; if (NS ## is_native_pe()) { memcpy(p, p2, n * sizeof(T)); } else\
+  { for (i = 0; i < n; ++i) { N ## _copy_to_pe(&p[i], &p2[i]); } } return p; }
 #define __flatbuffers_define_scalar_primitives(NS, N, T)\
 static inline T *N ## _from_pe(T *p) { return __ ## NS ## from_pe(p, N); }\
 static inline T *N ## _to_pe(T *p) { return __ ## NS ## to_pe(p, N); }\
diff --git a/dist/nanoarrow_testing.hpp b/dist/nanoarrow_testing.hpp
index 4e39ee09..a7602b70 100644
--- a/dist/nanoarrow_testing.hpp
+++ b/dist/nanoarrow_testing.hpp
@@ -1105,7 +1105,7 @@ class TestingJSONReader {
       } else if (num_batch == kNumBatchReadAll) {
         batch_ids.resize(batches.size());
         std::iota(batch_ids.begin(), batch_ids.end(), 0);
-      } else if (num_batch >= 0 && num_batch < batches.size()) {
+      } else if (num_batch >= 0 && static_cast<size_t>(num_batch) < 
batches.size()) {
         batch_ids.push_back(num_batch);
       } else {
         ArrowErrorSet(error, "Expected num_batch between 0 and %d but got %d",
@@ -1887,8 +1887,9 @@ class TestingJSONReader {
     const auto& columns = value["columns"];
     NANOARROW_RETURN_NOT_OK(
         Check(columns.is_array(), error, "RecordBatch columns must be array"));
-    NANOARROW_RETURN_NOT_OK(Check(columns.size() == array_view->n_children, 
error,
-                                  "RecordBatch children has incorrect size"));
+    NANOARROW_RETURN_NOT_OK(
+        Check(columns.size() == static_cast<size_t>(array_view->n_children), 
error,
+              "RecordBatch children has incorrect size"));
 
     for (int64_t i = 0; i < array_view->n_children; i++) {
       NANOARROW_RETURN_NOT_OK(SetArrayColumn(columns[i], schema->children[i],
@@ -1987,8 +1988,9 @@ class TestingJSONReader {
       const auto& children = value["children"];
       NANOARROW_RETURN_NOT_OK(
           Check(children.is_array(), error, error_prefix + "children must be 
array"));
-      NANOARROW_RETURN_NOT_OK(Check(children.size() == array_view->n_children, 
error,
-                                    error_prefix + "children has incorrect 
size"));
+      NANOARROW_RETURN_NOT_OK(
+          Check(children.size() == 
static_cast<size_t>(array_view->n_children), error,
+                error_prefix + "children has incorrect size"));
 
       for (int64_t i = 0; i < array_view->n_children; i++) {
         NANOARROW_RETURN_NOT_OK(SetArrayColumn(children[i], 
schema->children[i],
@@ -2272,7 +2274,8 @@ class TestingJSONReader {
     // Check offsets against values
     const T* expected_offset = reinterpret_cast<const T*>(offsets->data);
     NANOARROW_RETURN_NOT_OK(Check(
-        offsets->size_bytes == ((value.size() + 1) * sizeof(T)), error,
+        static_cast<size_t>(offsets->size_bytes) == ((value.size() + 1) * 
sizeof(T)),
+        error,
         "Expected offset buffer with " + std::to_string(value.size()) + " 
elements"));
     NANOARROW_RETURN_NOT_OK(
         Check(*expected_offset++ == 0, error, "first offset must be zero"));
@@ -2310,7 +2313,8 @@ class TestingJSONReader {
     // Check offsets against values if not fixed size
     const T* expected_offset = reinterpret_cast<const T*>(offsets->data);
     NANOARROW_RETURN_NOT_OK(Check(
-        offsets->size_bytes == ((value.size() + 1) * sizeof(T)), error,
+        static_cast<size_t>(offsets->size_bytes) == ((value.size() + 1) * 
sizeof(T)),
+        error,
         "Expected offset buffer with " + std::to_string(value.size()) + " 
elements"));
     NANOARROW_RETURN_NOT_OK(
         Check(*expected_offset++ == 0, error, "first offset must be zero"));
@@ -2355,7 +2359,7 @@ class TestingJSONReader {
         Check(item.is_string(), error, "binary data buffer item must be 
string"));
     auto item_str = item.get<std::string>();
 
-    int64_t item_size_bytes = item_str.size() / 2;
+    size_t item_size_bytes = item_str.size() / 2;
     NANOARROW_RETURN_NOT_OK(Check((item_size_bytes * 2) == item_str.size(), 
error,
                                   "binary data buffer item must have even 
size"));
 
@@ -2502,7 +2506,7 @@ class TestingJSONComparison {
 
  public:
   /// \brief Returns the number of differences found by the previous call
-  size_t num_differences() const { return differences_.size(); }
+  int64_t num_differences() const { return differences_.size(); }
 
   /// \brief Dump a human-readable summary of differences to out
   void WriteDifferences(std::ostream& out) {

Reply via email to