glfw: replace isize, usize with i32, u32 where appropriate (#126)

Fixes hexops/mach#114
This commit is contained in:
Ali Chraghi 2021-12-14 19:50:14 +03:30 committed by GitHub
parent 8b5fdbc333
commit 595cf48450
Failed to generate hash of commit
8 changed files with 87 additions and 87 deletions

View file

@ -10,33 +10,33 @@ const VideoMode = @This();
handle: c.GLFWvidmode,
/// Returns the width of the video mode, in screen coordinates.
pub inline fn getWidth(self: VideoMode) usize {
return @intCast(usize, self.handle.width);
pub inline fn getWidth(self: VideoMode) u32 {
return @intCast(u32, self.handle.width);
}
/// Returns the height of the video mode, in screen coordinates.
pub inline fn getHeight(self: VideoMode) usize {
return @intCast(usize, self.handle.height);
pub inline fn getHeight(self: VideoMode) u32 {
return @intCast(u32, self.handle.height);
}
/// Returns the bit depth of the red channel of the video mode.
pub inline fn getRedBits(self: VideoMode) usize {
return @intCast(usize, self.handle.redBits);
pub inline fn getRedBits(self: VideoMode) u32 {
return @intCast(u32, self.handle.redBits);
}
/// Returns the bit depth of the green channel of the video mode.
pub inline fn getGreenBits(self: VideoMode) usize {
return @intCast(usize, self.handle.greenBits);
pub inline fn getGreenBits(self: VideoMode) u32 {
return @intCast(u32, self.handle.greenBits);
}
/// Returns the bit depth of the blue channel of the video mode.
pub inline fn getBlueBits(self: VideoMode) usize {
return @intCast(usize, self.handle.blueBits);
pub inline fn getBlueBits(self: VideoMode) u32 {
return @intCast(u32, self.handle.blueBits);
}
/// Returns the refresh rate of the video mode, in Hz.
pub inline fn getRefreshRate(self: VideoMode) usize {
return @intCast(usize, self.handle.refreshRate);
pub inline fn getRefreshRate(self: VideoMode) u32 {
return @intCast(u32, self.handle.refreshRate);
}
test "getters" {