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
39c96694
Commit
39c96694
authored
Mar 05, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/Traits: add macro PATH_LITERAL()
parent
44565e22
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
14 deletions
+18
-14
CommandLine.cxx
src/CommandLine.cxx
+5
-5
PlaylistFile.cxx
src/PlaylistFile.cxx
+2
-1
Configured.cxx
src/db/Configured.cxx
+2
-1
FileSystem.hxx
src/fs/FileSystem.hxx
+2
-2
Traits.hxx
src/fs/Traits.hxx
+3
-1
ApeLoader.cxx
src/tag/ApeLoader.cxx
+1
-1
TagId3.cxx
src/tag/TagId3.cxx
+1
-1
Daemon.cxx
src/unix/Daemon.cxx
+1
-1
PidFile.hxx
src/unix/PidFile.hxx
+1
-1
No files found.
src/CommandLine.cxx
View file @
39c96694
...
...
@@ -66,12 +66,12 @@
#include <stdlib.h>
#ifdef WIN32
#define CONFIG_FILE_LOCATION
"mpd\\mpd.conf"
#define APP_CONFIG_FILE_LOCATION
"conf\\mpd.conf"
#define CONFIG_FILE_LOCATION
PATH_LITERAL("mpd\\mpd.conf")
#define APP_CONFIG_FILE_LOCATION
PATH_LITERAL("conf\\mpd.conf")
#else
#define USER_CONFIG_FILE_LOCATION1
".mpdconf"
#define USER_CONFIG_FILE_LOCATION2
".mpd/mpd.conf"
#define USER_CONFIG_FILE_LOCATION_XDG
"mpd/mpd.conf"
#define USER_CONFIG_FILE_LOCATION1
PATH_LITERAL(".mpdconf")
#define USER_CONFIG_FILE_LOCATION2
PATH_LITERAL(".mpd/mpd.conf")
#define USER_CONFIG_FILE_LOCATION_XDG
PATH_LITERAL("mpd/mpd.conf")
#endif
static
constexpr
OptionDef
opt_kill
(
...
...
src/PlaylistFile.cxx
View file @
39c96694
...
...
@@ -174,7 +174,8 @@ LoadPlaylistFileInfo(PlaylistInfo &info,
const
auto
*
const
name_fs_str
=
name_fs
.
c_str
();
const
auto
*
const
name_fs_end
=
FindStringSuffix
(
name_fs_str
,
PLAYLIST_FILE_SUFFIX
);
FindStringSuffix
(
name_fs_str
,
PATH_LITERAL
(
PLAYLIST_FILE_SUFFIX
));
if
(
name_fs_end
==
nullptr
)
return
false
;
...
...
src/db/Configured.cxx
View file @
39c96694
...
...
@@ -59,7 +59,8 @@ CreateConfiguredDatabase(EventLoop &loop, DatabaseListener &listener,
if
(
cache_dir
.
IsNull
())
return
nullptr
;
const
auto
db_file
=
AllocatedPath
::
Build
(
cache_dir
,
"mpd.db"
);
const
auto
db_file
=
AllocatedPath
::
Build
(
cache_dir
,
PATH_LITERAL
(
"mpd.db"
));
const
auto
db_file_utf8
=
db_file
.
ToUTF8
();
if
(
db_file_utf8
.
empty
())
return
nullptr
;
...
...
src/fs/FileSystem.hxx
View file @
39c96694
...
...
@@ -41,12 +41,12 @@ namespace FOpenMode {
/**
* Open mode for writing text files.
*/
constexpr
PathTraitsFS
::
const_pointer
WriteText
=
"w"
;
constexpr
PathTraitsFS
::
const_pointer
WriteText
=
PATH_LITERAL
(
"w"
)
;
/**
* Open mode for appending text files.
*/
constexpr
PathTraitsFS
::
const_pointer
AppendText
=
"a"
;
constexpr
PathTraitsFS
::
const_pointer
AppendText
=
PATH_LITERAL
(
"a"
)
;
}
/**
...
...
src/fs/Traits.hxx
View file @
39c96694
...
...
@@ -32,6 +32,8 @@
#include <assert.h>
#define PATH_LITERAL(s) (s)
/**
* This class describes the nature of a native filesystem path.
*/
...
...
@@ -48,7 +50,7 @@ struct PathTraitsFS {
static
constexpr
value_type
SEPARATOR
=
'/'
;
#endif
static
constexpr
const_pointer
CURRENT_DIRECTORY
=
"."
;
static
constexpr
const_pointer
CURRENT_DIRECTORY
=
PATH_LITERAL
(
"."
)
;
static
constexpr
bool
IsSeparator
(
value_type
ch
)
{
return
...
...
src/tag/ApeLoader.cxx
View file @
39c96694
...
...
@@ -103,7 +103,7 @@ ape_scan_internal(FILE *fp, ApeTagCallback callback)
bool
tag_ape_scan
(
Path
path_fs
,
ApeTagCallback
callback
)
{
FILE
*
fp
=
FOpen
(
path_fs
,
"rb"
);
FILE
*
fp
=
FOpen
(
path_fs
,
PATH_LITERAL
(
"rb"
)
);
if
(
fp
==
nullptr
)
return
false
;
...
...
src/tag/TagId3.cxx
View file @
39c96694
...
...
@@ -521,7 +521,7 @@ tag_id3_riff_aiff_load(FILE *file)
struct
id3_tag
*
tag_id3_load
(
Path
path_fs
,
Error
&
error
)
{
FILE
*
file
=
FOpen
(
path_fs
,
"rb"
);
FILE
*
file
=
FOpen
(
path_fs
,
PATH_LITERAL
(
"rb"
)
);
if
(
file
==
nullptr
)
{
error
.
FormatErrno
(
"Failed to open file %s"
,
path_fs
.
c_str
());
return
nullptr
;
...
...
src/unix/Daemon.cxx
View file @
39c96694
...
...
@@ -71,7 +71,7 @@ daemonize_kill(void)
if
(
pidfile
.
IsNull
())
FatalError
(
"no pid_file specified in the config file"
);
fp
=
FOpen
(
pidfile
,
"r"
);
fp
=
FOpen
(
pidfile
,
PATH_LITERAL
(
"r"
)
);
if
(
fp
==
nullptr
)
{
const
std
::
string
utf8
=
pidfile
.
ToUTF8
();
FormatFatalSystemError
(
"Unable to open pid file
\"
%s
\"
"
,
...
...
src/unix/PidFile.hxx
View file @
39c96694
...
...
@@ -37,7 +37,7 @@ public:
if
(
path
.
IsNull
())
return
;
file
=
FOpen
(
path
,
"w"
);
file
=
FOpen
(
path
,
FOpenMode
::
WriteText
);
if
(
file
==
nullptr
)
{
const
std
::
string
utf8
=
path
.
ToUTF8
();
FormatFatalSystemError
(
"Failed to create pid file
\"
%s
\"
"
,
...
...
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