diff --git a/include/sparrow/c_interface.hpp b/include/sparrow/c_interface.hpp index 2ab669b5..ac535cce 100644 --- a/include/sparrow/c_interface.hpp +++ b/include/sparrow/c_interface.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #include "sparrow/allocator.hpp" @@ -28,36 +29,36 @@ extern "C" struct ArrowSchema { // Array type description - const char* format; - const char* name; - const char* metadata; - int64_t flags; - int64_t n_children; - struct ArrowSchema** children; - struct ArrowSchema* dictionary; + const char* format = nullptr; + const char* name = nullptr; + const char* metadata = nullptr; + int64_t flags = 0; + int64_t n_children = 0; + struct ArrowSchema** children = nullptr; + struct ArrowSchema* dictionary = nullptr; // Release callback - void (*release)(struct ArrowSchema*); + void (*release)(struct ArrowSchema*) = nullptr; // Opaque producer-specific data - void* private_data; + void* private_data = nullptr; }; struct ArrowArray { // Array data description - int64_t length; - int64_t null_count; - int64_t offset; - int64_t n_buffers; - int64_t n_children; - const void** buffers; - struct ArrowArray** children; - struct ArrowArray* dictionary; + int64_t length = 0; + int64_t null_count = 0; + int64_t offset = 0; + int64_t n_buffers = 0; + int64_t n_children = 0; + const void** buffers = nullptr; + struct ArrowArray** children = nullptr; + struct ArrowArray* dictionary = nullptr; // Release callback - void (*release)(struct ArrowArray*); + void (*release)(struct ArrowArray*) = nullptr; // Opaque producer-specific data - void* private_data; + void* private_data = nullptr; }; #ifdef __cplusplus @@ -66,15 +67,15 @@ extern "C" namespace sparrow { - template + template class Allocator> struct ArrowArrayPrivateData { ArrowArrayPrivateData() - : buffer_allocator(std::move(Allocator())) + : buffer_allocator(std::move(Allocator())) { } - explicit ArrowArrayPrivateData(const Allocator& allocator) + explicit ArrowArrayPrivateData(const Allocator& allocator) : buffer_allocator(allocator) { } @@ -82,7 +83,7 @@ namespace sparrow any_allocator buffer_allocator; }; - template class Allocator> + template