Add repr attributes in various places that need them.
This commit is contained in:
parent
ac311ecaab
commit
c8c08763ec
@ -139,7 +139,7 @@ mod test {
|
||||
|
||||
use enum_set::*;
|
||||
|
||||
#[deriving(Eq)]
|
||||
#[deriving(Eq)] #[repr(uint)]
|
||||
enum Foo {
|
||||
A, B, C
|
||||
}
|
||||
|
@ -147,6 +147,7 @@ pub static Vector: TypeKind = 13;
|
||||
pub static Metadata: TypeKind = 14;
|
||||
pub static X86_MMX: TypeKind = 15;
|
||||
|
||||
#[repr(C)]
|
||||
pub enum AtomicBinOp {
|
||||
Xchg = 0,
|
||||
Add = 1,
|
||||
@ -161,6 +162,7 @@ pub enum AtomicBinOp {
|
||||
UMin = 10,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub enum AtomicOrdering {
|
||||
NotAtomic = 0,
|
||||
Unordered = 1,
|
||||
@ -173,6 +175,7 @@ pub enum AtomicOrdering {
|
||||
}
|
||||
|
||||
// Consts for the LLVMCodeGenFileType type (in include/llvm/c/TargetMachine.h)
|
||||
#[repr(C)]
|
||||
pub enum FileType {
|
||||
AssemblyFile = 0,
|
||||
ObjectFile = 1
|
||||
@ -194,6 +197,7 @@ pub enum AsmDialect {
|
||||
}
|
||||
|
||||
#[deriving(Eq)]
|
||||
#[repr(C)]
|
||||
pub enum CodeGenOptLevel {
|
||||
CodeGenLevelNone = 0,
|
||||
CodeGenLevelLess = 1,
|
||||
@ -201,6 +205,7 @@ pub enum CodeGenOptLevel {
|
||||
CodeGenLevelAggressive = 3,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub enum RelocMode {
|
||||
RelocDefault = 0,
|
||||
RelocStatic = 1,
|
||||
@ -208,6 +213,7 @@ pub enum RelocMode {
|
||||
RelocDynamicNoPic = 3,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub enum CodeGenModel {
|
||||
CodeModelDefault = 0,
|
||||
CodeModelJITDefault = 1,
|
||||
|
@ -111,7 +111,7 @@ pub static tag_items_data_item_reexport_def_id: uint = 0x4e;
|
||||
pub static tag_items_data_item_reexport_name: uint = 0x4f;
|
||||
|
||||
// used to encode crate_ctxt side tables
|
||||
#[deriving(Eq)]
|
||||
#[deriving(Eq)] #[repr(uint)]
|
||||
pub enum astencode_tag { // Reserves 0x50 -- 0x6f
|
||||
tag_ast = 0x50,
|
||||
|
||||
@ -143,7 +143,7 @@ impl astencode_tag {
|
||||
pub fn from_uint(value : uint) -> Option<astencode_tag> {
|
||||
let is_a_tag = first_astencode_tag <= value && value <= last_astencode_tag;
|
||||
if !is_a_tag { None } else {
|
||||
Some(unsafe { cast::transmute(value as int) })
|
||||
Some(unsafe { cast::transmute(value) })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -715,7 +715,7 @@ pub struct ParamBounds {
|
||||
|
||||
pub type BuiltinBounds = EnumSet<BuiltinBound>;
|
||||
|
||||
#[deriving(Clone, Eq, IterBytes, ToStr)]
|
||||
#[deriving(Clone, Eq, IterBytes, ToStr)] #[repr(uint)]
|
||||
pub enum BuiltinBound {
|
||||
BoundStatic,
|
||||
BoundSend,
|
||||
|
@ -26,6 +26,7 @@ use result::{Err, Ok};
|
||||
use rt::io::io_error;
|
||||
use rt::rtio::{IoFactory, RtioSignal, with_local_io};
|
||||
|
||||
#[repr(int)]
|
||||
#[deriving(Eq, IterBytes)]
|
||||
pub enum Signum {
|
||||
/// Equivalent to SIGBREAK, delivered when the user presses Ctrl-Break.
|
||||
|
@ -26,7 +26,7 @@ pub mod pipes {
|
||||
payload: Option<T>
|
||||
}
|
||||
|
||||
#[deriving(Eq)]
|
||||
#[deriving(Eq)] #[repr(int)]
|
||||
pub enum state {
|
||||
empty,
|
||||
full,
|
||||
|
Loading…
x
Reference in New Issue
Block a user