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
4b2bb883
Commit
4b2bb883
authored
Nov 12, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/upnp: add "noexcept"
parent
fb01e41e
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
41 additions
and
41 deletions
+41
-41
Object.cxx
src/db/plugins/upnp/Object.cxx
+1
-1
Object.hxx
src/db/plugins/upnp/Object.hxx
+1
-1
Slist.hxx
src/lib/curl/Slist.hxx
+1
-1
Action.hxx
src/lib/upnp/Action.hxx
+3
-3
Callback.hxx
src/lib/upnp/Callback.hxx
+3
-3
ClientInit.cxx
src/lib/upnp/ClientInit.cxx
+2
-2
ClientInit.hxx
src/lib/upnp/ClientInit.hxx
+1
-1
ContentDirectoryService.cxx
src/lib/upnp/ContentDirectoryService.cxx
+2
-2
ContentDirectoryService.hxx
src/lib/upnp/ContentDirectoryService.hxx
+2
-2
Device.cxx
src/lib/upnp/Device.cxx
+1
-1
Device.hxx
src/lib/upnp/Device.hxx
+1
-1
Discovery.cxx
src/lib/upnp/Discovery.cxx
+7
-7
Discovery.hxx
src/lib/upnp/Discovery.hxx
+10
-10
Init.cxx
src/lib/upnp/Init.cxx
+1
-1
Init.hxx
src/lib/upnp/Init.hxx
+1
-1
UniqueIxml.hxx
src/lib/upnp/UniqueIxml.hxx
+2
-2
ixmlwrap.cxx
src/lib/upnp/ixmlwrap.cxx
+1
-1
ixmlwrap.hxx
src/lib/upnp/ixmlwrap.hxx
+1
-1
No files found.
src/db/plugins/upnp/Object.cxx
View file @
4b2bb883
...
...
@@ -19,7 +19,7 @@
#include "Object.hxx"
UPnPDirObject
::~
UPnPDirObject
()
UPnPDirObject
::~
UPnPDirObject
()
noexcept
{
/* this destructor exists here just so it won't get inlined */
}
src/db/plugins/upnp/Object.hxx
View file @
4b2bb883
...
...
@@ -76,7 +76,7 @@ public:
UPnPDirObject
()
=
default
;
UPnPDirObject
(
UPnPDirObject
&&
)
=
default
;
~
UPnPDirObject
();
~
UPnPDirObject
()
noexcept
;
UPnPDirObject
&
operator
=
(
UPnPDirObject
&&
)
=
default
;
...
...
src/lib/curl/Slist.hxx
View file @
4b2bb883
...
...
@@ -41,7 +41,7 @@ class CurlSlist {
struct
curl_slist
*
head
=
nullptr
;
public
:
CurlSlist
()
noexcept
=
default
;
CurlSlist
()
=
default
;
CurlSlist
(
CurlSlist
&&
src
)
noexcept
:
head
(
std
::
exchange
(
src
.
head
,
nullptr
))
{}
...
...
src/lib/upnp/Action.hxx
View file @
4b2bb883
...
...
@@ -25,7 +25,7 @@
#include <upnp/upnptools.h>
static
inline
constexpr
unsigned
CountNameValuePairs
()
CountNameValuePairs
()
noexcept
{
return
0
;
}
...
...
@@ -33,7 +33,7 @@ CountNameValuePairs()
template
<
typename
...
Args
>
static
inline
constexpr
unsigned
CountNameValuePairs
(
gcc_unused
const
char
*
name
,
gcc_unused
const
char
*
value
,
Args
...
args
)
Args
...
args
)
noexcept
{
return
1
+
CountNameValuePairs
(
args
...);
}
...
...
@@ -45,7 +45,7 @@ CountNameValuePairs(gcc_unused const char *name, gcc_unused const char *value,
template
<
typename
...
Args
>
static
inline
IXML_Document
*
MakeActionHelper
(
const
char
*
action_name
,
const
char
*
service_type
,
Args
...
args
)
Args
...
args
)
noexcept
{
const
unsigned
n
=
CountNameValuePairs
(
args
...);
return
UpnpMakeAction
(
action_name
,
service_type
,
n
,
...
...
src/lib/upnp/Callback.hxx
View file @
4b2bb883
...
...
@@ -32,15 +32,15 @@ public:
* Pass this value as "cookie" pointer to libupnp asynchronous
* functions.
*/
void
*
GetUpnpCookie
()
{
void
*
GetUpnpCookie
()
noexcept
{
return
this
;
}
static
UpnpCallback
&
FromUpnpCookie
(
void
*
cookie
)
{
static
UpnpCallback
&
FromUpnpCookie
(
void
*
cookie
)
noexcept
{
return
*
(
UpnpCallback
*
)
cookie
;
}
virtual
int
Invoke
(
Upnp_EventType
et
,
void
*
evp
)
=
0
;
virtual
int
Invoke
(
Upnp_EventType
et
,
void
*
evp
)
noexcept
=
0
;
};
#endif
src/lib/upnp/ClientInit.cxx
View file @
4b2bb883
...
...
@@ -33,7 +33,7 @@ static unsigned upnp_client_ref;
static
UpnpClient_Handle
upnp_client_handle
;
static
int
UpnpClientCallback
(
Upnp_EventType
et
,
void
*
evp
,
void
*
cookie
)
UpnpClientCallback
(
Upnp_EventType
et
,
void
*
evp
,
void
*
cookie
)
noexcept
{
if
(
cookie
==
nullptr
)
/* this is the cookie passed to UpnpRegisterClient();
...
...
@@ -74,7 +74,7 @@ UpnpClientGlobalInit(UpnpClient_Handle &handle)
}
void
UpnpClientGlobalFinish
()
UpnpClientGlobalFinish
()
noexcept
{
{
const
std
::
lock_guard
<
Mutex
>
protect
(
upnp_client_init_mutex
);
...
...
src/lib/upnp/ClientInit.hxx
View file @
4b2bb883
...
...
@@ -28,6 +28,6 @@ void
UpnpClientGlobalInit
(
UpnpClient_Handle
&
handle
);
void
UpnpClientGlobalFinish
();
UpnpClientGlobalFinish
()
noexcept
;
#endif
src/lib/upnp/ContentDirectoryService.cxx
View file @
4b2bb883
...
...
@@ -28,7 +28,7 @@
#include "util/RuntimeError.hxx"
ContentDirectoryService
::
ContentDirectoryService
(
const
UPnPDevice
&
device
,
const
UPnPService
&
service
)
const
UPnPService
&
service
)
noexcept
:
m_actionURL
(
uri_apply_base
(
service
.
controlURL
,
device
.
URLBase
)),
m_serviceType
(
service
.
serviceType
),
m_deviceId
(
device
.
UDN
),
...
...
@@ -44,7 +44,7 @@ ContentDirectoryService::ContentDirectoryService(const UPnPDevice &device,
}
}
ContentDirectoryService
::~
ContentDirectoryService
()
ContentDirectoryService
::~
ContentDirectoryService
()
noexcept
{
/* this destructor exists here just so it won't get inlined */
}
...
...
src/lib/upnp/ContentDirectoryService.hxx
View file @
4b2bb883
...
...
@@ -65,12 +65,12 @@ public:
* UPnPDeviceDirectory::GetDirectories()
*/
ContentDirectoryService
(
const
UPnPDevice
&
device
,
const
UPnPService
&
service
);
const
UPnPService
&
service
)
noexcept
;
/** An empty one */
ContentDirectoryService
()
=
default
;
~
ContentDirectoryService
();
~
ContentDirectoryService
()
noexcept
;
/** Read a container's children list into dirbuf.
*
...
...
src/lib/upnp/Device.cxx
View file @
4b2bb883
...
...
@@ -24,7 +24,7 @@
#include <string.h>
UPnPDevice
::~
UPnPDevice
()
UPnPDevice
::~
UPnPDevice
()
noexcept
{
/* this destructor exists here just so it won't get inlined */
}
...
...
src/lib/upnp/Device.hxx
View file @
4b2bb883
...
...
@@ -73,7 +73,7 @@ public:
UPnPDevice
(
UPnPDevice
&&
)
=
default
;
UPnPDevice
&
operator
=
(
UPnPDevice
&&
)
=
default
;
~
UPnPDevice
();
~
UPnPDevice
()
noexcept
;
/** Build device from xml description downloaded from discovery
* @param url where the description came from
...
...
src/lib/upnp/Discovery.cxx
View file @
4b2bb883
...
...
@@ -45,7 +45,7 @@ UPnPDeviceDirectory::Downloader::Downloader(UPnPDeviceDirectory &_parent,
}
void
UPnPDeviceDirectory
::
Downloader
::
Destroy
()
UPnPDeviceDirectory
::
Downloader
::
Destroy
()
noexcept
{
parent
.
downloaders
.
erase_and_dispose
(
parent
.
downloaders
.
iterator_to
(
*
this
),
DeleteDisposer
());
...
...
@@ -170,7 +170,7 @@ UPnPDeviceDirectory::LockRemove(const std::string &id)
}
inline
int
UPnPDeviceDirectory
::
OnAlive
(
Upnp_Discovery
*
disco
)
UPnPDeviceDirectory
::
OnAlive
(
Upnp_Discovery
*
disco
)
noexcept
{
if
(
isMSDevice
(
disco
->
DeviceType
)
||
isCDService
(
disco
->
ServiceType
))
{
...
...
@@ -192,7 +192,7 @@ UPnPDeviceDirectory::OnAlive(Upnp_Discovery *disco)
}
inline
int
UPnPDeviceDirectory
::
OnByeBye
(
Upnp_Discovery
*
disco
)
UPnPDeviceDirectory
::
OnByeBye
(
Upnp_Discovery
*
disco
)
noexcept
{
if
(
isMSDevice
(
disco
->
DeviceType
)
||
isCDService
(
disco
->
ServiceType
))
{
...
...
@@ -208,7 +208,7 @@ UPnPDeviceDirectory::OnByeBye(Upnp_Discovery *disco)
// Example: ContentDirectories appearing and disappearing from the network
// We queue a task for our worker thread(s)
int
UPnPDeviceDirectory
::
Invoke
(
Upnp_EventType
et
,
void
*
evp
)
UPnPDeviceDirectory
::
Invoke
(
Upnp_EventType
et
,
void
*
evp
)
noexcept
{
switch
(
et
)
{
case
UPNP_DISCOVERY_SEARCH_RESULT
:
...
...
@@ -251,13 +251,13 @@ UPnPDeviceDirectory::ExpireDevices()
UPnPDeviceDirectory
::
UPnPDeviceDirectory
(
EventLoop
&
event_loop
,
UpnpClient_Handle
_handle
,
UPnPDiscoveryListener
*
_listener
)
UPnPDiscoveryListener
*
_listener
)
noexcept
:
curl
(
event_loop
),
handle
(
_handle
),
listener
(
_listener
)
{
}
UPnPDeviceDirectory
::~
UPnPDeviceDirectory
()
UPnPDeviceDirectory
::~
UPnPDeviceDirectory
()
noexcept
{
BlockingCall
(
GetEventLoop
(),
[
this
](){
downloaders
.
clear_and_dispose
(
DeleteDisposer
());
...
...
@@ -265,7 +265,7 @@ UPnPDeviceDirectory::~UPnPDeviceDirectory()
}
inline
EventLoop
&
UPnPDeviceDirectory
::
GetEventLoop
()
UPnPDeviceDirectory
::
GetEventLoop
()
noexcept
{
return
curl
->
GetEventLoop
();
}
...
...
src/lib/upnp/Discovery.hxx
View file @
4b2bb883
...
...
@@ -73,7 +73,7 @@ class UPnPDeviceDirectory final : UpnpCallback {
ContentDirectoryDescriptor
(
std
::
string
&&
_id
,
std
::
chrono
::
steady_clock
::
time_point
last
,
std
::
chrono
::
steady_clock
::
duration
exp
)
std
::
chrono
::
steady_clock
::
duration
exp
)
noexcept
:
id
(
std
::
move
(
_id
)),
expires
(
last
+
exp
+
std
::
chrono
::
seconds
(
20
))
{}
...
...
@@ -102,14 +102,14 @@ class UPnPDeviceDirectory final : UpnpCallback {
Downloader
(
UPnPDeviceDirectory
&
_parent
,
const
Upnp_Discovery
&
disco
);
void
Start
()
{
void
Start
()
noexcept
{
defer_start_event
.
Schedule
();
}
void
Destroy
();
void
Destroy
()
noexcept
;
private
:
void
OnDeferredStart
()
{
void
OnDeferredStart
()
noexcept
{
request
.
Start
();
}
...
...
@@ -147,13 +147,13 @@ class UPnPDeviceDirectory final : UpnpCallback {
public
:
UPnPDeviceDirectory
(
EventLoop
&
event_loop
,
UpnpClient_Handle
_handle
,
UPnPDiscoveryListener
*
_listener
=
nullptr
);
~
UPnPDeviceDirectory
();
UPnPDiscoveryListener
*
_listener
=
nullptr
)
noexcept
;
~
UPnPDeviceDirectory
()
noexcept
;
UPnPDeviceDirectory
(
const
UPnPDeviceDirectory
&
)
=
delete
;
UPnPDeviceDirectory
&
operator
=
(
const
UPnPDeviceDirectory
&
)
=
delete
;
EventLoop
&
GetEventLoop
();
EventLoop
&
GetEventLoop
()
noexcept
;
void
Start
();
...
...
@@ -180,11 +180,11 @@ private:
void
LockAdd
(
ContentDirectoryDescriptor
&&
d
);
void
LockRemove
(
const
std
::
string
&
id
);
int
OnAlive
(
Upnp_Discovery
*
disco
);
int
OnByeBye
(
Upnp_Discovery
*
disco
);
int
OnAlive
(
Upnp_Discovery
*
disco
)
noexcept
;
int
OnByeBye
(
Upnp_Discovery
*
disco
)
noexcept
;
/* virtual methods from class UpnpCallback */
virtual
int
Invoke
(
Upnp_EventType
et
,
void
*
evp
)
override
;
int
Invoke
(
Upnp_EventType
et
,
void
*
evp
)
noexcept
override
;
};
...
...
src/lib/upnp/Init.cxx
View file @
4b2bb883
...
...
@@ -57,7 +57,7 @@ UpnpGlobalInit()
}
void
UpnpGlobalFinish
()
UpnpGlobalFinish
()
noexcept
{
const
std
::
lock_guard
<
Mutex
>
protect
(
upnp_init_mutex
);
...
...
src/lib/upnp/Init.hxx
View file @
4b2bb883
...
...
@@ -26,6 +26,6 @@ void
UpnpGlobalInit
();
void
UpnpGlobalFinish
();
UpnpGlobalFinish
()
noexcept
;
#endif
src/lib/upnp/UniqueIxml.hxx
View file @
4b2bb883
...
...
@@ -25,11 +25,11 @@
#include <memory>
struct
UpnpIxmlDeleter
{
void
operator
()(
IXML_Document
*
doc
)
{
void
operator
()(
IXML_Document
*
doc
)
noexcept
{
ixmlDocument_free
(
doc
);
}
void
operator
()(
IXML_NodeList
*
nl
)
{
void
operator
()(
IXML_NodeList
*
nl
)
noexcept
{
ixmlNodeList_free
(
nl
);
}
};
...
...
src/lib/upnp/ixmlwrap.cxx
View file @
4b2bb883
...
...
@@ -21,7 +21,7 @@
namespace
ixmlwrap
{
const
char
*
getFirstElementValue
(
IXML_Document
*
doc
,
const
char
*
name
)
getFirstElementValue
(
IXML_Document
*
doc
,
const
char
*
name
)
noexcept
{
UniqueIxmlNodeList
nodes
(
ixmlDocument_getElementsByTagName
(
doc
,
name
));
if
(
!
nodes
)
...
...
src/lib/upnp/ixmlwrap.hxx
View file @
4b2bb883
...
...
@@ -28,7 +28,7 @@ namespace ixmlwrap {
* contain a text node
*/
const
char
*
getFirstElementValue
(
IXML_Document
*
doc
,
const
char
*
name
);
const
char
*
name
)
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