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
0c48b8d0
Commit
0c48b8d0
authored
May 21, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/simple/Song: add `noexcept`
parent
8462559b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
Song.cxx
src/db/plugins/simple/Song.cxx
+9
-7
Song.hxx
src/db/plugins/simple/Song.hxx
+7
-7
No files found.
src/db/plugins/simple/Song.cxx
View file @
0c48b8d0
/*
* Copyright 2003-201
8
The Music Player Daemon Project
* Copyright 2003-201
9
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -27,18 +27,20 @@
#include <assert.h>
#include <string.h>
inline
Song
::
Song
(
const
char
*
_uri
,
size_t
uri_length
,
Directory
&
_parent
)
inline
Song
::
Song
(
const
char
*
_uri
,
size_t
uri_length
,
Directory
&
_parent
)
noexcept
:
parent
(
&
_parent
)
{
memcpy
(
uri
,
_uri
,
uri_length
+
1
);
}
inline
Song
::~
Song
()
inline
Song
::~
Song
()
noexcept
{
}
static
Song
*
song_alloc
(
const
char
*
uri
,
Directory
&
parent
)
song_alloc
(
const
char
*
uri
,
Directory
&
parent
)
noexcept
{
size_t
uri_length
;
...
...
@@ -52,7 +54,7 @@ song_alloc(const char *uri, Directory &parent)
}
Song
*
Song
::
NewFrom
(
DetachedSong
&&
other
,
Directory
&
parent
)
Song
::
NewFrom
(
DetachedSong
&&
other
,
Directory
&
parent
)
noexcept
{
Song
*
song
=
song_alloc
(
other
.
GetURI
(),
parent
);
song
->
tag
=
std
::
move
(
other
.
WritableTag
());
...
...
@@ -63,13 +65,13 @@ Song::NewFrom(DetachedSong &&other, Directory &parent)
}
Song
*
Song
::
NewFile
(
const
char
*
path
,
Directory
&
parent
)
Song
::
NewFile
(
const
char
*
path
,
Directory
&
parent
)
noexcept
{
return
song_alloc
(
path
,
parent
);
}
void
Song
::
Free
()
Song
::
Free
()
noexcept
{
DeleteVarSize
(
this
);
}
...
...
src/db/plugins/simple/Song.hxx
View file @
0c48b8d0
/*
* Copyright 2003-201
8
The Music Player Daemon Project
* Copyright 2003-201
9
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -46,7 +46,7 @@ struct Song {
typedef
boost
::
intrusive
::
list_member_hook
<
LinkMode
>
Hook
;
struct
Disposer
{
void
operator
()(
Song
*
song
)
const
{
void
operator
()(
Song
*
song
)
const
noexcept
{
song
->
Free
();
}
};
...
...
@@ -98,15 +98,15 @@ struct Song {
*/
char
uri
[
sizeof
(
int
)];
Song
(
const
char
*
_uri
,
size_t
uri_length
,
Directory
&
parent
);
~
Song
();
Song
(
const
char
*
_uri
,
size_t
uri_length
,
Directory
&
parent
)
noexcept
;
~
Song
()
noexcept
;
gcc_malloc
gcc_returns_nonnull
static
Song
*
NewFrom
(
DetachedSong
&&
other
,
Directory
&
parent
);
static
Song
*
NewFrom
(
DetachedSong
&&
other
,
Directory
&
parent
)
noexcept
;
/** allocate a new song with a local file name */
gcc_malloc
gcc_returns_nonnull
static
Song
*
NewFile
(
const
char
*
path_utf8
,
Directory
&
parent
);
static
Song
*
NewFile
(
const
char
*
path_utf8
,
Directory
&
parent
)
noexcept
;
/**
* allocate a new song structure with a local file name and attempt to
...
...
@@ -117,7 +117,7 @@ struct Song {
static
Song
*
LoadFile
(
Storage
&
storage
,
const
char
*
name_utf8
,
Directory
&
parent
)
noexcept
;
void
Free
();
void
Free
()
noexcept
;
bool
UpdateFile
(
Storage
&
storage
)
noexcept
;
...
...
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