Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
- CHANGED: Upgrade Cucumber-js to v12 [#7221](https://github.com/Project-OSRM/osrm-backend/pull/7221)
- CHANGED: Add libcap-setcap to alpine dockerfile [#7241](https://github.com/Project-OSRM/osrm-backend/issues/7241)
- FIXED: Minor misspellings found in source code, comments and documents [#7215](https://github.com/Project-OSRM/osrm-backend/pull/7215)
- Profile:
- FIXED: Use `cycleway:both` if available. [#6179](https://github.com/Project-OSRM/osrm-backend/issues/6179)
- FIXED: Correctly limit exclude classes to 7. [#7322](https://github.com/Project-OSRM/osrm-backend/pull/7322)

# 6.0.0
- Changes from 6.0.0 RC2: None
Expand Down
8 changes: 5 additions & 3 deletions include/extractor/class_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ namespace osrm::extractor
{

using ClassData = std::uint8_t;
constexpr ClassData INAVLID_CLASS_DATA = std::numeric_limits<ClassData>::max();
static const std::uint8_t MAX_CLASS_INDEX = 8 - 1;
static const std::uint8_t MAX_EXCLUDABLE_CLASSES = 8;
constexpr ClassData INVALID_CLASS_DATA = std::numeric_limits<ClassData>::max();
static const std::uint8_t MAX_CLASS_INDEX = 7 - 1;
// We can allow for 7 classes, so 0b0111_1111 when all would be set on an edge.
// Setting the MSB would mark it invalid.
static const std::uint8_t MAX_EXCLUDABLE_CLASSES = 7;

inline bool isSubset(const ClassData lhs, const ClassData rhs) { return (lhs & rhs) == lhs; }

Expand Down
2 changes: 1 addition & 1 deletion include/extractor/profile_properties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct ProfileProperties
weight_name{"duration"}, class_names{{}}, excludable_classes{{}},
call_tagless_node_function(true)
{
std::fill(excludable_classes.begin(), excludable_classes.end(), INAVLID_CLASS_DATA);
std::fill(excludable_classes.begin(), excludable_classes.end(), INVALID_CLASS_DATA);
BOOST_ASSERT(weight_name[MAX_WEIGHT_NAME_LENGTH] == '\0');
}

Expand Down
2 changes: 1 addition & 1 deletion include/util/exclude_flag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ excludeFlagsToNodeFilter(const NodeID number_of_nodes,
std::vector<std::vector<bool>> filters;
for (auto mask : properties.excludable_classes)
{
if (mask != extractor::INAVLID_CLASS_DATA)
if (mask != extractor::INVALID_CLASS_DATA)
{
std::vector<bool> allowed_nodes(number_of_nodes);
for (const auto node : util::irange<NodeID>(0, number_of_nodes))
Expand Down
4 changes: 2 additions & 2 deletions unit_tests/extractor/intersection_analysis_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ using Graph = util::NodeBasedDynamicGraph;
BOOST_AUTO_TEST_CASE(simple_intersection_connectivity)
{
std::vector<NodeBasedEdgeAnnotation> annotations{
{EMPTY_NAMEID, 0, INAVLID_CLASS_DATA, TRAVEL_MODE_DRIVING, false},
{EMPTY_NAMEID, 1, INAVLID_CLASS_DATA, TRAVEL_MODE_DRIVING, false}};
{EMPTY_NAMEID, 0, INVALID_CLASS_DATA, TRAVEL_MODE_DRIVING, false},
{EMPTY_NAMEID, 1, INVALID_CLASS_DATA, TRAVEL_MODE_DRIVING, false}};
std::vector<TurnRestriction> restrictions{TurnRestriction{{ViaNodePath{0, 2, 1}}, false}};
CompressedEdgeContainer container;
test::MockScriptingEnvironment scripting_environment;
Expand Down
Loading