We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
The ffi interface in the snappy examples doesn't match the c-library types in snappy-c.h.
Should the ffi interface use libc::c_char instead of u8
libc::c_char
u8
https://github.com/google/snappy/blob/main/snappy-c.h#L71
snappy_status snappy_compress(const char* input, size_t input_length, char* compressed, size_t* compressed_length);
example here https://doc.rust-lang.org/nomicon/ffi.html#calling-foreign-functions
fn snappy_compress(input: *const u8, input_length: size_t, compressed: *mut u8, compressed_length: *mut size_t) -> c_int;
Would it be clearer to have these function definition match then cast the pointer inside the rust function.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
The ffi interface in the snappy examples doesn't match the c-library types in snappy-c.h.
Should the ffi interface use
libc::c_char
instead ofu8
https://github.com/google/snappy/blob/main/snappy-c.h#L71
example here
https://doc.rust-lang.org/nomicon/ffi.html#calling-foreign-functions
Would it be clearer to have these function definition match then cast the pointer inside the rust function.
The text was updated successfully, but these errors were encountered: