-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code cleanup and adding randBytes() #1
Conversation
src/vxworks/mod.rs
Outdated
@@ -2167,6 +2016,9 @@ extern { | |||
iov: *const ::iovec, | |||
iovcnt: ::c_int, | |||
) -> ::ssize_t; | |||
|
|||
// randomNumGen.h | |||
pub fn randBytes(buf: *mut u8, length: i32) -> i32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency you should use pub fn randBytes(buf: *mut ::c_uchar, length: ::c_int) -> c_int
(or whatever types you have in randomNumGen.h
).
3aa5260
to
1888cbd
Compare
Let's add randABytes and randUBytes too. I need to check which of these is the best to use in the rand crate. |
1888cbd
to
73dee2c
Compare
Sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also let's cleanup the comment right at the top of the file:
//! Hacking together the definitions for VxWorks Bindings
Suggest replacing with:
//! Interface to VxWorks C library
73dee2c
to
0d12127
Compare
src/vxworks/mod.rs
Outdated
pub fn randBytes(buf: *mut c_uchar, length: c_int) -> c_int; | ||
pub fn randABytes(buf: *mut c_uchar, length: c_int) -> c_int; | ||
pub fn randUBytes(buf: *mut c_uchar, length: c_int) -> c_int; | ||
pub fn randSecure() -> BOOL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@n-salim
Should I change BOOL to c_int ? althoug the BOOL is defined as c_int here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes make it c_int to align to the proposed future signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
…askDelay() 2. change armv7-wrs-vxworks to armv7-wrs-vxworks-eabihf 3. code cleanup
0d12127
to
c282904
Compare
This is to address: