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

Commit 6db694d

Browse files
author
bors-servo
authored
Auto merge of #90 - rthomas:89-warnings, r=jdm
Remove warnings for zero-sized structs This change removes a bunch of warnings from the crate. The only remaining warnings are due to the bitflags macro usage. This will help fix servo/core-text-rs#62 when it upgrades to `core-graphics = 0.9`. @jdm <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/90) <!-- Reviewable:end -->
2 parents 4ede46b + 4e29474 commit 6db694d

10 files changed

+26
-17
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "core-graphics"
33
description = "Bindings to Core Graphics for OS X"
44
homepage = "https://github.com/servo/core-graphics-rs"
55
repository = "https://github.com/servo/core-graphics-rs"
6-
version = "0.9.0"
6+
version = "0.9.1"
77
authors = ["The Servo Project Developers"]
88
license = "MIT / Apache-2.0"
99

src/base.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ pub type CGFloat = libc::c_float;
2828

2929
pub type CGError = libc::int32_t;
3030

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

3335
pub const kCGImageAlphaNone: u32 = 0;
3436
pub const kCGImageAlphaPremultipliedLast: u32 = 1;

src/color_space.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
use core_foundation::base::{CFRelease, CFRetain, CFTypeID, CFTypeRef, TCFType};
1111
use std::mem;
1212

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

1617
pub type CGColorSpaceRef = *const __CGColorSpace;
1718

src/context.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ pub enum CGTextDrawingMode {
2828
CGTextClip
2929
}
3030

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

3435
pub type CGContextRef = *const __CGContext;
3536

src/data_provider.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ pub type CGDataProviderReleaseBytePointerCallback = Option<unsafe extern fn (*mu
2626
pub type CGDataProviderReleaseDataCallback = Option<unsafe extern fn (*mut c_void, *const c_void, size_t)>;
2727
pub type CGDataProviderGetBytesAtPositionCallback = Option<unsafe extern fn (*mut c_void, *mut c_void, off_t, size_t)>;
2828

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

3233
pub type CGDataProviderRef = *const __CGDataProvider;
3334

src/event.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub type CGKeyCode = libc::uint16_t;
1212
///
1313
/// [Ref](http://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-700/IOHIDSystem/IOKit/hidsystem/IOLLEvent.h)
1414
bitflags! {
15+
#[repr(C)]
1516
pub struct CGEventFlags: u64 {
1617
const CGEventFlagNull = 0;
1718

@@ -88,8 +89,9 @@ pub enum CGEventTapLocation {
8889
AnnotatedSession,
8990
}
9091

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

9496
pub type CGEventRef = *const __CGEvent;
9597

src/event_source.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ pub enum CGEventSourceStateID {
1212
HIDSystemState = 1,
1313
}
1414

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

1819
pub type CGEventSourceRef = *const __CGEventSource;
1920

src/font.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ use std::ptr;
1717

1818
pub type CGGlyph = libc::c_ushort;
1919

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

2324
pub type CGFontRef = *const __CGFont;
2425

src/image.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ pub enum CGImageByteOrderInfo {
2727
CGImageByteOrder32Big = (4 << 12)
2828
}
2929

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

3334
pub type CGImageRef = *const __CGImage;
3435

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// except according to those terms.
99

1010
extern crate libc;
11-
#[macro_use]
1211
extern crate core_foundation;
1312

1413
#[macro_use]

0 commit comments

Comments
 (0)