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
f0b58c6f
Commit
f0b58c6f
authored
Aug 24, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/UniqueTags, tag/Set, ...: use typedef tag_mask_t
parent
f3661b19
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
30 additions
and
32 deletions
+30
-32
DatabaseCommands.cxx
src/command/DatabaseCommands.cxx
+3
-3
DatabasePrint.cxx
src/db/DatabasePrint.cxx
+1
-1
DatabasePrint.hxx
src/db/DatabasePrint.hxx
+2
-3
Interface.hxx
src/db/Interface.hxx
+2
-2
UniqueTags.cxx
src/db/UniqueTags.cxx
+2
-2
UniqueTags.hxx
src/db/UniqueTags.hxx
+2
-3
LazyDatabase.cxx
src/db/plugins/LazyDatabase.cxx
+1
-1
LazyDatabase.hxx
src/db/plugins/LazyDatabase.hxx
+1
-1
ProxyDatabasePlugin.cxx
src/db/plugins/ProxyDatabasePlugin.cxx
+2
-2
SimpleDatabasePlugin.cxx
src/db/plugins/simple/SimpleDatabasePlugin.cxx
+1
-1
SimpleDatabasePlugin.hxx
src/db/plugins/simple/SimpleDatabasePlugin.hxx
+1
-1
UpnpDatabasePlugin.cxx
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
+2
-2
Set.cxx
src/tag/Set.cxx
+6
-6
Set.hxx
src/tag/Set.hxx
+4
-4
No files found.
src/command/DatabaseCommands.cxx
View file @
f0b58c6f
...
...
@@ -217,7 +217,7 @@ handle_list(Client &client, Request args, Response &r)
}
SongFilter
*
filter
=
nullptr
;
uint32
_t
group_mask
=
0
;
tag_mask
_t
group_mask
=
0
;
if
(
args
.
size
==
1
)
{
/* for compatibility with < 0.12.0 */
...
...
@@ -241,7 +241,7 @@ handle_list(Client &client, Request args, Response &r)
return
CommandResult
::
ERROR
;
}
group_mask
|=
1u
<<
unsigned
(
gt
);
group_mask
|=
tag_mask_t
(
1
)
<<
unsigned
(
gt
);
args
.
pop_back
();
args
.
pop_back
();
...
...
@@ -257,7 +257,7 @@ handle_list(Client &client, Request args, Response &r)
}
if
(
tagType
<
TAG_NUM_OF_ITEM_TYPES
&&
group_mask
&
(
1u
<<
tagType
))
{
group_mask
&
(
tag_mask_t
(
1
)
<<
tagType
))
{
delete
filter
;
r
.
Error
(
ACK_ERROR_ARG
,
"Conflicting group"
);
return
CommandResult
::
ERROR
;
...
...
src/db/DatabasePrint.cxx
View file @
f0b58c6f
...
...
@@ -223,7 +223,7 @@ PrintUniqueTag(Response &r, TagType tag_type,
bool
PrintUniqueTags
(
Response
&
r
,
Partition
&
partition
,
unsigned
type
,
uint32
_t
group_mask
,
unsigned
type
,
tag_mask
_t
group_mask
,
const
SongFilter
*
filter
,
Error
&
error
)
{
...
...
src/db/DatabasePrint.hxx
View file @
f0b58c6f
...
...
@@ -20,10 +20,9 @@
#ifndef MPD_DB_PRINT_H
#define MPD_DB_PRINT_H
#include "tag/Mask.hxx"
#include "Compiler.h"
#include <stdint.h>
class
SongFilter
;
struct
DatabaseSelection
;
struct
Partition
;
...
...
@@ -49,7 +48,7 @@ db_selection_print(Response &r, Partition &partition,
bool
PrintUniqueTags
(
Response
&
r
,
Partition
&
partition
,
unsigned
type
,
uint32
_t
group_mask
,
unsigned
type
,
tag_mask
_t
group_mask
,
const
SongFilter
*
filter
,
Error
&
error
);
...
...
src/db/Interface.hxx
View file @
f0b58c6f
...
...
@@ -22,10 +22,10 @@
#include "Visitor.hxx"
#include "tag/TagType.h"
#include "tag/Mask.hxx"
#include "Compiler.h"
#include <time.h>
#include <stdint.h>
struct
DatabasePlugin
;
struct
DatabaseStats
;
...
...
@@ -107,7 +107,7 @@ public:
* Visit all unique tag values.
*/
virtual
bool
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
TagType
tag_type
,
uint32
_t
group_mask
,
TagType
tag_type
,
tag_mask
_t
group_mask
,
VisitTag
visit_tag
,
Error
&
error
)
const
=
0
;
...
...
src/db/UniqueTags.cxx
View file @
f0b58c6f
...
...
@@ -27,7 +27,7 @@
#include <assert.h>
static
bool
CollectTags
(
TagSet
&
set
,
TagType
tag_type
,
uint32
_t
group_mask
,
CollectTags
(
TagSet
&
set
,
TagType
tag_type
,
tag_mask
_t
group_mask
,
const
LightSong
&
song
)
{
assert
(
song
.
tag
!=
nullptr
);
...
...
@@ -39,7 +39,7 @@ CollectTags(TagSet &set, TagType tag_type, uint32_t group_mask,
bool
VisitUniqueTags
(
const
Database
&
db
,
const
DatabaseSelection
&
selection
,
TagType
tag_type
,
uint32
_t
group_mask
,
TagType
tag_type
,
tag_mask
_t
group_mask
,
VisitTag
visit_tag
,
Error
&
error
)
{
...
...
src/db/UniqueTags.hxx
View file @
f0b58c6f
...
...
@@ -22,8 +22,7 @@
#include "Visitor.hxx"
#include "tag/TagType.h"
#include <stdint.h>
#include "tag/Mask.hxx"
class
Error
;
class
Database
;
...
...
@@ -31,7 +30,7 @@ struct DatabaseSelection;
bool
VisitUniqueTags
(
const
Database
&
db
,
const
DatabaseSelection
&
selection
,
TagType
tag_type
,
uint32
_t
group_mask
,
TagType
tag_type
,
tag_mask
_t
group_mask
,
VisitTag
visit_tag
,
Error
&
error
);
...
...
src/db/plugins/LazyDatabase.cxx
View file @
f0b58c6f
...
...
@@ -85,7 +85,7 @@ LazyDatabase::Visit(const DatabaseSelection &selection,
bool
LazyDatabase
::
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
TagType
tag_type
,
uint32
_t
group_mask
,
TagType
tag_type
,
tag_mask
_t
group_mask
,
VisitTag
visit_tag
,
Error
&
error
)
const
{
...
...
src/db/plugins/LazyDatabase.hxx
View file @
f0b58c6f
...
...
@@ -52,7 +52,7 @@ public:
Error
&
error
)
const
override
;
virtual
bool
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
TagType
tag_type
,
uint32
_t
group_mask
,
TagType
tag_type
,
tag_mask
_t
group_mask
,
VisitTag
visit_tag
,
Error
&
error
)
const
override
;
...
...
src/db/plugins/ProxyDatabasePlugin.cxx
View file @
f0b58c6f
...
...
@@ -113,7 +113,7 @@ public:
Error
&
error
)
const
override
;
virtual
bool
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
TagType
tag_type
,
uint32
_t
group_mask
,
TagType
tag_type
,
tag_mask
_t
group_mask
,
VisitTag
visit_tag
,
Error
&
error
)
const
override
;
...
...
@@ -757,7 +757,7 @@ ProxyDatabase::Visit(const DatabaseSelection &selection,
bool
ProxyDatabase
::
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
TagType
tag_type
,
gcc_unused
uint32
_t
group_mask
,
gcc_unused
tag_mask
_t
group_mask
,
VisitTag
visit_tag
,
Error
&
error
)
const
{
...
...
src/db/plugins/simple/SimpleDatabasePlugin.cxx
View file @
f0b58c6f
...
...
@@ -348,7 +348,7 @@ SimpleDatabase::Visit(const DatabaseSelection &selection,
bool
SimpleDatabase
::
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
TagType
tag_type
,
uint32
_t
group_mask
,
TagType
tag_type
,
tag_mask
_t
group_mask
,
VisitTag
visit_tag
,
Error
&
error
)
const
{
...
...
src/db/plugins/simple/SimpleDatabasePlugin.hxx
View file @
f0b58c6f
...
...
@@ -121,7 +121,7 @@ public:
Error
&
error
)
const
override
;
virtual
bool
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
TagType
tag_type
,
uint32
_t
group_mask
,
TagType
tag_type
,
tag_mask
_t
group_mask
,
VisitTag
visit_tag
,
Error
&
error
)
const
override
;
...
...
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
View file @
f0b58c6f
...
...
@@ -94,7 +94,7 @@ public:
Error
&
error
)
const
override
;
virtual
bool
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
TagType
tag_type
,
uint32
_t
group_mask
,
TagType
tag_type
,
tag_mask
_t
group_mask
,
VisitTag
visit_tag
,
Error
&
error
)
const
override
;
...
...
@@ -723,7 +723,7 @@ UpnpDatabase::Visit(const DatabaseSelection &selection,
bool
UpnpDatabase
::
VisitUniqueTags
(
const
DatabaseSelection
&
selection
,
TagType
tag
,
gcc_unused
uint32
_t
group_mask
,
TagType
tag
,
gcc_unused
tag_mask
_t
group_mask
,
VisitTag
visit_tag
,
Error
&
error
)
const
{
...
...
src/tag/Set.cxx
View file @
f0b58c6f
...
...
@@ -58,16 +58,16 @@ CopyTagItem(TagBuilder &dest, const Tag &src, TagType type)
* Copy all tag items of the types in the mask.
*/
static
void
CopyTagMask
(
TagBuilder
&
dest
,
const
Tag
&
src
,
uint32
_t
mask
)
CopyTagMask
(
TagBuilder
&
dest
,
const
Tag
&
src
,
tag_mask
_t
mask
)
{
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
if
((
mask
&
(
1u
<<
i
))
!=
0
)
if
((
mask
&
(
tag_mask_t
(
1
)
<<
i
))
!=
0
)
CopyTagItem
(
dest
,
src
,
TagType
(
i
));
}
void
TagSet
::
InsertUnique
(
const
Tag
&
src
,
TagType
type
,
const
char
*
value
,
uint32
_t
group_mask
)
tag_mask
_t
group_mask
)
{
TagBuilder
builder
;
if
(
value
==
nullptr
)
...
...
@@ -85,7 +85,7 @@ TagSet::InsertUnique(const Tag &src, TagType type, const char *value,
bool
TagSet
::
CheckUnique
(
TagType
dest_type
,
const
Tag
&
tag
,
TagType
src_type
,
uint32
_t
group_mask
)
tag_mask
_t
group_mask
)
{
bool
found
=
false
;
...
...
@@ -101,12 +101,12 @@ TagSet::CheckUnique(TagType dest_type,
void
TagSet
::
InsertUnique
(
const
Tag
&
tag
,
TagType
type
,
uint32
_t
group_mask
)
TagType
type
,
tag_mask
_t
group_mask
)
{
static_assert
(
sizeof
(
group_mask
)
*
8
>=
TAG_NUM_OF_ITEM_TYPES
,
"Mask is too small"
);
assert
((
group_mask
&
(
1u
<<
unsigned
(
type
)))
==
0
);
assert
((
group_mask
&
(
tag_mask_t
(
1
)
<<
unsigned
(
type
)))
==
0
);
if
(
!
CheckUnique
(
type
,
tag
,
type
,
group_mask
)
&&
(
type
!=
TAG_ALBUM_ARTIST
||
...
...
src/tag/Set.hxx
View file @
f0b58c6f
...
...
@@ -22,11 +22,11 @@
#include "Compiler.h"
#include "Tag.hxx"
#include "Mask.hxx"
#include <set>
#include <string.h>
#include <stdint.h>
/**
* Helper class for #TagSet which compares two #Tag objects.
...
...
@@ -59,15 +59,15 @@ struct TagLess {
class
TagSet
:
public
std
::
set
<
Tag
,
TagLess
>
{
public
:
void
InsertUnique
(
const
Tag
&
tag
,
TagType
type
,
uint32
_t
group_mask
);
TagType
type
,
tag_mask
_t
group_mask
);
private
:
void
InsertUnique
(
const
Tag
&
src
,
TagType
type
,
const
char
*
value
,
uint32
_t
group_mask
);
tag_mask
_t
group_mask
);
bool
CheckUnique
(
TagType
dest_type
,
const
Tag
&
tag
,
TagType
src_type
,
uint32
_t
group_mask
);
tag_mask
_t
group_mask
);
};
#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