From: Eric Biggers Date: Tue, 29 Apr 2014 04:17:28 +0000 (-0500) Subject: Replace unnamed union initializers X-Git-Tag: v1.7.0~238 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=450232de9682a6d291a2f2d11f8125836ac8326a Replace unnamed union initializers --- diff --git a/programs/imagex.c b/programs/imagex.c index 43ca5d2e..644a2bab 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -3870,16 +3870,14 @@ imagex_update(int argc, tchar **argv, int cmd) /* --wimboot-config=FILE is short for an * "add FILE /Windows/System32/WimBootCompress.ini" command. */ - struct wimlib_update_command cmd = { - .op = WIMLIB_UPDATE_OP_ADD, - .add = { - .fs_source_path = wimboot_config, - .wim_target_path = - T("/Windows/System32/WimBootCompress.ini"), - .config_file = NULL, - .add_flags = 0, - }, - }; + struct wimlib_update_command cmd; + + cmd.op = WIMLIB_UPDATE_OP_ADD; + cmd.add.fs_source_path = wimboot_config; + cmd.add.wim_target_path = T("/Windows/System32/WimBootCompress.ini"); + cmd.add.config_file = NULL; + cmd.add.add_flags = 0; + ret = wimlib_update_image(wim, image, &cmd, 1, update_flags, imagex_progress_func); if (ret) diff --git a/src/update_image.c b/src/update_image.c index 06a6ad30..5dc32fc4 100644 --- a/src/update_image.c +++ b/src/update_image.c @@ -328,15 +328,13 @@ static int journaled_link(struct update_command_journal *j, struct wim_dentry *subject, struct wim_dentry *parent) { - struct update_primitive prim = { - .type = LINK_DENTRY, - .link = { - .subject = subject, - .parent = parent, - }, - }; + struct update_primitive prim; int ret; + prim.type = LINK_DENTRY; + prim.link.subject = subject; + prim.link.parent = parent; + ret = record_update_primitive(j, prim); if (ret) return ret; @@ -356,21 +354,18 @@ journaled_link(struct update_command_journal *j, static int journaled_unlink(struct update_command_journal *j, struct wim_dentry *subject) { - int ret; struct wim_dentry *parent; + struct update_primitive prim; + int ret; if (dentry_is_root(subject)) parent = NULL; else parent = subject->parent; - struct update_primitive prim = { - .type = UNLINK_DENTRY, - .link = { - .subject = subject, - .parent = parent, - }, - }; + prim.type = UNLINK_DENTRY; + prim.link.subject = subject; + prim.link.parent = parent; ret = record_update_primitive(j, prim); if (ret)