diff --git a/libtiledbsoma/src/geometry/geometry.h b/libtiledbsoma/src/geometry/geometry.h index b2b5597313..c112be200d 100644 --- a/libtiledbsoma/src/geometry/geometry.h +++ b/libtiledbsoma/src/geometry/geometry.h @@ -22,7 +22,7 @@ enum GeometryType : uint32_t { GEOMETRYCOLLECTION = 7 }; -using BinaryBuffer = std::vector; +using BinaryBuffer = std::vector; struct GeometryCollection; using GenericGeometry = std::variant< diff --git a/libtiledbsoma/src/geometry/operators/io/read.h b/libtiledbsoma/src/geometry/operators/io/read.h index f1386bb056..db39320547 100644 --- a/libtiledbsoma/src/geometry/operators/io/read.h +++ b/libtiledbsoma/src/geometry/operators/io/read.h @@ -38,7 +38,7 @@ struct Reader { return value; } - std::vector buffer; + std::vector buffer; size_t position; }; diff --git a/libtiledbsoma/src/geometry/operators/io/write.cc b/libtiledbsoma/src/geometry/operators/io/write.cc index e86396ad85..9fd586b598 100644 --- a/libtiledbsoma/src/geometry/operators/io/write.cc +++ b/libtiledbsoma/src/geometry/operators/io/write.cc @@ -102,7 +102,7 @@ size_t wkb_size(const GenericGeometry& geometry) { } WKBWriteOperator::WKBWriteOperator( - uint8_t* buffer, size_t& position, size_t size) + std::byte* buffer, size_t& position, size_t size) : buffer(buffer) , position(position) , size(size) { @@ -185,7 +185,7 @@ void WKBWriteOperator::operator()(const GeometryCollection& collection) { } } -void to_wkb(const GenericGeometry& geometry, uint8_t* buffer, size_t size) { +void to_wkb(const GenericGeometry& geometry, std::byte* buffer, size_t size) { size_t position = 0; std::visit(WKBWriteOperator{buffer, position, size}, geometry); diff --git a/libtiledbsoma/src/geometry/operators/io/write.h b/libtiledbsoma/src/geometry/operators/io/write.h index b3d98b8029..4fb12fcd82 100644 --- a/libtiledbsoma/src/geometry/operators/io/write.h +++ b/libtiledbsoma/src/geometry/operators/io/write.h @@ -28,7 +28,7 @@ struct WKBSizeOperator { }; struct WKBWriteOperator { - WKBWriteOperator(uint8_t* buffer, size_t& position, size_t size); + WKBWriteOperator(std::byte* buffer, size_t& position, size_t size); template void write(const T& value) { @@ -47,7 +47,7 @@ struct WKBWriteOperator { void operator()(const MultiPolygon& multi_polygon); void operator()(const GeometryCollection& collection); - uint8_t* buffer; + std::byte* buffer; size_t& position; size_t size; }; diff --git a/libtiledbsoma/test/unit_soma_geometry_dataframe.cc b/libtiledbsoma/test/unit_soma_geometry_dataframe.cc index aa3daf5688..f8766e63c4 100644 --- a/libtiledbsoma/test/unit_soma_geometry_dataframe.cc +++ b/libtiledbsoma/test/unit_soma_geometry_dataframe.cc @@ -358,10 +358,7 @@ TEST_CASE("SOMAGeometryDataFrame: Roundtrip", "[SOMAGeometryDataFrame]") { CHECK( std::vector({1}) == std::vector(d4span.begin(), d4span.end())); - auto a = geometry::to_wkb(polygon); - for (size_t i = 0; i < wkbs[0].size(); ++i) { - CHECK(a[i] == (unsigned char)wkbs[0][i]); - } + CHECK(geometry::to_wkb(polygon) == wkbs[0]); CHECK( std::vector({63}) == std::vector(a0span.begin(), a0span.end()));