Fix clang-tidy issues

Not sure why travis saw these since I didn't change anything there but
fixing these is also good.
This commit is contained in:
asarium committed 2020-06-06 23:24:08 +02:00
1 parent 016c07dc3a
commit 614a636ed5
11 files changed
+16 -13

No files matched your search

+3 -2
View File
@@ -18,6 +18,7 @@
#include <ctime>
#include <stdexcept>
#include <memory>
#include <utility>
#define CF_EOF (-1)
@@ -437,11 +438,11 @@ namespace cfile
{
}
explicit cfile_error(const std::string &excuse) : m_excuse(excuse)
explicit cfile_error(std::string excuse) : m_excuse(std::move(excuse))
{
}
~cfile_error() noexcept override {}
~cfile_error() noexcept override = default;
const char *what() const noexcept override {
return m_excuse.c_str();
+2 -1
View File
@@ -2,7 +2,8 @@
namespace executor {
Executor::Callback runInContext(std::shared_ptr<IExecutionContext> context, IExecutionContext::Callback func)
Executor::Callback runInContext(const std::shared_ptr<IExecutionContext>& context,
const IExecutionContext::Callback& func)
{
return [context, func]() {
const auto ctxState = context->determineContextState();
+2 -1
View File
@@ -41,6 +41,7 @@ class IExecutionContext {
* @param func The function to wrap
* @return An executor work item
*/
Executor::Callback runInContext(std::shared_ptr<IExecutionContext> context, IExecutionContext::Callback func);
Executor::Callback runInContext(const std::shared_ptr<IExecutionContext>& context,
const IExecutionContext::Callback& func);
} // namespace executor
+1
View File
@@ -233,6 +233,7 @@ opengl_shader_t::opengl_shader_t() : shader(SDR_TYPE_NONE), flags(0), flags2(0)
opengl_shader_t::opengl_shader_t(opengl_shader_t&& other) noexcept {
*this = std::move(other);
}
// NOLINTNEXTLINE(misc-unconventional-assign-operator)
opengl_shader_t& opengl_shader_t::operator=(opengl_shader_t&& other) noexcept {
// VS2013 doesn't support implicit move constructors so we need to explicitly declare it
shader = other.shader;
+1 -1
View File
@@ -14,7 +14,7 @@ void initialize();
class FFmpegException: public std::runtime_error {
public:
explicit FFmpegException(const std::string& msg) : std::runtime_error(msg) {}
~FFmpegException() noexcept override {}
~FFmpegException() noexcept override = default;
};
}
+1 -1
View File
@@ -352,7 +352,7 @@ namespace parse
{
public:
explicit ParseException(const std::string& msg) : std::runtime_error(msg) {}
~ParseException() noexcept override {}
~ParseException() noexcept override = default;
};
/**
+1 -1
View File
@@ -94,7 +94,7 @@ class ApngException : public std::runtime_error
{
public:
explicit ApngException(const std::string& msg) : std::runtime_error(msg) {}
~ApngException() noexcept override {}
~ApngException() noexcept override = default;
};
}
+1 -1
View File
@@ -829,7 +829,7 @@ ADE_FUNC(createShip,
{
const char* name = nullptr;
int sclass = -1;
matrix_h* orient = NULL;
matrix_h* orient = nullptr;
vec3d pos = vmd_zero_vector;
ade_get_args(L, "|sooo", &name, l_Shipclass.Get(&sclass), l_Matrix.GetPtr(&orient), l_Vector.Get(&pos));
+2 -2
View File
@@ -40,8 +40,8 @@ ADE_FUNC(schedule,
}
// Post the function onto the executor with a wrapper to convert the Lua value to the proper enum
executor->getExecutor()->post([func]() {
const auto ret = func();
executor->getExecutor()->post([L, func]() {
const auto ret = func(L);
if (ret.empty()) {
return executor::Executor::CallbackResult::Done;
+1 -2
View File
@@ -17,8 +17,7 @@ class ArgumentException: public LuaException {
ArgumentException(const std::string& message = "Argument Error!") noexcept : LuaException(message) {
}
~ArgumentException() noexcept override {
}
~ArgumentException() noexcept override = default;
};
class opt {};
+1 -1
View File
@@ -33,7 +33,7 @@ class sync_queue_is_closed : public std::runtime_error
{
public:
sync_queue_is_closed() : std::runtime_error("Sync Bounded Queue is closed") {}
~sync_queue_is_closed() noexcept override {}
~sync_queue_is_closed() noexcept override = default;
};
template <typename ValueType>