-
Notifications
You must be signed in to change notification settings - Fork 199
Update for rust-master: specify mutability of bare pointers, and width of integer literals. #38
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
Conversation
* `rust` master has replaced bare pointer (`*`) w/ `*mut` and `*const`
This code is equivalent to the original, specifying the `int` type. This type is defined as being pointer-width.
Thanks for this! I think you've gotten the pointer conversions incorrect though. According to @alexcrichton, C
|
Doing that will have Inside So we would also have to change the Is that OK? |
The `rust` allocated memory for the version no. needs to be modified by FFI. In light of recent changes: we mark the variables as mutable, and make sure the FFI accepts mutable raw pointers.
Oh geeze, that was bad of me. You're fix is the right thing to do. |
|
||
fn zmq_socket(ctx: Context_, typ: c_int) -> Socket_; | ||
fn zmq_close(socket: Socket_) -> c_int; | ||
|
||
fn zmq_getsockopt(socket: Socket_, opt: c_int, optval: *mut c_void, size: *mut size_t) -> c_int; | ||
fn zmq_setsockopt(socket: Socket_, opt: c_int, optval: *c_void, size: size_t) -> c_int; | ||
fn zmq_setsockopt(socket: Socket_, opt: c_int, optval: *mut c_void, size: size_t) -> c_int; |
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.
optval
should have a type *const c_void
.
other than that fix and cleaning up the later calls to zmq_setsockopt, it looks great. Once you fix it, i'll merge it in. thanks! |
Update for rust-master: specify mutability of bare pointers, and width of integer literals.
Thanks! |
This fixes two breaking changes from the
rust
nightlies.*T
has been removed from the language in favor of*mut T
and*const T
*const T
unless the pointer is passed to a callee which expects an&mut
referenceThese changes allow me to continue building
rust-zmq
on the following version ofrustc
:rustc 0.11.0-pre (b569c77148e8e839b38b678c7c167efc643d2721 2014-06-29 11:21:39 +0000)
c5e2fe4
tested onrustc 0.11.0-pre (566b57f3de7de80599b052b1a042eef8c9091e7f 2014-06-30 12:16:30 +0000)