*: add "noexcept" to many, many function prototypes

This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
This commit is contained in:
Max Kellermann
2017-05-08 14:44:49 +02:00
parent ac2e4e593d
commit 71f0ed8b74
272 changed files with 873 additions and 846 deletions

View File

@@ -34,7 +34,7 @@ extern "C" {
gcc_const
static LogLevel
FfmpegImportLogLevel(int level)
FfmpegImportLogLevel(int level) noexcept
{
if (level <= AV_LOG_FATAL)
return LogLevel::ERROR;

View File

@@ -41,7 +41,7 @@ extern "C" {
*/
gcc_const
static inline double
FfmpegTimeToDouble(int64_t t, const AVRational time_base)
FfmpegTimeToDouble(int64_t t, const AVRational time_base) noexcept
{
assert(t != (int64_t)AV_NOPTS_VALUE);
@@ -64,7 +64,7 @@ RatioToAVRational()
*/
gcc_const
static inline SongTime
FromFfmpegTime(int64_t t, const AVRational time_base)
FromFfmpegTime(int64_t t, const AVRational time_base) noexcept
{
assert(t != (int64_t)AV_NOPTS_VALUE);
@@ -77,7 +77,7 @@ FromFfmpegTime(int64_t t, const AVRational time_base)
*/
gcc_const
static inline SignedSongTime
FromFfmpegTimeChecked(int64_t t, const AVRational time_base)
FromFfmpegTimeChecked(int64_t t, const AVRational time_base) noexcept
{
return t != (int64_t)AV_NOPTS_VALUE
? SignedSongTime(FromFfmpegTime(t, time_base))
@@ -89,7 +89,7 @@ FromFfmpegTimeChecked(int64_t t, const AVRational time_base)
*/
gcc_const
static inline int64_t
ToFfmpegTime(SongTime t, const AVRational time_base)
ToFfmpegTime(SongTime t, const AVRational time_base) noexcept
{
return av_rescale_q(t.count(),
RatioToAVRational<SongTime::period>(),