Skip to content

Commit

Permalink
Merge pull request #108 from king6cong/master
Browse files Browse the repository at this point in the history
adapt to #[deny(transmute_from_fn_item_types)]
  • Loading branch information
Dave Herman authored Sep 6, 2016
2 parents eca0874 + b420ed7 commit 1b035f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/internal/js/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ pub trait ClassInternal: Class {

let (call_callback, call_kernel) = match descriptor.call {
Some(k) => k.export(),
None => (mem::transmute(ConstructorCallKernel::unimplemented::<Self>), null_mut())
None => (mem::transmute(ConstructorCallKernel::unimplemented::<Self> as usize), null_mut())
};

let metadata_pointer = neon_sys::class::create_base(isolate,
Expand Down
6 changes: 3 additions & 3 deletions src/internal/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl IsolateInternal for Isolate {
let b: Box<ClassMap> = Box::new(ClassMap::new());
let raw = Box::into_raw(b);
ptr = unsafe { mem::transmute(raw) };
let free_map: *mut c_void = unsafe { mem::transmute(drop_class_map) };
let free_map: *mut c_void = unsafe { mem::transmute(drop_class_map as usize) };
unsafe {
neon_sys::class::set_class_map(self.to_raw(), ptr, free_map);
}
Expand Down Expand Up @@ -176,7 +176,7 @@ impl<'a> Module<'a> {
let mut scope = RootScope::new(unsafe { mem::transmute(neon_sys::object::get_isolate(exports.to_raw())) });
unsafe {
let kernel: *mut c_void = mem::transmute(init);
let callback: extern "C" fn(*mut c_void, *mut c_void, *mut c_void) = mem::transmute(module_callback);
let callback: extern "C" fn(*mut c_void, *mut c_void, *mut c_void) = mem::transmute(module_callback as usize);
let exports: raw::Local = exports.to_raw();
let scope: *mut c_void = mem::transmute(&mut scope);
neon_sys::module::exec_kernel(kernel, callback, exports, scope);
Expand Down Expand Up @@ -270,7 +270,7 @@ pub trait Kernel<T: Clone + Copy + Sized>: Sized {
/// and the kernel function, both converted to raw void pointers.
fn export(self) -> (*mut c_void, *mut c_void) {
unsafe {
(mem::transmute(Self::callback), self.as_ptr())
(mem::transmute(Self::callback as usize), self.as_ptr())
}
}
}
Expand Down

0 comments on commit 1b035f7

Please # to comment.