Commit 5d5f21bf authored by Max Kellermann's avatar Max Kellermann

Tag: compile-time initialisation of ignore_tag_items

Move to TagSettings.c and use C99 initializers.
parent fcccedc5
...@@ -426,7 +426,7 @@ libtag_a_SOURCES =\ ...@@ -426,7 +426,7 @@ libtag_a_SOURCES =\
src/tag/Tag.cxx src/tag/Tag.hxx \ src/tag/Tag.cxx src/tag/Tag.hxx \
src/tag/TagItem.hxx \ src/tag/TagItem.hxx \
src/tag/TagHandler.cxx src/tag/TagHandler.hxx \ src/tag/TagHandler.cxx src/tag/TagHandler.hxx \
src/tag/TagInternal.hxx \ src/tag/TagSettings.c src/tag/TagSettings.h \
src/tag/TagConfig.cxx src/tag/TagConfig.hxx \ src/tag/TagConfig.cxx src/tag/TagConfig.hxx \
src/tag/TagNames.c \ src/tag/TagNames.c \
src/tag/TagString.cxx src/tag/TagString.hxx \ src/tag/TagString.cxx src/tag/TagString.hxx \
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "Song.hxx" #include "Song.hxx"
#include "TextFile.hxx" #include "TextFile.hxx"
#include "tag/Tag.hxx" #include "tag/Tag.hxx"
#include "tag/TagInternal.hxx" #include "tag/TagSettings.h"
#include "fs/Path.hxx" #include "fs/Path.hxx"
#include "util/Error.hxx" #include "util/Error.hxx"
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include "Partition.hxx" #include "Partition.hxx"
#include "Volume.hxx" #include "Volume.hxx"
#include "OutputAll.hxx" #include "OutputAll.hxx"
#include "tag/Tag.hxx"
#include "tag/TagConfig.hxx" #include "tag/TagConfig.hxx"
#include "replay_gain_config.h" #include "replay_gain_config.h"
#include "Idle.hxx" #include "Idle.hxx"
...@@ -376,7 +375,6 @@ int mpd_main(int argc, char *argv[]) ...@@ -376,7 +375,6 @@ int mpd_main(int argc, char *argv[])
} }
stats_global_init(); stats_global_init();
tag_lib_init();
TagLoadConfig(); TagLoadConfig();
if (!log_init(options.verbose, options.log_stderr, error)) { if (!log_init(options.verbose, options.log_stderr, error)) {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "config.h" #include "config.h"
#include "TagPrint.hxx" #include "TagPrint.hxx"
#include "tag/Tag.hxx" #include "tag/Tag.hxx"
#include "tag/TagInternal.hxx" #include "tag/TagSettings.h"
#include "Song.hxx" #include "Song.hxx"
#include "Client.hxx" #include "Client.hxx"
......
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
#include "config.h" #include "config.h"
#include "Tag.hxx" #include "Tag.hxx"
#include "TagInternal.hxx"
#include "TagPool.hxx" #include "TagPool.hxx"
#include "TagString.hxx" #include "TagString.hxx"
#include "TagSettings.h"
#include <glib.h> #include <glib.h>
#include <assert.h> #include <assert.h>
...@@ -40,8 +40,6 @@ static struct { ...@@ -40,8 +40,6 @@ static struct {
TagItem *items[BULK_MAX]; TagItem *items[BULK_MAX];
} bulk; } bulk;
bool ignore_tag_items[TAG_NUM_OF_ITEM_TYPES];
enum tag_type enum tag_type
tag_name_parse(const char *name) tag_name_parse(const char *name)
{ {
...@@ -78,12 +76,6 @@ items_size(const Tag &tag) ...@@ -78,12 +76,6 @@ items_size(const Tag &tag)
return tag.num_items * sizeof(TagItem *); return tag.num_items * sizeof(TagItem *);
} }
void tag_lib_init(void)
{
/* ignore comments by default */
ignore_tag_items[TAG_COMMENT] = true;
}
void void
Tag::Clear() Tag::Clear()
{ {
......
...@@ -186,10 +186,4 @@ tag_name_parse(const char *name); ...@@ -186,10 +186,4 @@ tag_name_parse(const char *name);
enum tag_type enum tag_type
tag_name_parse_i(const char *name); tag_name_parse_i(const char *name);
/**
* Initializes the tag library.
*/
void
tag_lib_init();
#endif #endif
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "config.h" #include "config.h"
#include "TagConfig.hxx" #include "TagConfig.hxx"
#include "TagInternal.hxx" #include "TagSettings.h"
#include "Tag.hxx" #include "Tag.hxx"
#include "ConfigGlobal.hxx" #include "ConfigGlobal.hxx"
#include "ConfigOption.hxx" #include "ConfigOption.hxx"
......
/*
* Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "TagSettings.h"
bool ignore_tag_items[TAG_NUM_OF_ITEM_TYPES] = {
/* ignore comments by default */
[TAG_COMMENT] = true,
};
...@@ -17,11 +17,13 @@ ...@@ -17,11 +17,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef MPD_TAG_INTERNAL_HXX #ifndef MPD_TAG_SETTINGS_H
#define MPD_TAG_INTERNAL_HXX #define MPD_TAG_SETTINGS_H
#include "TagType.h" #include "TagType.h"
#include <stdbool.h>
extern bool ignore_tag_items[TAG_NUM_OF_ITEM_TYPES]; extern bool ignore_tag_items[TAG_NUM_OF_ITEM_TYPES];
#endif #endif
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "PlaylistVector.hxx" #include "PlaylistVector.hxx"
#include "ConfigGlobal.hxx" #include "ConfigGlobal.hxx"
#include "ConfigData.hxx" #include "ConfigData.hxx"
#include "tag/Tag.hxx"
#include "tag/TagConfig.hxx" #include "tag/TagConfig.hxx"
#include "fs/Path.hxx" #include "fs/Path.hxx"
#include "util/Error.hxx" #include "util/Error.hxx"
...@@ -105,7 +104,6 @@ main(int argc, char **argv) ...@@ -105,7 +104,6 @@ main(int argc, char **argv)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
tag_lib_init();
TagLoadConfig(); TagLoadConfig();
/* do it */ /* do it */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment