Hello Thanks for that catch Amos, appreciate it. That comma at the beginning messed up with my regex :)
Here is the updated patch. let me know! Thanks Milos On Wed, Apr 15, 2026 at 8:42 PM Milos Nikic <[email protected]> wrote: > Hello, > > Ok here are all that i was able to find across the whole code base of Hurd > (not all that many actually!) > > Let me know please. > > Thanks, > Milos > > On Wed, Apr 15, 2026 at 6:16 PM Samuel Thibault <[email protected]> > wrote: > >> Milos Nikic, le mer. 15 avril 2026 18:13:15 -0700, a ecrit: >> > I meant other submodules in separate PRs >> > >> > Tell me what you think? >> >> You can go over the whole source code, it's really all of the same, >> there is no real reason to separate the commits. >> >> Samuel >> >
From 5b147901bbf02b1d3bf8e0bd360ba27529ba40b0 Mon Sep 17 00:00:00 2001 From: Milos Nikic <[email protected]> Date: Wed, 15 Apr 2026 17:25:10 -0700 Subject: [PATCH] Hurd: Use designated initializers across the codebase --- console-client/bdf.c | 4 ++-- console-client/pc-kbd.c | 18 +++++++++--------- exec/elfcore.c | 14 +++++++------- libdiskfs/disk-pager.c | 4 ++-- libnetfs/dir-lookup.c | 6 +++--- libnetfs/fsys-getroot.c | 4 ++-- libstore/nbd.c | 4 ++-- sutils/bless.c | 8 ++++---- utils/mount.c | 20 ++++++++++---------- utils/umount.c | 26 +++++++++++++------------- utils/vmallocate.c | 8 ++++---- 11 files changed, 58 insertions(+), 58 deletions(-) diff --git a/console-client/bdf.c b/console-client/bdf.c index 8b68368b..599849c8 100644 --- a/console-client/bdf.c +++ b/console-client/bdf.c @@ -216,8 +216,8 @@ bdf_read (FILE *filep, bdf_font_t *font, int *linecount) unsigned int glyph_bheight; /* How many bitmap lines have been parsed already. */ unsigned int glyph_blines; - } parser = { location: START, properties: 0, glyphs: 0, - has_size: 0, has_fbbx: 0 }; + } parser = { .location = START, .properties = 0, .glyphs = 0, + .has_size = 0, .has_fbbx = 0 }; bdf = calloc (1, sizeof *bdf); if (!bdf) diff --git a/console-client/pc-kbd.c b/console-client/pc-kbd.c index a637205f..75ac4761 100644 --- a/console-client/pc-kbd.c +++ b/console-client/pc-kbd.c @@ -1280,16 +1280,16 @@ pc_kbd_init (void **handle, int no_exit, int argc, char *argv[], int *next) error_t err; struct arguments arguments = { - pos: 1 + .pos = 1 #ifdef XKB_SUPPORT - , model: 0 - , layout: 0 - , variant: 0 - , options: 0 - , composefile: 0 - , ctrlaltbs: 1 - , repeat_delay: -1 - , repeat_interval: -1 + , .model = 0 + , .layout = 0 + , .variant = 0 + , .options = 0 + , .composefile = 0 + , .ctrlaltbs = 1 + , .repeat_delay = -1 + , .repeat_interval = -1 #endif }; diff --git a/exec/elfcore.c b/exec/elfcore.c index a2360965..4b2afdf1 100644 --- a/exec/elfcore.c +++ b/exec/elfcore.c @@ -245,7 +245,7 @@ dump_core (task_t task, file_t file, off_t corelimit, ElfW(Phdr) *phdrs, *ph; ElfW(Ehdr) hdr = /* ELF header for the core file. */ { - e_ident: + .e_ident = { [EI_MAG0] = ELFMAG0, [EI_MAG1] = ELFMAG1, @@ -257,12 +257,12 @@ dump_core (task_t task, file_t file, off_t corelimit, [EI_OSABI] = ELFOSABI_SYSV, [EI_ABIVERSION] = 0 }, - e_type: ET_CORE, - e_version: EV_CURRENT, - e_machine: ELF_MACHINE, - e_ehsize: sizeof hdr, - e_phentsize: sizeof phdrs[0], - e_phoff: sizeof hdr, /* Fill in e_phnum later. */ + .e_type = ET_CORE, + .e_version = EV_CURRENT, + .e_machine = ELF_MACHINE, + .e_ehsize = sizeof hdr, + .e_phentsize = sizeof phdrs[0], + .e_phoff = sizeof hdr, /* Fill in e_phnum later. */ }; off_t offset; size_t wrote; diff --git a/libdiskfs/disk-pager.c b/libdiskfs/disk-pager.c index f392fc42..6eaa3c62 100644 --- a/libdiskfs/disk-pager.c +++ b/libdiskfs/disk-pager.c @@ -35,8 +35,8 @@ struct pager_requests *diskfs_disk_pager_requests; static void fault_handler (int sig, long int sigcode, struct sigcontext *scp); static struct hurd_signal_preemptor preemptor = { - preemptor: NULL, - handler: (sighandler_t) &fault_handler, + .preemptor = NULL, + .handler = (sighandler_t) &fault_handler, }; void diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c index 4ca40f49..9d86f73b 100644 --- a/libnetfs/dir-lookup.c +++ b/libnetfs/dir-lookup.c @@ -451,9 +451,9 @@ netfs_S_dir_lookup (struct protid *dircred, mach_port_t rendezvous = MACH_PORT_NULL; struct flock64 lock = { - l_start: 0, - l_len: 0, - l_whence: SEEK_SET + .l_start = 0, + .l_len = 0, + .l_whence = SEEK_SET }; if (flags & O_EXLOCK) diff --git a/libnetfs/fsys-getroot.c b/libnetfs/fsys-getroot.c index a29caaa5..fb9fef12 100644 --- a/libnetfs/fsys-getroot.c +++ b/libnetfs/fsys-getroot.c @@ -44,8 +44,8 @@ netfs_S_fsys_getroot (struct netfs_control *pt, mode_t type; struct peropen peropen_context = { - root_parent: dotdot, - path: NULL, + .root_parent = dotdot, + .path = NULL, }; if (!pt) diff --git a/libstore/nbd.c b/libstore/nbd.c index 1d95d670..556222e1 100644 --- a/libstore/nbd.c +++ b/libstore/nbd.c @@ -116,8 +116,8 @@ nbd_write (struct store *store, { struct nbd_request req = { - magic: NBD_REQUEST_MAGIC, - type: htonl (1), /* WRITE */ + .magic = NBD_REQUEST_MAGIC, + .type = htonl (1), /* WRITE */ }; error_t err; vm_size_t cc; diff --git a/sutils/bless.c b/sutils/bless.c index cefdf7a8..164b1508 100644 --- a/sutils/bless.c +++ b/sutils/bless.c @@ -67,10 +67,10 @@ parse_opt (int key, char *arg, struct argp_state *state) const struct argp argp = { - options: options, - parser: parse_opt, - args_doc: args_doc, - doc: doc, + .options = options, + .parser = parse_opt, + .args_doc = args_doc, + .doc = doc, }; int diff --git a/utils/mount.c b/utils/mount.c index 283443f5..52e1000d 100644 --- a/utils/mount.c +++ b/utils/mount.c @@ -665,11 +665,11 @@ main (int argc, char **argv) { struct mntent m = { - mnt_fsname: device, - mnt_dir: mountpoint, - mnt_type: fstype, - mnt_opts: 0, - mnt_freq: 0, mnt_passno: 0 + .mnt_fsname = device, + .mnt_dir = mountpoint, + .mnt_type = fstype, + .mnt_opts = 0, + .mnt_freq = 0, .mnt_passno = 0 }; if (firmlink) m.mnt_type = strdup ("firmlink"); @@ -682,13 +682,13 @@ main (int argc, char **argv) { struct mntent m = { - mnt_fsname: mountpoint, /* since we cannot know the device, + .mnt_fsname = mountpoint, /* since we cannot know the device, using mountpoint here leads to more helpful error messages */ - mnt_dir: mountpoint, - mnt_type: fstype, - mnt_opts: 0, - mnt_freq: 0, mnt_passno: 0 + .mnt_dir = mountpoint, + .mnt_type = fstype, + .mnt_opts = 0, + .mnt_freq = 0, .mnt_passno = 0 }; if (firmlink) m.mnt_type = strdup ("firmlink"); diff --git a/utils/umount.c b/utils/umount.c index 7a8e889a..9f2c99bd 100644 --- a/utils/umount.c +++ b/utils/umount.c @@ -147,11 +147,11 @@ static const struct argp_child argp_kids[] = }; static struct argp argp = { - options: argp_opts, - parser: parse_opt, - args_doc: args_doc, - doc: doc, - children: argp_kids, + .options = argp_opts, + .parser = parse_opt, + .args_doc = args_doc, + .doc = doc, + .children = argp_kids, }; /* This is a trimmed and slightly modified version of @@ -177,8 +177,8 @@ fstab_argp_mtab_parse_opt (int key, char *arg, struct argp_state *state) static struct argp fstab_argp_mtab = { - options: fstab_argp_mtab_opts, - parser: fstab_argp_mtab_parse_opt, + .options = fstab_argp_mtab_opts, + .parser = fstab_argp_mtab_parse_opt, }; /* Unmount one filesystem. */ @@ -293,12 +293,12 @@ main (int argc, char **argv) /* As last resort, just assume it is the mountpoint. */ struct mntent m = { - mnt_fsname: "", - mnt_dir: t, - mnt_type: "", - mnt_opts: 0, - mnt_freq: 0, - mnt_passno: 0, + .mnt_fsname = "", + .mnt_dir = t, + .mnt_type = "", + .mnt_opts = 0, + .mnt_freq = 0, + .mnt_passno = 0, }; err = fstab_add_mntent (fstab, &m, &fs); diff --git a/utils/vmallocate.c b/utils/vmallocate.c index fde8e768..196c1085 100644 --- a/utils/vmallocate.c +++ b/utils/vmallocate.c @@ -136,10 +136,10 @@ parse_opt (int key, char *arg, struct argp_state *state) const struct argp argp = { - options: options, - parser: parse_opt, - args_doc: args_doc, - doc: doc, + .options = options, + .parser = parse_opt, + .args_doc = args_doc, + .doc = doc, }; -- 2.53.0
