-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to C++17. Update sol2 to 3.3.0. Fix bug with reading Set values from Lua scripts. #6279
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
59b531f
Migrate to C++17. Update sol2 to 3.3.0.
SiarheiFedartsou 5cd1f85
Merge branch 'master' into sf-cpp-17
SiarheiFedartsou 8dc0214
Migrate to C++17. Update sol2 to 3.3.0.
SiarheiFedartsou ef66c0a
Migrate to C++17. Update sol2 to 3.3.0.
SiarheiFedartsou b358000
Migrate to C++17. Update sol2 to 3.3.0.
SiarheiFedartsou f9ccc0c
Migrate to C++17. Update sol2 to 3.3.0.
SiarheiFedartsou 55a0b74
Migrate to C++17. Update sol2 to 3.3.0.
SiarheiFedartsou ddd8fe6
Migrate to C++17. Update sol2 to 3.3.0.
SiarheiFedartsou e53a5cf
Migrate to C++17. Update sol2 to 3.3.0.
SiarheiFedartsou 3ccd349
Migrate to C++17. Update sol2 to 3.3.0.
SiarheiFedartsou ef5c461
Merge branch 'master' into sf-cpp-17
mjjbell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
#include <mutex> | ||
#include <string> | ||
|
||
#include <sol.hpp> | ||
#include <sol/sol.hpp> | ||
|
||
namespace osrm | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -965,14 +965,10 @@ Sol2ScriptingEnvironment::GetStringListFromTable(const std::string &table_name) | |
auto &context = GetSol2Context(); | ||
BOOST_ASSERT(context.state.lua_state() != nullptr); | ||
std::vector<std::string> strings; | ||
if (!context.profile_table[table_name]) | ||
sol::optional<sol::table> table = context.profile_table[table_name]; | ||
if (table && table->valid()) | ||
{ | ||
return strings; | ||
} | ||
sol::table table = context.profile_table[table_name]; | ||
if (table.valid()) | ||
{ | ||
for (auto &&pair : table) | ||
for (auto &&pair : *table) | ||
{ | ||
strings.emplace_back(GetSetOrSequenceValue(pair)); | ||
} | ||
|
@@ -987,17 +983,13 @@ Sol2ScriptingEnvironment::GetStringListsFromTable(const std::string &table_name) | |
|
||
auto &context = GetSol2Context(); | ||
BOOST_ASSERT(context.state.lua_state() != nullptr); | ||
if (!context.profile_table[table_name]) | ||
{ | ||
return string_lists; | ||
} | ||
sol::table table = context.profile_table[table_name]; | ||
if (!table.valid()) | ||
sol::optional<sol::table> table = context.profile_table[table_name]; | ||
if (!table || !table->valid()) | ||
{ | ||
return string_lists; | ||
} | ||
|
||
for (const auto &pair : table) | ||
for (const auto &pair : *table) | ||
{ | ||
sol::table inner_table = pair.second; | ||
if (!inner_table.valid()) | ||
|
@@ -1191,14 +1183,14 @@ void LuaScriptingContext::ProcessNode(const osmium::Node &node, | |
{ | ||
case 4: | ||
case 3: | ||
node_function(profile_table, node, result, relations); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Otherwise it complained that |
||
node_function(profile_table, std::cref(node), result, relations); | ||
break; | ||
case 2: | ||
node_function(profile_table, node, result); | ||
node_function(profile_table, std::cref(node), result); | ||
break; | ||
case 1: | ||
case 0: | ||
node_function(node, result); | ||
node_function(std::cref(node), result); | ||
break; | ||
} | ||
} | ||
|
@@ -1213,14 +1205,14 @@ void LuaScriptingContext::ProcessWay(const osmium::Way &way, | |
{ | ||
case 4: | ||
case 3: | ||
way_function(profile_table, way, result, relations); | ||
way_function(profile_table, std::cref(way), std::ref(result), std::cref(relations)); | ||
break; | ||
case 2: | ||
way_function(profile_table, way, result); | ||
way_function(profile_table, std::cref(way), std::ref(result)); | ||
break; | ||
case 1: | ||
case 0: | ||
way_function(way, result); | ||
way_function(std::cref(way), std::ref(result)); | ||
break; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I maybe extract bug fix into separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to do so. It's not clear to me how https://github.com/Project-OSRM/osrm-backend/pull/6279/files#r920390451 is related to the bug, so would be good to separate it from the other changes to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjjbell please see #6285