diff --git a/src/array.rs b/src/array.rs index 972e502..831f8c7 100644 --- a/src/array.rs +++ b/src/array.rs @@ -28,6 +28,7 @@ pub type CFArrayCopyDescriptionCallBack = *const u8; pub type CFArrayEqualCallBack = *const u8; #[allow(dead_code)] +#[repr(C)] pub struct CFArrayCallBacks { version: CFIndex, retain: CFArrayRetainCallBack, @@ -36,6 +37,7 @@ pub struct CFArrayCallBacks { equal: CFArrayEqualCallBack, } +#[repr(C)] struct __CFArray; pub type CFArrayRef = *const __CFArray; diff --git a/src/base.rs b/src/base.rs index 83b020b..ecd1e79 100644 --- a/src/base.rs +++ b/src/base.rs @@ -34,6 +34,7 @@ impl CFIndexConvertible for uint { pub type CFOptionFlags = u32; #[allow(dead_code)] +#[repr(C)] pub struct CFRange { location: CFIndex, length: CFIndex @@ -48,10 +49,12 @@ impl CFRange { } } +#[repr(C)] struct __CFAllocator; pub type CFAllocatorRef = *const __CFAllocator; +#[repr(C)] struct __CFNull; pub type CFNullRef = *const __CFNull; @@ -60,6 +63,7 @@ pub type CFHashCode = c_ulong; pub type CFTypeID = c_ulong; +#[repr(C)] struct __CFType; pub type CFTypeRef = *const __CFType; diff --git a/src/boolean.rs b/src/boolean.rs index 38fea3d..0f00a16 100644 --- a/src/boolean.rs +++ b/src/boolean.rs @@ -14,6 +14,7 @@ use std::mem; pub type Boolean = u32; +#[repr(C)] struct __CFBoolean; pub type CFBooleanRef = *const __CFBoolean; diff --git a/src/bundle.rs b/src/bundle.rs index 54aca00..ea3b4ab 100644 --- a/src/bundle.rs +++ b/src/bundle.rs @@ -15,6 +15,7 @@ use std::mem; use string::CFStringRef; use libc::c_void; +#[repr(C)] struct __CFBundle; pub type CFBundleRef = *const __CFBundle; diff --git a/src/data.rs b/src/data.rs index 2a6fabc..b889d38 100644 --- a/src/data.rs +++ b/src/data.rs @@ -14,6 +14,7 @@ use base::{CFTypeID, CFTypeRef, TCFType, kCFAllocatorDefault}; use std::mem; +#[repr(C)] struct __CFData; pub type CFDataRef = *const __CFData; diff --git a/src/dictionary.rs b/src/dictionary.rs index a4b3176..5b17bdf 100644 --- a/src/dictionary.rs +++ b/src/dictionary.rs @@ -25,6 +25,7 @@ pub type CFDictionaryReleaseCallBack = *const u8; pub type CFDictionaryRetainCallBack = *const u8; #[allow(dead_code)] +#[repr(C)] pub struct CFDictionaryKeyCallBacks { version: CFIndex, retain: CFDictionaryRetainCallBack, @@ -35,6 +36,7 @@ pub struct CFDictionaryKeyCallBacks { } #[allow(dead_code)] +#[repr(C)] pub struct CFDictionaryValueCallBacks { version: CFIndex, retain: CFDictionaryRetainCallBack, @@ -43,6 +45,7 @@ pub struct CFDictionaryValueCallBacks { equal: CFDictionaryEqualCallBack } +#[repr(C)] struct __CFDictionary; pub type CFDictionaryRef = *const __CFDictionary; diff --git a/src/lib.rs b/src/lib.rs index d1f3eed..d06c9eb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,7 +10,7 @@ #![crate_name = "core_foundation"] #![crate_type = "rlib"] -#![allow(non_snake_case_functions)] +#![allow(non_snake_case)] extern crate libc; diff --git a/src/number.rs b/src/number.rs index f0d3a46..6b27fe2 100644 --- a/src/number.rs +++ b/src/number.rs @@ -9,7 +9,7 @@ //! Immutable numbers. -#![allow(non_uppercase_statics)] +#![allow(non_upper_case_globals)] use base::{CFAllocatorRef, CFRelease, CFRetain, CFTypeID, CFTypeRef}; use base::{TCFType, kCFAllocatorDefault}; @@ -38,6 +38,7 @@ static kCFNumberFloat64Type: CFNumberType = 6; // static kCFNumberCGFloatType: CFNumberType = 16; // static kCFNumberMaxType: CFNumberType = 16; +#[repr(C)] struct __CFNumber; pub type CFNumberRef = *const __CFNumber; diff --git a/src/set.rs b/src/set.rs index 61b72ee..d053277 100644 --- a/src/set.rs +++ b/src/set.rs @@ -22,6 +22,7 @@ pub type CFSetEqualCallBack = *const u8; pub type CFSetHashCallBack = *const u8; #[allow(dead_code)] +#[repr(C)] pub struct CFSetCallBacks { version: CFIndex, retain: CFSetRetainCallBack, @@ -31,6 +32,7 @@ pub struct CFSetCallBacks { hash: CFSetHashCallBack, } +#[repr(C)] struct __CFSet; pub type CFSetRef = *const __CFSet; diff --git a/src/string.rs b/src/string.rs index bea8d18..1a7bcb4 100644 --- a/src/string.rs +++ b/src/string.rs @@ -9,7 +9,7 @@ //! Immutable strings. -#![allow(non_uppercase_statics)] +#![allow(non_upper_case_globals)] use base::{Boolean, CFAllocatorRef, CFIndex, CFIndexConvertible, CFOptionFlags, CFRange}; use base::{CFRelease, CFRetain, CFTypeID, CFTypeRef, TCFType}; @@ -198,6 +198,7 @@ type CFStringEncodings = CFIndex; //static kCFStringEncodingUTF7_IMAP: CFStringEncoding = 0x0A10; //static kCFStringEncodingShiftJIS_X0213_00: CFStringEncoding = 0x0628; /* Deprecated */ +#[repr(C)] struct __CFString; pub type CFStringRef = *const __CFString; diff --git a/src/url.rs b/src/url.rs index fe37e59..cfe6e2f 100644 --- a/src/url.rs +++ b/src/url.rs @@ -9,7 +9,7 @@ //! A URL type for Core Foundation. -#![allow(non_uppercase_statics)] +#![allow(non_upper_case_globals)] use base::{CFOptionFlags, CFRelease, CFRetain, CFTypeID, CFTypeRef, TCFType}; use string::{CFString, CFStringRef}; @@ -17,6 +17,7 @@ use string::{CFString, CFStringRef}; use std::fmt; use std::mem; +#[repr(C)] struct __CFURL; pub type CFURLRef = *const __CFURL;