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
860e9eb8
Commit
860e9eb8
authored
Aug 08, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
locate: make "tag" unsigned
parent
3d2092ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
locate.c
src/locate.c
+4
-8
locate.h
src/locate.h
+4
-1
No files found.
src/locate.c
View file @
860e9eb8
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
/* struct used for search, find, list queries */
/* struct used for search, find, list queries */
struct
locate_item
{
struct
locate_item
{
int8_t
tag
;
u
int8_t
tag
;
/* what we are looking for */
/* what we are looking for */
char
*
needle
;
char
*
needle
;
};
};
...
@@ -49,7 +49,7 @@ struct locate_item_list {
...
@@ -49,7 +49,7 @@ struct locate_item_list {
struct
locate_item
items
[
1
];
struct
locate_item
items
[
1
];
};
};
int
unsigned
locate_parse_type
(
const
char
*
str
)
locate_parse_type
(
const
char
*
str
)
{
{
if
(
0
==
g_ascii_strcasecmp
(
str
,
LOCATE_TAG_FILE_KEY
)
||
if
(
0
==
g_ascii_strcasecmp
(
str
,
LOCATE_TAG_FILE_KEY
)
||
...
@@ -59,11 +59,7 @@ locate_parse_type(const char *str)
...
@@ -59,11 +59,7 @@ locate_parse_type(const char *str)
if
(
0
==
g_ascii_strcasecmp
(
str
,
LOCATE_TAG_ANY_KEY
))
if
(
0
==
g_ascii_strcasecmp
(
str
,
LOCATE_TAG_ANY_KEY
))
return
LOCATE_TAG_ANY_TYPE
;
return
LOCATE_TAG_ANY_TYPE
;
enum
tag_type
i
=
tag_name_parse_i
(
str
);
return
tag_name_parse_i
(
str
);
if
(
i
!=
TAG_NUM_OF_ITEM_TYPES
)
return
i
;
return
-
1
;
}
}
static
bool
static
bool
...
@@ -73,7 +69,7 @@ locate_item_init(struct locate_item *item,
...
@@ -73,7 +69,7 @@ locate_item_init(struct locate_item *item,
{
{
item
->
tag
=
locate_parse_type
(
type_string
);
item
->
tag
=
locate_parse_type
(
type_string
);
if
(
item
->
tag
<
0
)
if
(
item
->
tag
==
TAG_NUM_OF_ITEM_TYPES
)
return
false
;
return
false
;
item
->
needle
=
fold_case
item
->
needle
=
fold_case
...
...
src/locate.h
View file @
860e9eb8
...
@@ -31,8 +31,11 @@
...
@@ -31,8 +31,11 @@
struct
locate_item_list
;
struct
locate_item_list
;
struct
song
;
struct
song
;
/**
* @return #TAG_NUM_OF_ITEM_TYPES on error
*/
gcc_pure
gcc_pure
int
unsigned
locate_parse_type
(
const
char
*
str
);
locate_parse_type
(
const
char
*
str
);
gcc_malloc
gcc_malloc
...
...
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