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
5348808b
Commit
5348808b
authored
Sep 05, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PlaylistPlugin, ConfigGlobal: use nullptr instead of NULL
parent
fccba1af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
15 deletions
+11
-15
ConfigGlobal.cxx
src/ConfigGlobal.cxx
+5
-5
ConfigGlobal.hxx
src/ConfigGlobal.hxx
+2
-4
PlaylistPlugin.hxx
src/PlaylistPlugin.hxx
+4
-6
No files found.
src/ConfigGlobal.cxx
View file @
5348808b
...
...
@@ -92,7 +92,7 @@ config_get_string(ConfigOption option, const char *default_value)
{
const
struct
config_param
*
param
=
config_get_param
(
option
);
if
(
param
==
NULL
)
if
(
param
==
nullptr
)
return
default_value
;
return
param
->
value
;
...
...
@@ -102,7 +102,7 @@ Path
config_get_path
(
ConfigOption
option
,
Error
&
error
)
{
const
struct
config_param
*
param
=
config_get_param
(
option
);
if
(
param
==
NULL
)
if
(
param
==
nullptr
)
return
Path
::
Null
();
Path
path
=
ParsePath
(
param
->
value
,
error
);
...
...
@@ -120,7 +120,7 @@ config_get_unsigned(ConfigOption option, unsigned default_value)
long
value
;
char
*
endptr
;
if
(
param
==
NULL
)
if
(
param
==
nullptr
)
return
default_value
;
value
=
strtol
(
param
->
value
,
&
endptr
,
0
);
...
...
@@ -138,7 +138,7 @@ config_get_positive(ConfigOption option, unsigned default_value)
long
value
;
char
*
endptr
;
if
(
param
==
NULL
)
if
(
param
==
nullptr
)
return
default_value
;
value
=
strtol
(
param
->
value
,
&
endptr
,
0
);
...
...
@@ -157,7 +157,7 @@ config_get_bool(ConfigOption option, bool default_value)
const
struct
config_param
*
param
=
config_get_param
(
option
);
bool
success
,
value
;
if
(
param
==
NULL
)
if
(
param
==
nullptr
)
return
default_value
;
success
=
get_bool
(
param
->
value
,
&
value
);
...
...
src/ConfigGlobal.hxx
View file @
5348808b
...
...
@@ -23,8 +23,6 @@
#include "ConfigOption.hxx"
#include "gcc.h"
#include <stddef.h>
class
Error
;
class
Path
;
...
...
@@ -41,7 +39,7 @@ bool
ReadConfigFile
(
const
Path
&
path
,
Error
&
error
);
/* don't free the returned value
set _last_ to
NULL
to get first entry */
set _last_ to
nullptr
to get first entry */
gcc_pure
const
struct
config_param
*
config_get_next_param
(
enum
ConfigOption
option
,
...
...
@@ -51,7 +49,7 @@ gcc_pure
static
inline
const
struct
config_param
*
config_get_param
(
enum
ConfigOption
option
)
{
return
config_get_next_param
(
option
,
NULL
);
return
config_get_next_param
(
option
,
nullptr
);
}
/* Note on gcc_pure: Some of the functions declared pure are not
...
...
src/PlaylistPlugin.hxx
View file @
5348808b
...
...
@@ -23,8 +23,6 @@
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include <stddef.h>
struct
config_param
;
struct
input_stream
;
struct
Tag
;
...
...
@@ -50,7 +48,7 @@ struct playlist_plugin {
/**
* Initialize the plugin. Optional method.
*
* @param param a configuration block for this plugin, or
NULL
* @param param a configuration block for this plugin, or
nullptr
* if none is configured
* @return true if the plugin was initialized successfully,
* false if the plugin is not available
...
...
@@ -89,7 +87,7 @@ struct playlist_plugin {
/**
* Initialize a plugin.
*
* @param param a configuration block for this plugin, or
NULL
if none
* @param param a configuration block for this plugin, or
nullptr
if none
* is configured
* @return true if the plugin was initialized successfully, false if
* the plugin is not available
...
...
@@ -98,7 +96,7 @@ static inline bool
playlist_plugin_init
(
const
struct
playlist_plugin
*
plugin
,
const
config_param
&
param
)
{
return
plugin
->
init
!=
NULL
return
plugin
->
init
!=
nullptr
?
plugin
->
init
(
param
)
:
true
;
}
...
...
@@ -109,7 +107,7 @@ playlist_plugin_init(const struct playlist_plugin *plugin,
static
inline
void
playlist_plugin_finish
(
const
struct
playlist_plugin
*
plugin
)
{
if
(
plugin
->
finish
!=
NULL
)
if
(
plugin
->
finish
!=
nullptr
)
plugin
->
finish
();
}
...
...
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