Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
80571d1b
Commit
80571d1b
authored
Mar 01, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag: convert ignore_tag_items to a bool array
parent
6153c86b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
tag.c
src/tag.c
+5
-5
tag_internal.h
src/tag_internal.h
+2
-2
tag_print.c
src/tag_print.c
+1
-1
No files found.
src/tag.c
View file @
80571d1b
...
@@ -62,7 +62,7 @@ const char *tag_item_names[TAG_NUM_OF_ITEM_TYPES] = {
...
@@ -62,7 +62,7 @@ const char *tag_item_names[TAG_NUM_OF_ITEM_TYPES] = {
[
TAG_MUSICBRAINZ_TRACKID
]
=
"MUSICBRAINZ_TRACKID"
,
[
TAG_MUSICBRAINZ_TRACKID
]
=
"MUSICBRAINZ_TRACKID"
,
};
};
int8_t
ignore_tag_items
[
TAG_NUM_OF_ITEM_TYPES
];
bool
ignore_tag_items
[
TAG_NUM_OF_ITEM_TYPES
];
static
size_t
items_size
(
const
struct
tag
*
tag
)
static
size_t
items_size
(
const
struct
tag
*
tag
)
{
{
...
@@ -80,14 +80,14 @@ void tag_lib_init(void)
...
@@ -80,14 +80,14 @@ void tag_lib_init(void)
/* parse the "metadata_to_use" config parameter below */
/* parse the "metadata_to_use" config parameter below */
memset
(
ignore_tag_items
,
0
,
TAG_NUM_OF_ITEM_TYPES
);
/* ignore comments by default */
ignore_tag_items
[
TAG_ITEM_COMMENT
]
=
1
;
/* ignore comments by default */
ignore_tag_items
[
TAG_ITEM_COMMENT
]
=
true
;
value
=
config_get_string
(
CONF_METADATA_TO_USE
,
NULL
);
value
=
config_get_string
(
CONF_METADATA_TO_USE
,
NULL
);
if
(
value
==
NULL
)
if
(
value
==
NULL
)
return
;
return
;
memset
(
ignore_tag_items
,
1
,
TAG_NUM_OF_ITEM_TYPES
);
memset
(
ignore_tag_items
,
true
,
TAG_NUM_OF_ITEM_TYPES
);
if
(
0
==
strcasecmp
(
value
,
"none"
))
if
(
0
==
strcasecmp
(
value
,
"none"
))
return
;
return
;
...
@@ -100,7 +100,7 @@ void tag_lib_init(void)
...
@@ -100,7 +100,7 @@ void tag_lib_init(void)
*
s
=
'\0'
;
*
s
=
'\0'
;
for
(
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
i
++
)
{
for
(
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
i
++
)
{
if
(
strcasecmp
(
c
,
tag_item_names
[
i
])
==
0
)
{
if
(
strcasecmp
(
c
,
tag_item_names
[
i
])
==
0
)
{
ignore_tag_items
[
i
]
=
0
;
ignore_tag_items
[
i
]
=
false
;
break
;
break
;
}
}
}
}
...
...
src/tag_internal.h
View file @
80571d1b
...
@@ -19,8 +19,8 @@
...
@@ -19,8 +19,8 @@
#ifndef MPD_TAG_INTERNAL_H
#ifndef MPD_TAG_INTERNAL_H
#define MPD_TAG_INTERNAL_H
#define MPD_TAG_INTERNAL_H
#include <std
int
.h>
#include <std
bool
.h>
extern
int8_t
ignore_tag_items
[
TAG_NUM_OF_ITEM_TYPES
];
extern
bool
ignore_tag_items
[
TAG_NUM_OF_ITEM_TYPES
];
#endif
#endif
src/tag_print.c
View file @
80571d1b
...
@@ -27,7 +27,7 @@ void tag_print_types(struct client *client)
...
@@ -27,7 +27,7 @@ void tag_print_types(struct client *client)
int
i
;
int
i
;
for
(
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
i
++
)
{
for
(
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
i
++
)
{
if
(
ignore_tag_items
[
i
]
==
0
)
if
(
!
ignore_tag_items
[
i
]
)
client_printf
(
client
,
"tagtype: %s
\n
"
,
client_printf
(
client
,
"tagtype: %s
\n
"
,
tag_item_names
[
i
]);
tag_item_names
[
i
]);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment