Skip to content

Commit 1e1949b

Browse files
committed
fix: Handle c_ulong type differences between Windows and Unix in FFI
- c_ulong is u32 on Windows but u64 on Unix platforms - Use u64::from() to convert c_ulong values to u64 safely on both platforms - Add clippy allow for useless_conversion (necessary for cross-platform compat) - Fixes type mismatch errors in vortex_ffi::file::vx_file_scan_options 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Claude <[email protected]>
1 parent 1ea8974 commit 1e1949b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

vortex-ffi/src/file.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ impl vx_file_scan_options {
108108
/// Processes FFI scan options.
109109
///
110110
/// Extracts and converts a scan configuration from an FFI options struct.
111+
#[allow(clippy::useless_conversion)] // c_ulong is u32 on Windows, u64 on Unix
111112
fn process_scan_options(&self, session: &VortexSession) -> VortexResult<ScanOptions> {
112113
// Extract field names for projection.
113114
let projection_expr = extract_expression(
@@ -123,7 +124,7 @@ impl vx_file_scan_options {
123124
)?;
124125

125126
let row_range = (self.row_range_end > self.row_range_start)
126-
.then_some(self.row_range_start..self.row_range_end);
127+
.then_some(u64::from(self.row_range_start)..u64::from(self.row_range_end));
127128

128129
let split_by = (self.split_by_row_count > 0)
129130
.then_some(SplitBy::RowCount(self.split_by_row_count as usize));
@@ -133,7 +134,7 @@ impl vx_file_scan_options {
133134
filter_expr,
134135
split_by,
135136
row_range,
136-
row_offset: self.row_offset,
137+
row_offset: u64::from(self.row_offset),
137138
})
138139
}
139140
}

0 commit comments

Comments
 (0)