Skip to content
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

Merged
merged 1 commit into from
Aug 15, 2019
Merged

Conversation

BaoshanPang
Copy link

@@ -2167,6 +2016,9 @@ extern {
iov: *const ::iovec,
iovcnt: ::c_int,
) -> ::ssize_t;

// randomNumGen.h
pub fn randBytes(buf: *mut u8, length: i32) -> i32;

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).

@BaoshanPang BaoshanPang force-pushed the bpang-issue1469 branch 2 times, most recently from 3aa5260 to 1888cbd Compare August 14, 2019 23:27
@n-salim
Copy link
Collaborator

n-salim commented Aug 14, 2019

Let's add randABytes and randUBytes too. I need to check which of these is the best to use in the rand crate.

@BaoshanPang
Copy link
Author

Let's add randABytes and randUBytes too. I need to check which of these is the best to use in the rand crate.

Sure.

Copy link
Collaborator

@n-salim n-salim left a 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

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;
Copy link
Author

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.

Copy link
Collaborator

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.

Copy link
Author

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
@BaoshanPang BaoshanPang merged commit e1a417f into master Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants