Skip to content

Array size must be constant #45

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/zmq/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ type Context_ = *mut c_void;
/// A ZMQ socket
type Socket_ = *mut c_void;

static MsgSize_: uint = 48;
const MSG_SIZE_: uint = 48;

/// A message
type Msg_ = [c_char, ..MsgSize_];
type Msg_ = [c_char, ..MSG_SIZE_];

#[link(name = "zmq")]
extern {
Expand Down Expand Up @@ -347,7 +347,7 @@ impl Socket {
unsafe {
let base_ptr = data.as_ptr();
let len = data.len();
let msg = [0, ..MsgSize_];
let msg = [0, ..MSG_SIZE_];

// Copy the data into the message.
let rc = zmq_msg_init_size(&msg, len as size_t);
Expand Down Expand Up @@ -615,7 +615,7 @@ impl Drop for Message {
impl Message {
pub fn new() -> Message {
unsafe {
let message = Message { msg: [0, ..MsgSize_] };
let message = Message { msg: [0, ..MSG_SIZE_] };
let _ = zmq_msg_init(&message.msg);
message
}
Expand Down