fix for clang 5 unused lambda capture errors (nw)

This commit is contained in:
smf- 2017-09-24 13:45:58 +01:00
parent ba580ae3bf
commit bcb4be3a5d
7 changed files with 13 additions and 13 deletions

View File

@ -272,7 +272,7 @@ http_manager::http_manager(bool active, short port, const char *root)
auto& endpoint = m_wsserver->m_endpoint["/"]; auto& endpoint = m_wsserver->m_endpoint["/"];
m_server->on_get([this, root](auto response, auto request) { m_server->on_get([root](auto response, auto request) {
std::string doc_root = root; std::string doc_root = root;
auto request_impl = std::make_shared<http_request_impl>(request); auto request_impl = std::make_shared<http_request_impl>(request);

View File

@ -224,7 +224,7 @@ void info_xml_creator::output(FILE *out, std::vector<std::string> const &pattern
driver_enumerator drivlist(m_lookup_options); driver_enumerator drivlist(m_lookup_options);
std::vector<bool> matched(patterns.size(), false); std::vector<bool> matched(patterns.size(), false);
size_t exact_matches = 0; size_t exact_matches = 0;
auto const included = [&patterns, &drivlist, &matched, &exact_matches] (char const *const name) -> bool auto const included = [&patterns, &matched, &exact_matches] (char const *const name) -> bool
{ {
if (patterns.empty()) if (patterns.empty())
return true; return true;

View File

@ -923,7 +923,7 @@ void lua_engine::initialize()
*/ */
emu.new_usertype<context>("thread", sol::call_constructor, sol::constructors<sol::types<>>(), emu.new_usertype<context>("thread", sol::call_constructor, sol::constructors<sol::types<>>(),
"start", [this](context &ctx, const char *scr) { "start", [](context &ctx, const char *scr) {
std::string script(scr); std::string script(scr);
if(ctx.busy) if(ctx.busy)
return false; return false;
@ -962,13 +962,13 @@ void lua_engine::initialize()
th.detach(); th.detach();
return true; return true;
}, },
"continue", [this](context &ctx, const char *val) { "continue", [](context &ctx, const char *val) {
if(!ctx.yield) if(!ctx.yield)
return; return;
ctx.result = val; ctx.result = val;
ctx.sync.notify_all(); ctx.sync.notify_all();
}, },
"result", sol::property([this](context &ctx) -> std::string { "result", sol::property([](context &ctx) -> std::string {
if(ctx.busy && !ctx.yield) if(ctx.busy && !ctx.yield)
return ""; return "";
return ctx.result; return ctx.result;
@ -1008,7 +1008,7 @@ void lua_engine::initialize()
} }
return sol::make_object(sol(), ret); return sol::make_object(sol(), ret);
}, },
"read_block", [this](save_item &item, int offset, sol::buffer *buff) { "read_block", [](save_item &item, int offset, sol::buffer *buff) {
if(!item.base || ((offset + buff->get_len()) > (item.size * item.count))) if(!item.base || ((offset + buff->get_len()) > (item.size * item.count)))
buff->set_len(0); buff->set_len(0);
else else
@ -1267,7 +1267,7 @@ void lua_engine::initialize()
* debug:wplist(space)[] - table of watchpoints * debug:wplist(space)[] - table of watchpoints
*/ */
sol().registry().new_usertype<device_debug>("device_debug", "new", sol::no_constructor, sol().registry().new_usertype<device_debug>("device_debug", "new", sol::no_constructor,
"step", [this](device_debug &dev, sol::object num) { "step", [](device_debug &dev, sol::object num) {
int steps = 1; int steps = 1;
if(num.is<int>()) if(num.is<int>())
steps = num.as<int>(); steps = num.as<int>();

View File

@ -175,7 +175,7 @@ void menu_load_save_state_base::populate(float &customtop, float &custombottom)
std::sort( std::sort(
m_entries_vec.begin(), m_entries_vec.begin(),
m_entries_vec.end(), m_entries_vec.end(),
[this](const file_entry *a, const file_entry *b) [](const file_entry *a, const file_entry *b)
{ {
return a->last_modified() > b->last_modified(); return a->last_modified() > b->last_modified();
}); });

View File

@ -220,7 +220,7 @@ namespace webpp {
///Use this function if you need to recursively send parts of a longer message ///Use this function if you need to recursively send parts of a longer message
void send(const std::shared_ptr<Response> &response, const std::function<void(const std::error_code&)>& callback=nullptr) const { void send(const std::shared_ptr<Response> &response, const std::function<void(const std::error_code&)>& callback=nullptr) const {
asio::async_write(*response->socket(), response->m_streambuf, [this, response, callback](const std::error_code& ec, size_t /*bytes_transferred*/) { asio::async_write(*response->socket(), response->m_streambuf, [response, callback](const std::error_code& ec, size_t /*bytes_transferred*/) {
if(callback) if(callback)
callback(ec); callback(ec);
}); });

View File

@ -282,7 +282,7 @@ namespace webpp {
else else
header_stream->put(static_cast<unsigned char>(length)); header_stream->put(static_cast<unsigned char>(length));
connection->strand.post([this, connection, header_stream, message_stream, callback]() { connection->strand.post([connection, header_stream, message_stream, callback]() {
connection->send_queue.emplace_back(header_stream, message_stream, callback); connection->send_queue.emplace_back(header_stream, message_stream, callback);
if(connection->send_queue.size()==1) if(connection->send_queue.size()==1)
connection->send_from_queue(connection); connection->send_from_queue(connection);
@ -493,7 +493,7 @@ namespace webpp {
//Close connection if unmasked message from client (protocol error) //Close connection if unmasked message from client (protocol error)
if(first_bytes[1]<128) { if(first_bytes[1]<128) {
const std::string reason("message from client not masked"); const std::string reason("message from client not masked");
send_close(connection, 1002, reason, [this, connection](const std::error_code& /*ec*/) {}); send_close(connection, 1002, reason, [connection](const std::error_code& /*ec*/) {});
connection_close(connection, endpoint, 1002, reason); connection_close(connection, endpoint, 1002, reason);
return; return;
} }
@ -586,7 +586,7 @@ namespace webpp {
} }
auto reason=message->string(); auto reason=message->string();
send_close(connection, status, reason, [this, connection](const std::error_code& /*ec*/) {}); send_close(connection, status, reason, [connection](const std::error_code& /*ec*/) {});
connection_close(connection, endpoint, status, reason); connection_close(connection, endpoint, status, reason);
return; return;
} }

View File

@ -182,7 +182,7 @@ library::modulelist::iterator library::find(const std::string &module_name)
return std::find_if( return std::find_if(
m_modules.begin(), m_modules.begin(),
m_modules.end(), m_modules.end(),
[this, module_name](std::unique_ptr<imgtool_module> &module) { return !module_name.compare(module->name); }); [module_name](std::unique_ptr<imgtool_module> &module) { return !module_name.compare(module->name); });
} }