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
5b2b4bf1
Commit
5b2b4bf1
authored
Oct 28, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config/Param: use CamelCase
parent
4bd67bc2
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
39 additions
and
44 deletions
+39
-44
AudioConfig.cxx
src/AudioConfig.cxx
+1
-1
Listen.cxx
src/Listen.cxx
+2
-3
LogInit.cxx
src/LogInit.cxx
+2
-4
Main.cxx
src/Main.cxx
+1
-1
Permission.cxx
src/Permission.cxx
+1
-1
ReplayGainConfig.cxx
src/ReplayGainConfig.cxx
+1
-2
ConfigFile.cxx
src/config/ConfigFile.cxx
+5
-5
ConfigGlobal.cxx
src/config/ConfigGlobal.cxx
+8
-8
ConfigGlobal.hxx
src/config/ConfigGlobal.hxx
+3
-3
Data.hxx
src/config/Data.hxx
+2
-2
Param.cxx
src/config/Param.cxx
+2
-2
Param.hxx
src/config/Param.hxx
+8
-8
Glue.hxx
src/neighbor/Glue.hxx
+0
-1
OutputPlugin.hxx
src/output/OutputPlugin.hxx
+1
-1
ConfiguredResampler.cxx
src/pcm/ConfiguredResampler.cxx
+2
-2
No files found.
src/AudioConfig.cxx
View file @
5b2b4bf1
...
...
@@ -39,7 +39,7 @@ getOutputAudioFormat(AudioFormat inAudioFormat)
void
initAudioConfig
(
void
)
{
const
struct
config_param
*
param
=
config_get_param
(
ConfigOption
::
AUDIO_OUTPUT_FORMAT
);
const
auto
*
param
=
config_get_param
(
ConfigOption
::
AUDIO_OUTPUT_FORMAT
);
if
(
param
==
nullptr
)
return
;
...
...
src/Listen.cxx
View file @
5b2b4bf1
...
...
@@ -60,7 +60,7 @@ int listen_port;
static
bool
listen_add_config_param
(
unsigned
int
port
,
const
struct
config_p
aram
*
param
,
const
ConfigP
aram
*
param
,
Error
&
error_r
)
{
assert
(
param
!=
nullptr
);
...
...
@@ -104,8 +104,7 @@ bool
listen_global_init
(
EventLoop
&
loop
,
Partition
&
partition
,
Error
&
error
)
{
int
port
=
config_get_positive
(
ConfigOption
::
PORT
,
DEFAULT_PORT
);
const
struct
config_param
*
param
=
config_get_param
(
ConfigOption
::
BIND_TO_ADDRESS
);
const
auto
*
param
=
config_get_param
(
ConfigOption
::
BIND_TO_ADDRESS
);
listen_socket
=
new
ClientListener
(
loop
,
partition
);
...
...
src/LogInit.cxx
View file @
5b2b4bf1
...
...
@@ -124,18 +124,16 @@ log_init(bool verbose, bool use_stdout, Error &error)
return
true
;
#else
const
struct
config_param
*
param
;
if
(
verbose
)
SetLogThreshold
(
LogLevel
::
DEBUG
);
else
if
(
(
param
=
config_get_param
(
ConfigOption
::
LOG_LEVEL
))
!=
nullptr
)
else
if
(
const
auto
&
param
=
config_get_param
(
ConfigOption
::
LOG_LEVEL
)
)
SetLogThreshold
(
parse_log_level
(
param
->
value
.
c_str
(),
param
->
line
));
if
(
use_stdout
)
{
return
true
;
}
else
{
param
=
config_get_param
(
ConfigOption
::
LOG_FILE
);
const
auto
*
param
=
config_get_param
(
ConfigOption
::
LOG_FILE
);
if
(
param
==
nullptr
)
{
#ifdef HAVE_SYSLOG
/* no configuration: default to syslog (if
...
...
src/Main.cxx
View file @
5b2b4bf1
...
...
@@ -307,7 +307,7 @@ static void winsock_init(void)
static
void
initialize_decoder_and_player
(
void
)
{
const
struct
config_p
aram
*
param
;
const
ConfigP
aram
*
param
;
size_t
buffer_size
;
param
=
config_get_param
(
ConfigOption
::
AUDIO_BUFFER_SIZE
);
...
...
src/Permission.cxx
View file @
5b2b4bf1
...
...
@@ -87,7 +87,7 @@ static unsigned parsePermissions(const char *string)
void
initPermissions
(
void
)
{
unsigned
permission
;
const
struct
config_p
aram
*
param
;
const
ConfigP
aram
*
param
;
permission_default
=
PERMISSION_READ
|
PERMISSION_ADD
|
PERMISSION_CONTROL
|
PERMISSION_ADMIN
;
...
...
src/ReplayGainConfig.cxx
View file @
5b2b4bf1
...
...
@@ -78,8 +78,7 @@ replay_gain_set_mode_string(const char *p)
void
replay_gain_global_init
(
void
)
{
const
struct
config_param
*
param
=
config_get_param
(
ConfigOption
::
REPLAYGAIN
);
const
auto
*
param
=
config_get_param
(
ConfigOption
::
REPLAYGAIN
);
if
(
param
!=
nullptr
&&
!
replay_gain_set_mode_string
(
param
->
value
.
c_str
()))
{
...
...
src/config/ConfigFile.cxx
View file @
5b2b4bf1
...
...
@@ -145,11 +145,11 @@ ReadConfigBlock(ConfigData &config_data, BufferedReader &reader,
gcc_nonnull_all
static
void
Append
(
config_param
*&
head
,
config_p
aram
*
p
)
Append
(
ConfigParam
*&
head
,
ConfigP
aram
*
p
)
{
assert
(
p
->
next
==
nullptr
);
config_param
**
i
=
&
head
;
auto
**
i
=
&
head
;
while
(
*
i
!=
nullptr
)
i
=
&
(
*
i
)
->
next
;
...
...
@@ -163,10 +163,10 @@ ReadConfigParam(ConfigData &config_data, BufferedReader &reader,
{
const
unsigned
i
=
unsigned
(
o
);
const
ConfigTemplate
&
option
=
config_param_templates
[
i
];
config_param
*&
head
=
config_data
.
params
[
i
];
auto
*&
head
=
config_data
.
params
[
i
];
if
(
head
!=
nullptr
&&
!
option
.
repeatable
)
{
struct
config_param
*
param
=
head
;
auto
*
param
=
head
;
throw
FormatRuntimeError
(
"config parameter
\"
%s
\"
is first defined "
"on line %d and redefined on line %u
\n
"
,
name
,
param
->
line
,
...
...
@@ -184,7 +184,7 @@ ReadConfigParam(ConfigData &config_data, BufferedReader &reader,
throw
FormatRuntimeError
(
"line %u: Unknown tokens after value"
,
reader
.
GetLineNumber
());
auto
*
param
=
new
config_p
aram
(
value
,
reader
.
GetLineNumber
());
auto
*
param
=
new
ConfigP
aram
(
value
,
reader
.
GetLineNumber
());
Append
(
head
,
param
);
}
...
...
src/config/ConfigGlobal.cxx
View file @
5b2b4bf1
...
...
@@ -75,10 +75,10 @@ void config_global_check(void)
Check
(
*
p
);
}
const
config_p
aram
*
const
ConfigP
aram
*
config_get_param
(
ConfigOption
option
)
{
config_param
*
param
=
config_data
.
params
[
unsigned
(
option
)];
auto
*
param
=
config_data
.
params
[
unsigned
(
option
)];
if
(
param
!=
nullptr
)
param
->
used
=
true
;
return
param
;
...
...
@@ -113,7 +113,7 @@ config_find_block(ConfigBlockOption option, const char *key, const char *value)
const
char
*
config_get_string
(
ConfigOption
option
,
const
char
*
default_value
)
{
const
struct
config_param
*
param
=
config_get_param
(
option
);
const
auto
*
param
=
config_get_param
(
option
);
if
(
param
==
nullptr
)
return
default_value
;
...
...
@@ -124,7 +124,7 @@ config_get_string(ConfigOption option, const char *default_value)
AllocatedPath
config_get_path
(
ConfigOption
option
,
Error
&
error
)
{
const
struct
config_param
*
param
=
config_get_param
(
option
);
const
auto
*
param
=
config_get_param
(
option
);
if
(
param
==
nullptr
)
return
AllocatedPath
::
Null
();
...
...
@@ -132,7 +132,7 @@ config_get_path(ConfigOption option, Error &error)
}
AllocatedPath
config_parse_path
(
const
struct
config_p
aram
*
param
,
Error
&
error
)
config_parse_path
(
const
ConfigP
aram
*
param
,
Error
&
error
)
{
AllocatedPath
path
=
ParsePath
(
param
->
value
.
c_str
(),
error
);
if
(
gcc_unlikely
(
path
.
IsNull
()))
...
...
@@ -145,7 +145,7 @@ config_parse_path(const struct config_param *param, Error & error)
unsigned
config_get_unsigned
(
ConfigOption
option
,
unsigned
default_value
)
{
const
struct
config_param
*
param
=
config_get_param
(
option
);
const
auto
*
param
=
config_get_param
(
option
);
long
value
;
char
*
endptr
;
...
...
@@ -163,7 +163,7 @@ config_get_unsigned(ConfigOption option, unsigned default_value)
unsigned
config_get_positive
(
ConfigOption
option
,
unsigned
default_value
)
{
const
struct
config_param
*
param
=
config_get_param
(
option
);
const
auto
*
param
=
config_get_param
(
option
);
long
value
;
char
*
endptr
;
...
...
@@ -184,7 +184,7 @@ config_get_positive(ConfigOption option, unsigned default_value)
bool
config_get_bool
(
ConfigOption
option
,
bool
default_value
)
{
const
struct
config_param
*
param
=
config_get_param
(
option
);
const
auto
*
param
=
config_get_param
(
option
);
bool
success
,
value
;
if
(
param
==
nullptr
)
...
...
src/config/ConfigGlobal.hxx
View file @
5b2b4bf1
...
...
@@ -26,7 +26,7 @@
class
Error
;
class
Path
;
class
AllocatedPath
;
struct
config_p
aram
;
struct
ConfigP
aram
;
struct
ConfigBlock
;
void
...
...
@@ -46,7 +46,7 @@ void
ReadConfigFile
(
Path
path
);
gcc_pure
const
config_p
aram
*
const
ConfigP
aram
*
config_get_param
(
enum
ConfigOption
option
);
gcc_pure
...
...
@@ -90,7 +90,7 @@ config_get_path(enum ConfigOption option, Error &error);
* not be parsed, returns AllocatedPath::Null() and sets the error.
*/
AllocatedPath
config_parse_path
(
const
struct
config_p
aram
*
param
,
Error
&
error_r
);
config_parse_path
(
const
ConfigP
aram
*
param
,
Error
&
error_r
);
gcc_pure
unsigned
...
...
src/config/Data.hxx
View file @
5b2b4bf1
...
...
@@ -24,11 +24,11 @@
#include <array>
struct
config_p
aram
;
struct
ConfigP
aram
;
struct
ConfigBlock
;
struct
ConfigData
{
std
::
array
<
config_p
aram
*
,
std
::
size_t
(
ConfigOption
::
MAX
)
>
params
;
std
::
array
<
ConfigP
aram
*
,
std
::
size_t
(
ConfigOption
::
MAX
)
>
params
;
std
::
array
<
ConfigBlock
*
,
std
::
size_t
(
ConfigBlockOption
::
MAX
)
>
blocks
;
void
Clear
();
...
...
src/config/Param.cxx
View file @
5b2b4bf1
...
...
@@ -20,10 +20,10 @@
#include "config.h"
#include "Param.hxx"
config_param
::
config_p
aram
(
const
char
*
_value
,
int
_line
)
ConfigParam
::
ConfigP
aram
(
const
char
*
_value
,
int
_line
)
:
next
(
nullptr
),
value
(
_value
),
line
(
_line
),
used
(
false
)
{}
config_param
::~
config_p
aram
()
ConfigParam
::~
ConfigP
aram
()
{
delete
next
;
}
src/config/Param.hxx
View file @
5b2b4bf1
...
...
@@ -25,12 +25,12 @@
#include <string>
struct
config_p
aram
{
struct
ConfigP
aram
{
/**
* The next
config_p
aram with the same name. The destructor
* The next
ConfigP
aram with the same name. The destructor
* deletes the whole chain.
*/
struct
config_p
aram
*
next
;
ConfigP
aram
*
next
;
std
::
string
value
;
...
...
@@ -42,17 +42,17 @@ struct config_param {
*/
bool
used
;
explicit
config_p
aram
(
int
_line
=-
1
)
explicit
ConfigP
aram
(
int
_line
=-
1
)
:
next
(
nullptr
),
line
(
_line
),
used
(
false
)
{}
gcc_nonnull_all
config_p
aram
(
const
char
*
_value
,
int
_line
=-
1
);
ConfigP
aram
(
const
char
*
_value
,
int
_line
=-
1
);
config_param
(
const
config_p
aram
&
)
=
delete
;
ConfigParam
(
const
ConfigP
aram
&
)
=
delete
;
~
config_p
aram
();
~
ConfigP
aram
();
config_param
&
operator
=
(
const
config_p
aram
&
)
=
delete
;
ConfigParam
&
operator
=
(
const
ConfigP
aram
&
)
=
delete
;
/**
* Determine if this is a "null" instance, i.e. an empty
...
...
src/neighbor/Glue.hxx
View file @
5b2b4bf1
...
...
@@ -26,7 +26,6 @@
#include <forward_list>
struct
config_param
;
class
EventLoop
;
class
NeighborExplorer
;
class
NeighborListener
;
...
...
src/output/OutputPlugin.hxx
View file @
5b2b4bf1
...
...
@@ -145,7 +145,7 @@ struct AudioOutputPlugin {
/**
* The mixer plugin associated with this output plugin. This
* may be nullptr if no mixer plugin is implemented. When
* created, this mixer plugin gets the same #
config_p
aram as
* created, this mixer plugin gets the same #
ConfigP
aram as
* this audio output device.
*/
const
MixerPlugin
*
mixer_plugin
;
...
...
src/pcm/ConfiguredResampler.cxx
View file @
5b2b4bf1
...
...
@@ -71,7 +71,7 @@ MakeResamplerDefaultConfig(ConfigBlock &block)
* "resampler" block.
*/
static
const
ConfigBlock
*
MigrateResamplerConfig
(
const
config_p
aram
&
param
,
ConfigBlock
&
block
)
MigrateResamplerConfig
(
const
ConfigP
aram
&
param
,
ConfigBlock
&
block
)
{
assert
(
block
.
IsEmpty
());
...
...
@@ -102,7 +102,7 @@ MigrateResamplerConfig(const config_param ¶m, ConfigBlock &block)
}
static
const
ConfigBlock
*
MigrateResamplerConfig
(
const
config_p
aram
*
param
,
ConfigBlock
&
buffer
)
MigrateResamplerConfig
(
const
ConfigP
aram
*
param
,
ConfigBlock
&
buffer
)
{
assert
(
buffer
.
IsEmpty
());
...
...
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