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
04c02a1e
Commit
04c02a1e
authored
Sep 22, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
locate: cast enum tag_type to int before comparing with integer
Avoids clang pickiness. This code is not correct, but we'll fix that another day.
parent
41487426
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
locate.c
src/locate.c
+4
-4
No files found.
src/locate.c
View file @
04c02a1e
...
...
@@ -127,7 +127,7 @@ locate_tag_search(const struct song *song, enum tag_type type, const char *str)
{
bool
ret
=
false
;
if
(
type
==
LOCATE_TAG_FILE_TYPE
||
type
==
LOCATE_TAG_ANY_TYPE
)
{
if
(
type
==
LOCATE_TAG_FILE_TYPE
||
(
int
)
type
==
LOCATE_TAG_ANY_TYPE
)
{
char
*
uri
=
song_get_uri
(
song
);
char
*
p
=
g_utf8_casefold
(
uri
,
-
1
);
g_free
(
uri
);
...
...
@@ -147,7 +147,7 @@ locate_tag_search(const struct song *song, enum tag_type type, const char *str)
for
(
unsigned
i
=
0
;
i
<
song
->
tag
->
num_items
&&
!
ret
;
i
++
)
{
visited_types
[
song
->
tag
->
items
[
i
]
->
type
]
=
true
;
if
(
type
!=
LOCATE_TAG_ANY_TYPE
&&
if
(
(
int
)
type
!=
LOCATE_TAG_ANY_TYPE
&&
song
->
tag
->
items
[
i
]
->
type
!=
type
)
{
continue
;
}
...
...
@@ -185,7 +185,7 @@ locate_song_search(const struct song *song,
static
bool
locate_tag_match
(
const
struct
song
*
song
,
enum
tag_type
type
,
const
char
*
str
)
{
if
(
type
==
LOCATE_TAG_FILE_TYPE
||
type
==
LOCATE_TAG_ANY_TYPE
)
{
if
(
type
==
LOCATE_TAG_FILE_TYPE
||
(
int
)
type
==
LOCATE_TAG_ANY_TYPE
)
{
char
*
uri
=
song_get_uri
(
song
);
bool
matches
=
strcmp
(
str
,
uri
)
==
0
;
g_free
(
uri
);
...
...
@@ -205,7 +205,7 @@ locate_tag_match(const struct song *song, enum tag_type type, const char *str)
for
(
unsigned
i
=
0
;
i
<
song
->
tag
->
num_items
;
i
++
)
{
visited_types
[
song
->
tag
->
items
[
i
]
->
type
]
=
true
;
if
(
type
!=
LOCATE_TAG_ANY_TYPE
&&
if
(
(
int
)
type
!=
LOCATE_TAG_ANY_TYPE
&&
song
->
tag
->
items
[
i
]
->
type
!=
type
)
{
continue
;
}
...
...
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