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
daeb7ae9
Commit
daeb7ae9
authored
7 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/InputStream: add "noexcept"
parent
82a79565
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
33 deletions
+34
-33
IcyInputStream.cxx
src/input/IcyInputStream.cxx
+3
-3
IcyInputStream.hxx
src/input/IcyInputStream.hxx
+5
-5
Init.cxx
src/input/Init.cxx
+2
-1
Init.hxx
src/input/Init.hxx
+1
-1
InputStream.cxx
src/input/InputStream.cxx
+5
-5
InputStream.hxx
src/input/InputStream.hxx
+10
-10
ProxyInputStream.cxx
src/input/ProxyInputStream.cxx
+3
-3
ProxyInputStream.hxx
src/input/ProxyInputStream.hxx
+3
-3
RewindInputPlugin.cxx
src/input/plugins/RewindInputPlugin.cxx
+2
-2
No files found.
src/input/IcyInputStream.cxx
View file @
daeb7ae9
...
...
@@ -21,15 +21,15 @@
#include "IcyInputStream.hxx"
#include "tag/Tag.hxx"
IcyInputStream
::
IcyInputStream
(
InputStream
*
_input
)
IcyInputStream
::
IcyInputStream
(
InputStream
*
_input
)
noexcept
:
ProxyInputStream
(
_input
)
{
}
IcyInputStream
::~
IcyInputStream
()
=
default
;
IcyInputStream
::~
IcyInputStream
()
noexcept
=
default
;
void
IcyInputStream
::
Update
()
IcyInputStream
::
Update
()
noexcept
{
ProxyInputStream
::
Update
();
...
...
This diff is collapsed.
Click to expand it.
src/input/IcyInputStream.hxx
View file @
daeb7ae9
...
...
@@ -47,22 +47,22 @@ class IcyInputStream final : public ProxyInputStream {
offset_type
override_offset
=
0
;
public
:
IcyInputStream
(
InputStream
*
_input
);
virtual
~
IcyInputStream
();
IcyInputStream
(
InputStream
*
_input
)
noexcept
;
virtual
~
IcyInputStream
()
noexcept
;
IcyInputStream
(
const
IcyInputStream
&
)
=
delete
;
IcyInputStream
&
operator
=
(
const
IcyInputStream
&
)
=
delete
;
void
Enable
(
size_t
_data_size
)
{
void
Enable
(
size_t
_data_size
)
noexcept
{
parser
.
Start
(
_data_size
);
}
bool
IsEnabled
()
const
{
bool
IsEnabled
()
const
noexcept
{
return
parser
.
IsDefined
();
}
/* virtual methods from InputStream */
void
Update
()
override
;
void
Update
()
noexcept
override
;
std
::
unique_ptr
<
Tag
>
ReadTag
()
override
;
size_t
Read
(
void
*
ptr
,
size_t
size
)
override
;
};
...
...
This diff is collapsed.
Click to expand it.
src/input/Init.cxx
View file @
daeb7ae9
...
...
@@ -69,7 +69,8 @@ input_stream_global_init(EventLoop &event_loop)
}
}
void
input_stream_global_finish
(
void
)
void
input_stream_global_finish
()
noexcept
{
input_plugins_for_each_enabled
(
plugin
)
if
(
plugin
->
finish
!=
nullptr
)
...
...
This diff is collapsed.
Click to expand it.
src/input/Init.hxx
View file @
daeb7ae9
...
...
@@ -32,6 +32,6 @@ input_stream_global_init(EventLoop &event_loop);
* Deinitializes this library and all #InputStream implementations.
*/
void
input_stream_global_finish
();
input_stream_global_finish
()
noexcept
;
#endif
This diff is collapsed.
Click to expand it.
src/input/InputStream.cxx
View file @
daeb7ae9
...
...
@@ -27,7 +27,7 @@
#include <assert.h>
InputStream
::~
InputStream
()
InputStream
::~
InputStream
()
noexcept
{
}
...
...
@@ -37,12 +37,12 @@ InputStream::Check()
}
void
InputStream
::
Update
()
InputStream
::
Update
()
noexcept
{
}
void
InputStream
::
SetReady
()
InputStream
::
SetReady
()
noexcept
{
assert
(
!
ready
);
...
...
@@ -51,7 +51,7 @@ InputStream::SetReady()
}
void
InputStream
::
WaitReady
()
InputStream
::
WaitReady
()
noexcept
{
while
(
true
)
{
Update
();
...
...
@@ -63,7 +63,7 @@ InputStream::WaitReady()
}
void
InputStream
::
LockWaitReady
()
InputStream
::
LockWaitReady
()
noexcept
{
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
WaitReady
();
...
...
This diff is collapsed.
Click to expand it.
src/input/InputStream.hxx
View file @
daeb7ae9
...
...
@@ -107,7 +107,7 @@ public:
*
* The caller must not lock the mutex.
*/
virtual
~
InputStream
();
virtual
~
InputStream
()
noexcept
;
/**
* Opens a new input stream. You may not access it until the "ready"
...
...
@@ -138,15 +138,15 @@ public:
*
* No lock necessary for this method.
*/
const
char
*
GetURI
()
const
{
const
char
*
GetURI
()
const
noexcept
{
return
uri
.
c_str
();
}
void
Lock
()
{
void
Lock
()
noexcept
{
mutex
.
lock
();
}
void
Unlock
()
{
void
Unlock
()
noexcept
{
mutex
.
unlock
();
}
...
...
@@ -160,9 +160,9 @@ public:
* Update the public attributes. Call before accessing attributes
* such as "ready" or "offset".
*/
virtual
void
Update
();
virtual
void
Update
()
noexcept
;
void
SetReady
();
void
SetReady
()
noexcept
;
/**
* Return whether the stream is ready for reading and whether
...
...
@@ -174,13 +174,13 @@ public:
return
ready
;
}
void
WaitReady
();
void
WaitReady
()
noexcept
;
/**
* Wrapper for WaitReady() which locks and unlocks the mutex;
* the caller must not be holding it already.
*/
void
LockWaitReady
();
void
LockWaitReady
()
noexcept
;
gcc_pure
bool
HasMimeType
()
const
noexcept
{
...
...
@@ -201,13 +201,13 @@ public:
}
gcc_nonnull_all
void
SetMimeType
(
const
char
*
_mime
)
{
void
SetMimeType
(
const
char
*
_mime
)
noexcept
{
assert
(
!
ready
);
mime
=
_mime
;
}
void
SetMimeType
(
std
::
string
&&
_mime
)
{
void
SetMimeType
(
std
::
string
&&
_mime
)
noexcept
{
assert
(
!
ready
);
mime
=
std
::
move
(
_mime
);
...
...
This diff is collapsed.
Click to expand it.
src/input/ProxyInputStream.cxx
View file @
daeb7ae9
...
...
@@ -21,11 +21,11 @@
#include "ProxyInputStream.hxx"
#include "tag/Tag.hxx"
ProxyInputStream
::
ProxyInputStream
(
InputStream
*
_input
)
ProxyInputStream
::
ProxyInputStream
(
InputStream
*
_input
)
noexcept
:
InputStream
(
_input
->
GetURI
(),
_input
->
mutex
,
_input
->
cond
),
input
(
*
_input
)
{}
ProxyInputStream
::~
ProxyInputStream
()
ProxyInputStream
::~
ProxyInputStream
()
noexcept
{
delete
&
input
;
}
...
...
@@ -57,7 +57,7 @@ ProxyInputStream::Check()
}
void
ProxyInputStream
::
Update
()
ProxyInputStream
::
Update
()
noexcept
{
input
.
Update
();
CopyAttributes
();
...
...
This diff is collapsed.
Click to expand it.
src/input/ProxyInputStream.hxx
View file @
daeb7ae9
...
...
@@ -35,16 +35,16 @@ protected:
public
:
gcc_nonnull_all
ProxyInputStream
(
InputStream
*
_input
);
ProxyInputStream
(
InputStream
*
_input
)
noexcept
;
virtual
~
ProxyInputStream
();
virtual
~
ProxyInputStream
()
noexcept
;
ProxyInputStream
(
const
ProxyInputStream
&
)
=
delete
;
ProxyInputStream
&
operator
=
(
const
ProxyInputStream
&
)
=
delete
;
/* virtual methods from InputStream */
void
Check
()
override
;
void
Update
()
override
;
void
Update
()
noexcept
override
;
void
Seek
(
offset_type
new_offset
)
override
;
bool
IsEOF
()
noexcept
override
;
std
::
unique_ptr
<
Tag
>
ReadTag
()
override
;
...
...
This diff is collapsed.
Click to expand it.
src/input/plugins/RewindInputPlugin.cxx
View file @
daeb7ae9
...
...
@@ -53,7 +53,7 @@ public:
/* virtual methods from InputStream */
void
Update
()
override
{
void
Update
()
noexcept
override
{
if
(
!
ReadingFromBuffer
())
ProxyInputStream
::
Update
();
}
...
...
@@ -70,7 +70,7 @@ private:
* Are we currently reading from the buffer, and does the
* buffer contain more data for the next read operation?
*/
bool
ReadingFromBuffer
()
const
{
bool
ReadingFromBuffer
()
const
noexcept
{
return
tail
>
0
&&
offset
<
input
.
GetOffset
();
}
};
...
...
This diff is collapsed.
Click to expand it.
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