mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-06-03 02:18:12 +00:00
Zig 0.15: zig fmt
This commit is contained in:
@@ -193,8 +193,8 @@ pub const Face = struct {
|
||||
) void {
|
||||
c.FT_Set_Transform(
|
||||
self.handle,
|
||||
@constCast(@ptrCast(matrix)),
|
||||
@constCast(@ptrCast(delta)),
|
||||
@ptrCast(@constCast(matrix)),
|
||||
@ptrCast(@constCast(delta)),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -68,7 +68,7 @@ pub const MutableArray = opaque {
|
||||
comptime Elem: type,
|
||||
value: *const Elem,
|
||||
) void {
|
||||
CFArrayAppendValue(self, @constCast(@ptrCast(value)));
|
||||
CFArrayAppendValue(self, @ptrCast(@constCast(value)));
|
||||
}
|
||||
|
||||
pub fn removeValue(self: *MutableArray, idx: usize) void {
|
||||
|
||||
@@ -10,7 +10,7 @@ pub const AttributedString = opaque {
|
||||
str: *foundation.String,
|
||||
attributes: *foundation.Dictionary,
|
||||
) Allocator.Error!*AttributedString {
|
||||
return @constCast(@ptrCast(c.CFAttributedStringCreate(
|
||||
return @ptrCast(@constCast(c.CFAttributedStringCreate(
|
||||
null,
|
||||
@ptrCast(str),
|
||||
@ptrCast(attributes),
|
||||
|
||||
@@ -17,8 +17,8 @@ pub const Dictionary = opaque {
|
||||
|
||||
return @as(?*Dictionary, @ptrFromInt(@intFromPtr(c.CFDictionaryCreate(
|
||||
null,
|
||||
@constCast(@ptrCast(if (keys) |slice| slice.ptr else null)),
|
||||
@constCast(@ptrCast(if (values) |slice| slice.ptr else null)),
|
||||
@ptrCast(@constCast(if (keys) |slice| slice.ptr else null)),
|
||||
@ptrCast(@constCast(if (values) |slice| slice.ptr else null)),
|
||||
@intCast(if (keys) |slice| slice.len else 0),
|
||||
&c.kCFTypeDictionaryKeyCallBacks,
|
||||
&c.kCFTypeDictionaryValueCallBacks,
|
||||
|
||||
@@ -68,7 +68,7 @@ pub const Font = opaque {
|
||||
}
|
||||
|
||||
pub fn copyTable(self: *Font, tag: FontTableTag) ?*foundation.Data {
|
||||
return @constCast(@ptrCast(c.CTFontCopyTable(
|
||||
return @ptrCast(@constCast(c.CTFontCopyTable(
|
||||
@ptrCast(self),
|
||||
@intFromEnum(tag),
|
||||
c.kCTFontTableOptionNoOptions,
|
||||
@@ -90,7 +90,7 @@ pub const Font = opaque {
|
||||
}
|
||||
|
||||
pub fn createPathForGlyph(self: *Font, glyph: graphics.Glyph) ?*graphics.Path {
|
||||
return @constCast(@ptrCast(c.CTFontCreatePathForGlyph(
|
||||
return @ptrCast(@constCast(c.CTFontCreatePathForGlyph(
|
||||
@ptrCast(self),
|
||||
glyph,
|
||||
null,
|
||||
|
||||
@@ -51,7 +51,7 @@ pub const Line = opaque {
|
||||
}
|
||||
|
||||
pub fn getGlyphRuns(self: *Line) *foundation.Array {
|
||||
return @constCast(@ptrCast(c.CTLineGetGlyphRuns(@ptrCast(self))));
|
||||
return @ptrCast(@constCast(c.CTLineGetGlyphRuns(@ptrCast(self))));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ pub const DisplayLink = opaque {
|
||||
|
||||
callbackFn(
|
||||
displayLink,
|
||||
@alignCast(@ptrCast(inner_userinfo)),
|
||||
@ptrCast(@alignCast(inner_userinfo)),
|
||||
);
|
||||
return c.kCVReturnSuccess;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ const errors = @import("errors.zig");
|
||||
/// the encodings that the program will use.
|
||||
pub fn init(encs: []const *Encoding) !void {
|
||||
_ = try errors.convertError(c.onig_initialize(
|
||||
@constCast(@ptrCast(@alignCast(encs.ptr))),
|
||||
@ptrCast(@alignCast(@constCast(encs.ptr))),
|
||||
@intCast(encs.len),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ pub fn decode(alloc: Allocator, data: []const u8) Error!ImageData {
|
||||
}
|
||||
|
||||
var source_buffer: c.wuffs_base__io_buffer = .{
|
||||
.data = .{ .ptr = @constCast(@ptrCast(data.ptr)), .len = data.len },
|
||||
.data = .{ .ptr = @ptrCast(@constCast(data.ptr)), .len = data.len },
|
||||
.meta = .{
|
||||
.wi = data.len,
|
||||
.ri = 0,
|
||||
|
||||
@@ -31,7 +31,7 @@ pub fn decode(alloc: Allocator, data: []const u8) Error!ImageData {
|
||||
}
|
||||
|
||||
var source_buffer: c.wuffs_base__io_buffer = .{
|
||||
.data = .{ .ptr = @constCast(@ptrCast(data.ptr)), .len = data.len },
|
||||
.data = .{ .ptr = @ptrCast(@constCast(data.ptr)), .len = data.len },
|
||||
.meta = .{
|
||||
.wi = data.len,
|
||||
.ri = 0,
|
||||
|
||||
Reference in New Issue
Block a user