aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-06-22 23:25:52 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2017-06-23 00:20:08 +0200
commitf71eee66bd31a4b2775c102406dcd2e14d542960 (patch)
tree31f5b57df8ff225f603725e7b9d300ceb308f22f
parent3ff7867e309e7b4b7435f1ca2b9f73ec7cbd2cfc (diff)
downloadnncmpp-f71eee66bd31a4b2775c102406dcd2e14d542960.tar.gz
nncmpp-f71eee66bd31a4b2775c102406dcd2e14d542960.tar.xz
nncmpp-f71eee66bd31a4b2775c102406dcd2e14d542960.zip
Rename item_list_{init,make}()
-rw-r--r--nncmpp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/nncmpp.c b/nncmpp.c
index d92fea9..4a16b08 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -459,11 +459,12 @@ struct item_list
size_t alloc; ///< Allocated items
};
-static void
-item_list_init (struct item_list *self)
+static struct item_list
+item_list_make (void)
{
- memset (self, 0, sizeof *self);
- self->items = xcalloc (sizeof *self->items, (self->alloc = 16));
+ struct item_list self = {};
+ self.items = xcalloc (sizeof *self.items, (self.alloc = 16));
+ return self;
}
static void
@@ -819,7 +820,7 @@ app_init_context (void)
g.client = mpd_client_make (&g.poller);
g.config = config_make ();
g.streams = strv_make ();
- item_list_init (&g.playlist);
+ g.playlist = item_list_make ();
g.playback_info = str_map_make (free);
g.playback_info.key_xfrm = tolower_ascii_strxfrm;