Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Remove warnings for zero-sized structs #90

Merged
merged 4 commits into from
Jul 27, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "core-graphics"
description = "Bindings to Core Graphics for OS X"
homepage = "https://github.com/servo/core-graphics-rs"
repository = "https://github.com/servo/core-graphics-rs"
version = "0.9.0"
version = "0.9.1"
authors = ["The Servo Project Developers"]
license = "MIT / Apache-2.0"

Expand Down
4 changes: 3 additions & 1 deletion src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ pub type CGFloat = libc::c_float;

pub type CGError = libc::int32_t;

pub type CGAffineTransform = ();
// This is an enum due to zero-sized types warnings.
// For more details see https://github.com/rust-lang/rust/issues/27303
pub enum CGAffineTransform {}

pub const kCGImageAlphaNone: u32 = 0;
pub const kCGImageAlphaPremultipliedLast: u32 = 1;
Expand Down
5 changes: 3 additions & 2 deletions src/color_space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
use core_foundation::base::{CFRelease, CFRetain, CFTypeID, CFTypeRef, TCFType};
use std::mem;

#[repr(C)]
pub struct __CGColorSpace;
// This is an enum due to zero-sized types warnings.
// For more details see https://github.com/rust-lang/rust/issues/27303
pub enum __CGColorSpace {}

pub type CGColorSpaceRef = *const __CGColorSpace;

Expand Down
5 changes: 3 additions & 2 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ pub enum CGTextDrawingMode {
CGTextClip
}

#[repr(C)]
pub struct __CGContext;
// This is an enum due to zero-sized types warnings.
// For more details see https://github.com/rust-lang/rust/issues/27303
pub enum __CGContext {}

pub type CGContextRef = *const __CGContext;

Expand Down
5 changes: 3 additions & 2 deletions src/data_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ pub type CGDataProviderReleaseBytePointerCallback = Option<unsafe extern fn (*mu
pub type CGDataProviderReleaseDataCallback = Option<unsafe extern fn (*mut c_void, *const c_void, size_t)>;
pub type CGDataProviderGetBytesAtPositionCallback = Option<unsafe extern fn (*mut c_void, *mut c_void, off_t, size_t)>;

#[repr(C)]
pub struct __CGDataProvider;
// This is an enum due to zero-sized types warnings.
// For more details see https://github.com/rust-lang/rust/issues/27303
pub enum __CGDataProvider {}

pub type CGDataProviderRef = *const __CGDataProvider;

Expand Down
6 changes: 4 additions & 2 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub type CGKeyCode = libc::uint16_t;
///
/// [Ref](http://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-700/IOHIDSystem/IOKit/hidsystem/IOLLEvent.h)
bitflags! {
#[repr(C)]
pub struct CGEventFlags: u64 {
const CGEventFlagNull = 0;

Expand Down Expand Up @@ -88,8 +89,9 @@ pub enum CGEventTapLocation {
AnnotatedSession,
}

#[repr(C)]
pub struct __CGEvent;
// This is an enum due to zero-sized types warnings.
// For more details see https://github.com/rust-lang/rust/issues/27303
pub enum __CGEvent {}

pub type CGEventRef = *const __CGEvent;

Expand Down
5 changes: 3 additions & 2 deletions src/event_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ pub enum CGEventSourceStateID {
HIDSystemState = 1,
}

#[repr(C)]
pub struct __CGEventSource;
// This is an enum due to zero-sized types warnings.
// For more details see https://github.com/rust-lang/rust/issues/27303
pub enum __CGEventSource {}

pub type CGEventSourceRef = *const __CGEventSource;

Expand Down
5 changes: 3 additions & 2 deletions src/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ use std::ptr;

pub type CGGlyph = libc::c_ushort;

#[repr(C)]
pub struct __CGFont;
// This is an enum due to zero-sized types warnings.
// For more details see https://github.com/rust-lang/rust/issues/27303
pub enum __CGFont {}

pub type CGFontRef = *const __CGFont;

Expand Down
5 changes: 3 additions & 2 deletions src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ pub enum CGImageByteOrderInfo {
CGImageByteOrder32Big = (4 << 12)
}

#[repr(C)]
pub struct __CGImage;
// This is an enum due to zero-sized types warnings.
// For more details see https://github.com/rust-lang/rust/issues/27303
pub enum __CGImage {}

pub type CGImageRef = *const __CGImage;

Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// except according to those terms.

extern crate libc;
#[macro_use]
extern crate core_foundation;

#[macro_use]
Expand Down