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

Fix warnings with newer Rust #118

Merged
merged 1 commit into from Nov 6, 2014
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fix warnings with newer Rust

  • Loading branch information
Jack Moffitt
Jack Moffitt committed Nov 6, 2014
commit 2c9dafe1738deaf90d2b2a6c26cd5a3b2e69561c
@@ -11,6 +11,7 @@ use std::mem;
const JSVAL_TAG_SHIFT: uint = 47u;

#[repr(u8)]
#[allow(dead_code)]
enum ValueType {
JSVAL_TYPE_DOUBLE = 0x00,
JSVAL_TYPE_INT32 = 0x01,
@@ -34,6 +35,7 @@ const JSVAL_TAG_CLEAR: u32 = 0xFFFFFF80;

#[cfg(target_word_size = "64")]
#[repr(u32)]
#[allow(dead_code)]
enum ValueTag {
JSVAL_TAG_DOUBLE = JSVAL_TAG_MAX_DOUBLE | (JSVAL_TYPE_DOUBLE as u32),
JSVAL_TAG_INT32 = JSVAL_TAG_MAX_DOUBLE | (JSVAL_TYPE_INT32 as u32),
@@ -47,6 +49,7 @@ enum ValueTag {

#[cfg(target_word_size = "32")]
#[repr(u32)]
#[allow(dead_code)]
enum ValueTag {
JSVAL_TAG_PRIVATE = 0,
JSVAL_TAG_INT32 = JSVAL_TAG_CLEAR as u32 | (JSVAL_TYPE_INT32 as u32),
@@ -60,6 +63,7 @@ enum ValueTag {

#[cfg(target_word_size = "64")]
#[repr(u64)]
#[allow(dead_code)]
enum ValueShiftedTag {
JSVAL_SHIFTED_TAG_MAX_DOUBLE = (((JSVAL_TAG_MAX_DOUBLE as u64) << JSVAL_TAG_SHIFT) | 0xFFFFFFFFu64),
JSVAL_SHIFTED_TAG_INT32 = ((JSVAL_TAG_INT32 as u64) << JSVAL_TAG_SHIFT),
@@ -7,7 +7,7 @@

#![feature(globs, link_args, phase, unsafe_destructor)]

#![allow(non_uppercase_statics, non_camel_case_types, non_snake_case, ctypes)]
#![allow(non_upper_case_globals, non_camel_case_types, non_snake_case, improper_ctypes)]

#![reexport_test_harness_main = "test_main"]

@@ -19,7 +19,6 @@ use JSOPTION_VAROBJFIX;
use JSOPTION_METHODJIT;
use JSOPTION_TYPE_INFERENCE;
use ERR;
use green::task::GreenTask;

// ___________________________________________________________________________
// friendly Rustic API to runtimes
@@ -61,14 +60,12 @@ impl RtUtils for rc::Rc<rt_rsrc> {
pub unsafe extern fn gc_callback(rt: *mut JSRuntime, _status: JSGCStatus) {
use std::rt::local::Local;
use std::rt::task::Task;
unsafe {
let mut task = Local::borrow(None::<Task>);
let runtime = task.take_runtime();
let (start, end) = runtime.stack_bounds();
JS_SetNativeStackBounds(rt, cmp::min(start, end) as uintptr_t,
cmp::max(start, end) as uintptr_t);
task.put_runtime(runtime);
}
let mut task = Local::borrow(None::<Task>);
let runtime = task.take_runtime();
let (start, end) = runtime.stack_bounds();
JS_SetNativeStackBounds(rt, cmp::min(start, end) as uintptr_t,
cmp::max(start, end) as uintptr_t);
task.put_runtime(runtime);
}

pub fn rt() -> rt {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.