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
1e3f0650
Commit
1e3f0650
authored
Jan 21, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SongUpdate: add "noexcept"
parent
1e9da09f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
13 deletions
+14
-13
DetachedSong.hxx
src/DetachedSong.hxx
+2
-2
SongUpdate.cxx
src/SongUpdate.cxx
+7
-6
Song.hxx
src/db/plugins/simple/Song.hxx
+4
-4
test_translate_song.cxx
test/test_translate_song.cxx
+1
-1
No files found.
src/DetachedSong.hxx
View file @
1e3f0650
...
@@ -237,12 +237,12 @@ public:
...
@@ -237,12 +237,12 @@ public:
*
*
* @return true on success
* @return true on success
*/
*/
bool
Update
();
bool
Update
()
noexcept
;
/**
/**
* Load #tag and #mtime from a local file.
* Load #tag and #mtime from a local file.
*/
*/
bool
LoadFile
(
Path
path
);
bool
LoadFile
(
Path
path
)
noexcept
;
};
};
#endif
#endif
src/SongUpdate.cxx
View file @
1e3f0650
...
@@ -42,7 +42,8 @@
...
@@ -42,7 +42,8 @@
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
Song
*
Song
*
Song
::
LoadFile
(
Storage
&
storage
,
const
char
*
path_utf8
,
Directory
&
parent
)
Song
::
LoadFile
(
Storage
&
storage
,
const
char
*
path_utf8
,
Directory
&
parent
)
noexcept
{
{
assert
(
!
uri_has_scheme
(
path_utf8
));
assert
(
!
uri_has_scheme
(
path_utf8
));
assert
(
strchr
(
path_utf8
,
'\n'
)
==
nullptr
);
assert
(
strchr
(
path_utf8
,
'\n'
)
==
nullptr
);
...
@@ -61,7 +62,7 @@ Song::LoadFile(Storage &storage, const char *path_utf8, Directory &parent)
...
@@ -61,7 +62,7 @@ Song::LoadFile(Storage &storage, const char *path_utf8, Directory &parent)
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
bool
bool
Song
::
UpdateFile
(
Storage
&
storage
)
Song
::
UpdateFile
(
Storage
&
storage
)
noexcept
{
{
const
auto
&
relative_uri
=
GetURI
();
const
auto
&
relative_uri
=
GetURI
();
...
@@ -99,7 +100,7 @@ Song::UpdateFile(Storage &storage)
...
@@ -99,7 +100,7 @@ Song::UpdateFile(Storage &storage)
Song
*
Song
*
Song
::
LoadFromArchive
(
ArchiveFile
&
archive
,
const
char
*
name_utf8
,
Song
::
LoadFromArchive
(
ArchiveFile
&
archive
,
const
char
*
name_utf8
,
Directory
&
parent
)
Directory
&
parent
)
noexcept
{
{
assert
(
!
uri_has_scheme
(
name_utf8
));
assert
(
!
uri_has_scheme
(
name_utf8
));
assert
(
strchr
(
name_utf8
,
'\n'
)
==
nullptr
);
assert
(
strchr
(
name_utf8
,
'\n'
)
==
nullptr
);
...
@@ -115,7 +116,7 @@ Song::LoadFromArchive(ArchiveFile &archive, const char *name_utf8,
...
@@ -115,7 +116,7 @@ Song::LoadFromArchive(ArchiveFile &archive, const char *name_utf8,
}
}
bool
bool
Song
::
UpdateFileInArchive
(
ArchiveFile
&
archive
)
Song
::
UpdateFileInArchive
(
ArchiveFile
&
archive
)
noexcept
{
{
assert
(
parent
!=
nullptr
);
assert
(
parent
!=
nullptr
);
assert
(
parent
->
device
==
DEVICE_INARCHIVE
);
assert
(
parent
->
device
==
DEVICE_INARCHIVE
);
...
@@ -141,7 +142,7 @@ Song::UpdateFileInArchive(ArchiveFile &archive)
...
@@ -141,7 +142,7 @@ Song::UpdateFileInArchive(ArchiveFile &archive)
#endif
#endif
bool
bool
DetachedSong
::
LoadFile
(
Path
path
)
DetachedSong
::
LoadFile
(
Path
path
)
noexcept
{
{
FileInfo
fi
;
FileInfo
fi
;
if
(
!
GetFileInfo
(
path
,
fi
)
||
!
fi
.
IsRegular
())
if
(
!
GetFileInfo
(
path
,
fi
)
||
!
fi
.
IsRegular
())
...
@@ -157,7 +158,7 @@ DetachedSong::LoadFile(Path path)
...
@@ -157,7 +158,7 @@ DetachedSong::LoadFile(Path path)
}
}
bool
bool
DetachedSong
::
Update
()
DetachedSong
::
Update
()
noexcept
{
{
if
(
IsAbsoluteFile
())
{
if
(
IsAbsoluteFile
())
{
const
AllocatedPath
path_fs
=
const
AllocatedPath
path_fs
=
...
...
src/db/plugins/simple/Song.hxx
View file @
1e3f0650
...
@@ -109,17 +109,17 @@ struct Song {
...
@@ -109,17 +109,17 @@ struct Song {
*/
*/
gcc_malloc
gcc_malloc
static
Song
*
LoadFile
(
Storage
&
storage
,
const
char
*
name_utf8
,
static
Song
*
LoadFile
(
Storage
&
storage
,
const
char
*
name_utf8
,
Directory
&
parent
);
Directory
&
parent
)
noexcept
;
void
Free
();
void
Free
();
bool
UpdateFile
(
Storage
&
storage
);
bool
UpdateFile
(
Storage
&
storage
)
noexcept
;
#ifdef ENABLE_ARCHIVE
#ifdef ENABLE_ARCHIVE
static
Song
*
LoadFromArchive
(
ArchiveFile
&
archive
,
static
Song
*
LoadFromArchive
(
ArchiveFile
&
archive
,
const
char
*
name_utf8
,
const
char
*
name_utf8
,
Directory
&
parent
);
Directory
&
parent
)
noexcept
;
bool
UpdateFileInArchive
(
ArchiveFile
&
archive
);
bool
UpdateFileInArchive
(
ArchiveFile
&
archive
)
noexcept
;
#endif
#endif
/**
/**
...
...
test/test_translate_song.cxx
View file @
1e3f0650
...
@@ -121,7 +121,7 @@ DatabaseDetachSong(gcc_unused const Database &db,
...
@@ -121,7 +121,7 @@ DatabaseDetachSong(gcc_unused const Database &db,
}
}
bool
bool
DetachedSong
::
LoadFile
(
Path
path
)
DetachedSong
::
LoadFile
(
Path
path
)
noexcept
{
{
if
(
path
.
ToUTF8
()
==
uri1
)
{
if
(
path
.
ToUTF8
()
==
uri1
)
{
SetTag
(
MakeTag1a
());
SetTag
(
MakeTag1a
());
...
...
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