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
0c19418e
Commit
0c19418e
authored
Aug 24, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag/Settings: convert to bit mask
parent
60c077c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
TagConfig.cxx
src/tag/TagConfig.cxx
+2
-2
TagSettings.c
src/tag/TagSettings.c
+1
-4
TagSettings.h
src/tag/TagSettings.h
+5
-3
No files found.
src/tag/TagConfig.cxx
View file @
0c19418e
...
...
@@ -39,7 +39,7 @@ TagLoadConfig()
if
(
value
==
nullptr
)
return
;
std
::
fill_n
(
ignore_tag_items
,
size_t
(
TAG_NUM_OF_ITEM_TYPES
),
true
)
;
global_tag_mask
=
0
;
if
(
StringEqualsCaseASCII
(
value
,
"none"
))
return
;
...
...
@@ -62,7 +62,7 @@ TagLoadConfig()
FormatFatalError
(
"error parsing metadata item
\"
%s
\"
"
,
c
);
ignore_tag_items
[
type
]
=
false
;
global_tag_mask
|=
tag_mask_t
(
1
)
<<
unsigned
(
type
)
;
s
++
;
c
=
s
;
...
...
src/tag/TagSettings.c
View file @
0c19418e
...
...
@@ -19,7 +19,4 @@
#include "TagSettings.h"
bool
ignore_tag_items
[
TAG_NUM_OF_ITEM_TYPES
]
=
{
/* ignore comments by default */
[
TAG_COMMENT
]
=
true
,
};
tag_mask_t
global_tag_mask
=
(
tag_mask_t
)
-
1
&
~
(
1
<<
TAG_COMMENT
);
src/tag/TagSettings.h
View file @
0c19418e
...
...
@@ -23,9 +23,11 @@
#include "TagType.h"
#include "Compiler.h"
#include <std
bool
.h>
#include <std
int
.h>
extern
bool
ignore_tag_items
[
TAG_NUM_OF_ITEM_TYPES
];
typedef
uint_least32_t
tag_mask_t
;
extern
tag_mask_t
global_tag_mask
;
#ifdef __cplusplus
...
...
@@ -33,7 +35,7 @@ gcc_const
static
inline
bool
IsTagEnabled
(
unsigned
tag
)
{
return
!
ignore_tag_items
[
tag
]
;
return
global_tag_mask
&
(
1u
<<
tag
)
;
}
gcc_const
...
...
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