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
5b07cbf0
Commit
5b07cbf0
authored
Feb 27, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag: make tag_equal() return bool
parent
bcdf947a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
tag.c
src/tag.c
+12
-12
tag.h
src/tag.h
+1
-1
No files found.
src/tag.c
View file @
5b07cbf0
...
...
@@ -36,7 +36,7 @@
static
struct
{
#ifndef NDEBUG
int
busy
;
bool
busy
;
#endif
struct
tag_item
*
items
[
BULK_MAX
];
}
bulk
;
...
...
@@ -293,7 +293,7 @@ void tag_free(struct tag *tag)
if
(
tag
->
items
==
bulk
.
items
)
{
#ifndef NDEBUG
assert
(
bulk
.
busy
);
bulk
.
busy
=
0
;
bulk
.
busy
=
false
;
#endif
}
else
g_free
(
tag
->
items
);
...
...
@@ -386,30 +386,30 @@ bool tag_has_type(const struct tag *tag, enum tag_type type)
return
tag_get_value
(
tag
,
type
)
!=
NULL
;
}
int
tag_equal
(
const
struct
tag
*
tag1
,
const
struct
tag
*
tag2
)
bool
tag_equal
(
const
struct
tag
*
tag1
,
const
struct
tag
*
tag2
)
{
int
i
;
if
(
tag1
==
NULL
&&
tag2
==
NULL
)
return
1
;
return
true
;
else
if
(
!
tag1
||
!
tag2
)
return
0
;
return
false
;
if
(
tag1
->
time
!=
tag2
->
time
)
return
0
;
return
false
;
if
(
tag1
->
numOfItems
!=
tag2
->
numOfItems
)
return
0
;
return
false
;
for
(
i
=
0
;
i
<
tag1
->
numOfItems
;
i
++
)
{
if
(
tag1
->
items
[
i
]
->
type
!=
tag2
->
items
[
i
]
->
type
)
return
0
;
return
false
;
if
(
strcmp
(
tag1
->
items
[
i
]
->
value
,
tag2
->
items
[
i
]
->
value
))
{
return
0
;
return
false
;
}
}
return
1
;
return
true
;
}
static
char
*
...
...
@@ -440,7 +440,7 @@ void tag_begin_add(struct tag *tag)
assert
(
tag
->
numOfItems
==
0
);
#ifndef NDEBUG
bulk
.
busy
=
1
;
bulk
.
busy
=
true
;
#endif
tag
->
items
=
bulk
.
items
;
}
...
...
@@ -460,7 +460,7 @@ void tag_end_add(struct tag *tag)
}
#ifndef NDEBUG
bulk
.
busy
=
0
;
bulk
.
busy
=
false
;
#endif
}
...
...
src/tag.h
View file @
5b07cbf0
...
...
@@ -137,6 +137,6 @@ tag_get_value(const struct tag *tag, enum tag_type type);
*/
bool
tag_has_type
(
const
struct
tag
*
tag
,
enum
tag_type
type
);
int
tag_equal
(
const
struct
tag
*
tag1
,
const
struct
tag
*
tag2
);
bool
tag_equal
(
const
struct
tag
*
tag1
,
const
struct
tag
*
tag2
);
#endif
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