Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flatdata-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.10)
project(flatdata-cpp)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(flatdata/GenerateSource)

set(CMAKE_CXX_STANDARD 17)

find_package(Boost COMPONENTS system filesystem REQUIRED)
find_package(Boost COMPONENTS filesystem REQUIRED)
find_package(Threads REQUIRED)

file(GLOB FLATDATA_SOURCE
Expand Down
2 changes: 1 addition & 1 deletion flatdata-cpp/src/Archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ create_context( const std::vector< std::string >& diff )
lines_to_go = context_lines;
}

result_mask[ i ] = lines_to_go >= 0;
result_mask[ i - 1 ] = lines_to_go >= 0;
}
lines_to_go = -1;
for ( size_t i = 0; i < diff.size( ); i++, lines_to_go-- )
Expand Down
4 changes: 3 additions & 1 deletion flatdata-cpp/test/GeneratedArchiveTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ FATAL: Archive signature does not match software expectations.
-" inner : .test_structures.AStruct;"
"}"
"}"
""
...
"namespace test_structures {"
"archive OutermostArchive"
Expand All @@ -625,7 +626,7 @@ FATAL: Archive signature does not match software expectations.
-" outer : archive .test_structures.OuterArchive;"
"}"
"}"
...
""
)";
REQUIRE( description == expectation );
}
Expand Down Expand Up @@ -671,6 +672,7 @@ FATAL: Archive signature does not match software expectations.
-" inner : .test_structures.AStruct;"
"}"
"}"
""
...
)";
REQUIRE( description == expectation );
Expand Down
5 changes: 3 additions & 2 deletions flatdata-py/flatdata/lib/data_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ def read_field_vectorized(raw_bytes_2d: NDArray[np.uint8], field_offset_bits: in
if field_width_bits == 1:
byte_idx = field_offset_bits // 8
bit_idx = field_offset_bits % 8
return ((raw_bytes_2d[:, byte_idx].astype(np.uint64) >> np.uint64(bit_idx)) &
np.uint64(1))
bit: NDArray[np.uint64] = (
(raw_bytes_2d[:, byte_idx].astype(np.uint64) >> np.uint64(bit_idx)) & np.uint64(1))
return bit

byte_start = field_offset_bits // 8
bit_shift = field_offset_bits % 8
Expand Down
4 changes: 2 additions & 2 deletions flatdata-rs/lib/src/bytewriter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ macro_rules! flatdata_write_bytes {
if <$T as $crate::helper::Int>::IS_SIGNED {
value_to_store = flatdata_read_bytes!(@mask, value_to_store, $num_bits);
}
let mut value_mask = flatdata_read_bytes!(@mask, u64::max_value(), $num_bits);
let mut value_mask = flatdata_read_bytes!(@mask, u64::MAX, $num_bits);
let mut value: u64 = 0;

// read previous data from destination to value
Expand Down Expand Up @@ -1175,7 +1175,7 @@ mod test {
test_writer(1, 0, 3, &vec![1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
test_writer(1, 0, 2, &vec![1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
test_writer(1, 0, 1, &vec![1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
test_writer(u64::max_value(), 7, 64, &vec![128, 255, 255, 255, 255, 255, 255, 255, 127, 0, 0, 0, 0, 0, 0, 0, 0]);
test_writer(u64::MAX, 7, 64, &vec![128, 255, 255, 255, 255, 255, 255, 255, 127, 0, 0, 0, 0, 0, 0, 0, 0]);
}

fn test_reader_unsigned(value: i64, offset: usize, num_bits: usize, expected: &[u8]) {
Expand Down
Loading