the.bay.news

Correctness: casting via `strict_cast()` vs `as`

The Rust Programming Language Forum
Correctness: casting via `strict_cast()` vs `as`
I'm looking for opinions and advice on the best way to cast "size of buffer" inputs required by ffi calls. given a function of the shape: pub unsafe fn DeviceIoControl( hdevice: HANDLE, dwiocontrolcode: u32, lpinbuffer: *const core::ffi::c_void, ninbuffersize: u32, // size of lpinbuffer lpoutbuffer: *mut core::ffi::c_void, noutbuffersize: u32, // size of lpoutbuffer lpbytesreturned: *mut u32, lpoverlapped: *mut OVERLAPPED, ) I'm trying to decide between 2 fun...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.