zig: switch all uses of callconv(.C) to callconv(.c) (#8153)

This commit is contained in:
Mitchell Hashimoto
2025-08-05 09:14:52 -07:00
committed by GitHub
14 changed files with 47 additions and 47 deletions

View File

@@ -979,7 +979,7 @@ pub const Application = extern struct {
//---------------------------------------------------------------
// Virtual Methods
fn startup(self: *Self) callconv(.C) void {
fn startup(self: *Self) callconv(.c) void {
log.debug("startup", .{});
gio.Application.virtual_methods.startup.call(
@@ -1237,7 +1237,7 @@ pub const Application = extern struct {
priv.transient_cgroup_base = path;
}
fn activate(self: *Self) callconv(.C) void {
fn activate(self: *Self) callconv(.c) void {
log.debug("activate", .{});
// Queue a new window
@@ -1253,7 +1253,7 @@ pub const Application = extern struct {
);
}
fn dispose(self: *Self) callconv(.C) void {
fn dispose(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.config_errors_dialog.get()) |diag| {
diag.close();
@@ -1272,7 +1272,7 @@ pub const Application = extern struct {
);
}
fn finalize(self: *Self) callconv(.C) void {
fn finalize(self: *Self) callconv(.c) void {
self.deinit();
gobject.Object.virtual_methods.finalize.call(
Class.parent,
@@ -1545,7 +1545,7 @@ pub const Application = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
// Register our compiled resources exactly once.
{
const c = @cImport({

View File

@@ -150,7 +150,7 @@ pub const ClipboardConfirmationDialog = extern struct {
return gobject.ext.newInstance(Self, .{});
}
fn init(self: *Self, _: *Class) callconv(.C) void {
fn init(self: *Self, _: *Class) callconv(.c) void {
gtk.Widget.initTemplate(self.as(gtk.Widget));
// Trigger initial values
@@ -239,7 +239,7 @@ pub const ClipboardConfirmationDialog = extern struct {
fn response(
self: *Self,
response_id: [*:0]const u8,
) callconv(.C) void {
) callconv(.c) void {
const remember: bool = if (comptime can_remember) remember: {
const priv = self.private();
break :remember priv.remember_choice.getActive() != 0;
@@ -262,7 +262,7 @@ pub const ClipboardConfirmationDialog = extern struct {
}
}
fn dispose(self: *Self) callconv(.C) void {
fn dispose(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.clipboard_contents) |v| {
v.unref();
@@ -280,7 +280,7 @@ pub const ClipboardConfirmationDialog = extern struct {
);
}
fn finalize(self: *Self) callconv(.C) void {
fn finalize(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.request) |v| {
glib.ext.destroy(v);
@@ -304,7 +304,7 @@ pub const ClipboardConfirmationDialog = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
gtk.Widget.Class.setTemplateFromResource(
class.as(gtk.Widget.Class),
if (comptime adw_version.atLeast(1, 4, 0))

View File

@@ -81,7 +81,7 @@ pub const CloseConfirmationDialog = extern struct {
});
}
fn init(self: *Self, _: *Class) callconv(.C) void {
fn init(self: *Self, _: *Class) callconv(.c) void {
gtk.Widget.initTemplate(self.as(gtk.Widget));
}
@@ -102,7 +102,7 @@ pub const CloseConfirmationDialog = extern struct {
fn response(
self: *Self,
response_id: [*:0]const u8,
) callconv(.C) void {
) callconv(.c) void {
if (std.mem.orderZ(u8, response_id, "close") == .eq) {
signals.@"close-request".impl.emit(
self,
@@ -120,7 +120,7 @@ pub const CloseConfirmationDialog = extern struct {
}
}
fn dispose(self: *Self) callconv(.C) void {
fn dispose(self: *Self) callconv(.c) void {
gtk.Widget.disposeTemplate(
self.as(gtk.Widget),
getGObjectType(),
@@ -143,7 +143,7 @@ pub const CloseConfirmationDialog = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
gobject.ext.ensureType(Dialog);
gtk.Widget.Class.setTemplateFromResource(
class.as(gtk.Widget.Class),

View File

@@ -139,7 +139,7 @@ pub const Config = extern struct {
return text_buf;
}
fn finalize(self: *Self) callconv(.C) void {
fn finalize(self: *Self) callconv(.c) void {
self.private().config.deinit();
gobject.Object.virtual_methods.finalize.call(
@@ -159,7 +159,7 @@ pub const Config = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
gobject.Object.virtual_methods.finalize.implement(class, &finalize);
gobject.ext.registerProperties(class, &.{
properties.@"diagnostics-buffer",

View File

@@ -67,7 +67,7 @@ pub const ConfigErrorsDialog = extern struct {
});
}
fn init(self: *Self, _: *Class) callconv(.C) void {
fn init(self: *Self, _: *Class) callconv(.c) void {
gtk.Widget.initTemplate(self.as(gtk.Widget));
}
@@ -82,7 +82,7 @@ pub const ConfigErrorsDialog = extern struct {
fn response(
self: *Self,
response_id: [*:0]const u8,
) callconv(.C) void {
) callconv(.c) void {
if (std.mem.orderZ(u8, response_id, "reload") != .eq) return;
signals.@"reload-config".impl.emit(
self,
@@ -92,7 +92,7 @@ pub const ConfigErrorsDialog = extern struct {
);
}
fn dispose(self: *Self) callconv(.C) void {
fn dispose(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.config) |v| {
v.unref();
@@ -134,7 +134,7 @@ pub const ConfigErrorsDialog = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
gobject.ext.ensureType(Dialog);
gtk.Widget.Class.setTemplateFromResource(
class.as(gtk.Widget.Class),

View File

@@ -82,7 +82,7 @@ pub const Dialog = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
_ = class;
}

View File

@@ -103,7 +103,7 @@ pub const GlobalShortcuts = extern struct {
};
};
fn init(self: *Self, _: *Class) callconv(.C) void {
fn init(self: *Self, _: *Class) callconv(.c) void {
_ = gobject.Object.signals.notify.connect(
self,
*Self,
@@ -570,7 +570,7 @@ pub const GlobalShortcuts = extern struct {
//---------------------------------------------------------------
// Virtual methods
fn dispose(self: *Self) callconv(.C) void {
fn dispose(self: *Self) callconv(.c) void {
// Since we drop references here we may lose access to things like
// dbus connections, so we need to close all our connections right
// away instead of in finalize.
@@ -603,7 +603,7 @@ pub const GlobalShortcuts = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
// Properties
gobject.ext.registerProperties(class, &.{
properties.config.impl,

View File

@@ -147,7 +147,7 @@ pub const ResizeOverlay = extern struct {
pub var offset: c_int = 0;
};
fn init(self: *Self, _: *Class) callconv(.C) void {
fn init(self: *Self, _: *Class) callconv(.c) void {
gtk.Widget.initTemplate(self.as(gtk.Widget));
const priv = self.private();
@@ -228,7 +228,7 @@ pub const ResizeOverlay = extern struct {
//---------------------------------------------------------------
// Virtual methods
fn dispose(self: *Self) callconv(.C) void {
fn dispose(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.idler) |v| {
if (glib.Source.remove(v) == 0) {
@@ -271,7 +271,7 @@ pub const ResizeOverlay = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
gtk.Widget.Class.setTemplateFromResource(
class.as(gtk.Widget.Class),
comptime gresource.blueprint(.{

View File

@@ -1158,7 +1158,7 @@ pub const Surface = extern struct {
//---------------------------------------------------------------
// Virtual Methods
fn init(self: *Self, _: *Class) callconv(.C) void {
fn init(self: *Self, _: *Class) callconv(.c) void {
gtk.Widget.initTemplate(self.as(gtk.Widget));
const priv = self.private();
@@ -1207,7 +1207,7 @@ pub const Surface = extern struct {
self.propConfig(undefined, null);
}
fn dispose(self: *Self) callconv(.C) void {
fn dispose(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.config) |v| {
v.unref();
@@ -1231,7 +1231,7 @@ pub const Surface = extern struct {
);
}
fn finalize(self: *Self) callconv(.C) void {
fn finalize(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.core_surface) |v| {
// Remove ourselves from the list of known surfaces in the app.
@@ -2283,7 +2283,7 @@ pub const Surface = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
gobject.ext.ensureType(ResizeOverlay);
gobject.ext.ensureType(ChildExited);
gtk.Widget.Class.setTemplateFromResource(

View File

@@ -72,7 +72,7 @@ const SurfaceChildExitedBanner = extern struct {
pub var offset: c_int = 0;
};
fn init(self: *Self, _: *Class) callconv(.C) void {
fn init(self: *Self, _: *Class) callconv(.c) void {
gtk.Widget.initTemplate(self.as(gtk.Widget));
}
@@ -134,7 +134,7 @@ const SurfaceChildExitedBanner = extern struct {
//---------------------------------------------------------------
// Virtual methods
fn dispose(self: *Self) callconv(.C) void {
fn dispose(self: *Self) callconv(.c) void {
gtk.Widget.disposeTemplate(
self.as(gtk.Widget),
getGObjectType(),
@@ -146,7 +146,7 @@ const SurfaceChildExitedBanner = extern struct {
);
}
fn finalize(self: *Self) callconv(.C) void {
fn finalize(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.data) |v| {
glib.ext.destroy(v);
@@ -170,7 +170,7 @@ const SurfaceChildExitedBanner = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
gtk.Widget.Class.setTemplateFromResource(
class.as(gtk.Widget.Class),
comptime gresource.blueprint(.{
@@ -255,7 +255,7 @@ const SurfaceChildExitedNoop = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
_ = class;
signals.@"close-request".impl.register(.{});
}

View File

@@ -133,7 +133,7 @@ pub const Tab = extern struct {
priv.surface.setParent(parent);
}
fn init(self: *Self, _: *Class) callconv(.C) void {
fn init(self: *Self, _: *Class) callconv(.c) void {
gtk.Widget.initTemplate(self.as(gtk.Widget));
// If our configuration is null then we get the configuration
@@ -183,7 +183,7 @@ pub const Tab = extern struct {
//---------------------------------------------------------------
// Virtual methods
fn dispose(self: *Self) callconv(.C) void {
fn dispose(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.config) |v| {
v.unref();
@@ -202,7 +202,7 @@ pub const Tab = extern struct {
);
}
fn finalize(self: *Self) callconv(.C) void {
fn finalize(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.title) |v| {
glib.free(@constCast(@ptrCast(v)));
@@ -250,7 +250,7 @@ pub const Tab = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
gobject.ext.ensureType(Surface);
gtk.Widget.Class.setTemplateFromResource(
class.as(gtk.Widget.Class),

View File

@@ -260,7 +260,7 @@ pub const Window = extern struct {
});
}
fn init(self: *Self, _: *Class) callconv(.C) void {
fn init(self: *Self, _: *Class) callconv(.c) void {
gtk.Widget.initTemplate(self.as(gtk.Widget));
// If our configuration is null then we get the configuration
@@ -892,7 +892,7 @@ pub const Window = extern struct {
//---------------------------------------------------------------
// Virtual methods
fn dispose(self: *Self) callconv(.C) void {
fn dispose(self: *Self) callconv(.c) void {
const priv = self.private();
if (priv.config) |v| {
v.unref();
@@ -911,7 +911,7 @@ pub const Window = extern struct {
);
}
fn finalize(self: *Self) callconv(.C) void {
fn finalize(self: *Self) callconv(.c) void {
const priv = self.private();
priv.tab_bindings.unref();
priv.winproto.deinit(Application.default().allocator());
@@ -1562,7 +1562,7 @@ pub const Window = extern struct {
var parent: *Parent.Class = undefined;
pub const Instance = Self;
fn init(class: *Class) callconv(.C) void {
fn init(class: *Class) callconv(.c) void {
gobject.ext.ensureType(DebugWarning);
gtk.Widget.Class.setTemplateFromResource(
class.as(gtk.Widget.Class),

View File

@@ -184,14 +184,14 @@ fn handleResponse(self: *ClipboardConfirmation, response: [*:0]const u8) void {
self.destroy();
}
fn gtkChoose(dialog_: ?*gobject.Object, result: *gio.AsyncResult, ud: ?*anyopaque) callconv(.C) void {
fn gtkChoose(dialog_: ?*gobject.Object, result: *gio.AsyncResult, ud: ?*anyopaque) callconv(.c) void {
const dialog = gobject.ext.cast(DialogType, dialog_.?).?;
const self: *ClipboardConfirmation = @ptrCast(@alignCast(ud.?));
const response = dialog.chooseFinish(result);
self.handleResponse(response);
}
fn gtkResponse(_: *DialogType, response: [*:0]u8, self: *ClipboardConfirmation) callconv(.C) void {
fn gtkResponse(_: *DialogType, response: [*:0]u8, self: *ClipboardConfirmation) callconv(.c) void {
self.handleResponse(response);
}

View File

@@ -1121,7 +1121,7 @@ fn gtkActionToggleCommandPalette(
_: *gio.SimpleAction,
_: ?*glib.Variant,
self: *Window,
) callconv(.C) void {
) callconv(.c) void {
self.performBindingAction(.toggle_command_palette);
}