summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2009-10-12 21:21:03 +0200
committerGuillem Jover <guillem@debian.org>2009-10-14 02:30:05 +0200
commit69e3c912bbec30399d23477817821c38d01c1415 (patch)
treedfa2d6160c42a2f32fcf98f132c19af4f3ae267a
parent5da3e92afcb6109feed5e9dac155eb3ca75010eb (diff)
downloaddpkg-69e3c912bbec30399d23477817821c38d01c1415.tar.gz
Use named intializers in structures
-rw-r--r--lib/dpkg/triglib.c18
-rw-r--r--src/processarc.c8
-rw-r--r--src/trigcmd.c6
-rw-r--r--src/trigproc.c10
4 files changed, 23 insertions, 19 deletions
diff --git a/lib/dpkg/triglib.c b/lib/dpkg/triglib.c
index 7288dd68c..7e2d9165f 100644
--- a/lib/dpkg/triglib.c
+++ b/lib/dpkg/triglib.c
@@ -228,10 +228,10 @@ struct trigkindinfo {
#define TKI_DEFINE(kindname) \
static const struct trigkindinfo tki_##kindname= { \
- trk_##kindname##_activate_start, \
- trk_##kindname##_activate_awaiter, \
- trk_##kindname##_activate_done, \
- trk_##kindname##_interest_change \
+ .activate_start = trk_##kindname##_activate_start, \
+ .activate_awaiter = trk_##kindname##_activate_awaiter, \
+ .activate_done = trk_##kindname##_activate_done, \
+ .interest_change = trk_##kindname##_interest_change, \
};
static const struct trigkindinfo *dtki;
@@ -796,10 +796,10 @@ th_simple_nn_find(const char *name, int nonew)
TRIGHOOKS_DEFINE_NAMENODE_ACCESSORS
struct trig_hooks trigh = {
- NULL,
- NULL,
- th_simple_nn_find,
- th_nn_interested,
- th_nn_name
+ .enqueue_deferred = NULL,
+ .transitional_activate = NULL,
+ .namenode_find = th_simple_nn_find,
+ .namenode_interested = th_nn_interested,
+ .namenode_name = th_nn_name,
};
diff --git a/src/processarc.c b/src/processarc.c
index 4d2f7fe71..2d6f320c0 100644
--- a/src/processarc.c
+++ b/src/processarc.c
@@ -51,8 +51,12 @@
void process_archive(const char *filename) {
static const struct TarFunctions tf = {
- tarfileread,
- tarobject, tarobject, tarobject, tarobject, tarobject
+ .Read = tarfileread,
+ .ExtractFile = tarobject,
+ .MakeDirectory = tarobject,
+ .MakeHardLink = tarobject,
+ .MakeSymbolicLink = tarobject,
+ .MakeSpecialFile = tarobject,
};
/* These need to be static so that we can pass their addresses to
diff --git a/src/trigcmd.c b/src/trigcmd.c
index 5225d941e..bf80f48af 100644
--- a/src/trigcmd.c
+++ b/src/trigcmd.c
@@ -140,9 +140,9 @@ tdm_add_trig_end(void)
}
static const struct trigdefmeths tdm_add = {
- tdm_add_trig_begin,
- tdm_add_package,
- tdm_add_trig_end
+ .trig_begin = tdm_add_trig_begin,
+ .package = tdm_add_package,
+ .trig_end = tdm_add_trig_end,
};
static void
diff --git a/src/trigproc.c b/src/trigproc.c
index 3b6bdfb4e..597d2da7e 100644
--- a/src/trigproc.c
+++ b/src/trigproc.c
@@ -388,11 +388,11 @@ th_proper_nn_find(const char *name, int nonew)
TRIGHOOKS_DEFINE_NAMENODE_ACCESSORS
static const struct trig_hooks trig_our_hooks = {
- trigproc_enqueue_deferred,
- trig_transitional_activate,
- th_proper_nn_find,
- th_nn_interested,
- th_nn_name
+ .enqueue_deferred = trigproc_enqueue_deferred,
+ .transitional_activate = trig_transitional_activate,
+ .namenode_find = th_proper_nn_find,
+ .namenode_interested = th_nn_interested,
+ .namenode_name = th_nn_name,
};
void