Zig 0.15: zig fmt

This commit is contained in:
Mitchell Hashimoto
2025-10-01 11:23:06 -07:00
parent d02770d292
commit 7ec57aeebd
18 changed files with 31 additions and 31 deletions

View File

@@ -282,7 +282,7 @@ pub fn Common(
fn setter(self: *Self, value: ?[:0]const u8) void {
const priv = private(self);
if (@field(priv, name)) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
}
// We don't need to copy this because it was already

View File

@@ -172,7 +172,7 @@ pub const ResizeOverlay = extern struct {
/// overlay if it is currently hidden; you must call schedule.
pub fn setLabel(self: *Self, label: ?[:0]const u8) void {
const priv = self.private();
if (priv.label_text) |v| glib.free(@constCast(@ptrCast(v)));
if (priv.label_text) |v| glib.free(@ptrCast(@constCast(v)));
priv.label_text = null;
if (label) |v| priv.label_text = glib.ext.dupeZ(u8, v);
self.as(gobject.Object).notifyByPspec(properties.label.impl.param_spec);
@@ -285,7 +285,7 @@ pub const ResizeOverlay = extern struct {
fn finalize(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.label_text) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.label_text = null;
}

View File

@@ -1626,7 +1626,7 @@ pub const Surface = extern struct {
priv.core_surface = null;
}
if (priv.mouse_hover_url) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.mouse_hover_url = null;
}
if (priv.default_size) |v| {
@@ -1642,15 +1642,15 @@ pub const Surface = extern struct {
priv.min_size = null;
}
if (priv.pwd) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.pwd = null;
}
if (priv.title) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.title = null;
}
if (priv.title_override) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.title_override = null;
}
self.clearCgroup();
@@ -1674,7 +1674,7 @@ pub const Surface = extern struct {
/// title. For manually set titles see `setTitleOverride`.
pub fn setTitle(self: *Self, title: ?[:0]const u8) void {
const priv = self.private();
if (priv.title) |v| glib.free(@constCast(@ptrCast(v)));
if (priv.title) |v| glib.free(@ptrCast(@constCast(v)));
priv.title = null;
if (title) |v| priv.title = glib.ext.dupeZ(u8, v);
self.as(gobject.Object).notifyByPspec(properties.title.impl.param_spec);
@@ -1684,7 +1684,7 @@ pub const Surface = extern struct {
/// unless this is unset (null).
pub fn setTitleOverride(self: *Self, title: ?[:0]const u8) void {
const priv = self.private();
if (priv.title_override) |v| glib.free(@constCast(@ptrCast(v)));
if (priv.title_override) |v| glib.free(@ptrCast(@constCast(v)));
priv.title_override = null;
if (title) |v| priv.title_override = glib.ext.dupeZ(u8, v);
self.as(gobject.Object).notifyByPspec(properties.@"title-override".impl.param_spec);
@@ -1698,7 +1698,7 @@ pub const Surface = extern struct {
/// Set the pwd for this surface, copies the value.
pub fn setPwd(self: *Self, pwd: ?[:0]const u8) void {
const priv = self.private();
if (priv.pwd) |v| glib.free(@constCast(@ptrCast(v)));
if (priv.pwd) |v| glib.free(@ptrCast(@constCast(v)));
priv.pwd = null;
if (pwd) |v| priv.pwd = glib.ext.dupeZ(u8, v);
self.as(gobject.Object).notifyByPspec(properties.pwd.impl.param_spec);
@@ -1783,7 +1783,7 @@ pub const Surface = extern struct {
pub fn setMouseHoverUrl(self: *Self, url: ?[:0]const u8) void {
const priv = self.private();
if (priv.mouse_hover_url) |v| glib.free(@constCast(@ptrCast(v)));
if (priv.mouse_hover_url) |v| glib.free(@ptrCast(@constCast(v)));
priv.mouse_hover_url = null;
if (url) |v| priv.mouse_hover_url = glib.ext.dupeZ(u8, v);
self.as(gobject.Object).notifyByPspec(properties.@"mouse-hover-url".impl.param_spec);

View File

@@ -136,7 +136,7 @@ pub const SurfaceTitleDialog = extern struct {
fn finalize(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.initial_value) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.initial_value = null;
}

View File

@@ -270,11 +270,11 @@ pub const Tab = extern struct {
fn finalize(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.tooltip) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.tooltip = null;
}
if (priv.title) |v| {
glib.free(@constCast(@ptrCast(v)));
glib.free(@ptrCast(@constCast(v)));
priv.title = null;
}