Skip to content

Commit

Permalink
Use clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
nyllet committed Oct 31, 2023
1 parent 40991ce commit 4cce950
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
20 changes: 14 additions & 6 deletions include/util/coordinate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,20 @@ using FloatLongitude = Alias<double, tag::longitude>;
// range checks on these (toFixed/toFloat, etc)
using UnsafeFloatLatitude = Alias<double, tag::unsafelatitude>;
using UnsafeFloatLongitude = Alias<double, tag::unsafelongitude>;
static_assert(std::is_standard_layout<FixedLatitude>() && std::is_trivial<FixedLatitude>(), "FixedLatitude is not a valid alias");
static_assert(std::is_standard_layout<FixedLongitude>() && std::is_trivial<FixedLongitude>(), "FixedLongitude is not a valid alias");
static_assert(std::is_standard_layout<FloatLatitude>() && std::is_trivial<FloatLatitude>(), "FloatLatitude is not a valid alias");
static_assert(std::is_standard_layout<FloatLongitude>() && std::is_trivial<FloatLongitude>(), "FloatLongitude is not a valid alias");
static_assert(std::is_standard_layout<UnsafeFloatLatitude>() && std::is_trivial<UnsafeFloatLatitude>(), "UnsafeFloatLatitude is not a valid alias");
static_assert(std::is_standard_layout<UnsafeFloatLongitude>() && std::is_trivial<UnsafeFloatLongitude>(), "UnsafeFloatLongitude is not a valid alias");
static_assert(std::is_standard_layout<FixedLatitude>() && std::is_trivial<FixedLatitude>(),
"FixedLatitude is not a valid alias");
static_assert(std::is_standard_layout<FixedLongitude>() && std::is_trivial<FixedLongitude>(),
"FixedLongitude is not a valid alias");
static_assert(std::is_standard_layout<FloatLatitude>() && std::is_trivial<FloatLatitude>(),
"FloatLatitude is not a valid alias");
static_assert(std::is_standard_layout<FloatLongitude>() && std::is_trivial<FloatLongitude>(),
"FloatLongitude is not a valid alias");
static_assert(std::is_standard_layout<UnsafeFloatLatitude>() &&
std::is_trivial<UnsafeFloatLatitude>(),
"UnsafeFloatLatitude is not a valid alias");
static_assert(std::is_standard_layout<UnsafeFloatLongitude>() &&
std::is_trivial<UnsafeFloatLongitude>(),
"UnsafeFloatLongitude is not a valid alias");

/**
* Converts a typed latitude from floating to fixed representation.
Expand Down
3 changes: 2 additions & 1 deletion include/util/fingerprint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ struct FingerPrint

static_assert(sizeof(FingerPrint) == 8, "FingerPrint has unexpected size");
static_assert(std::is_trivial<FingerPrint>::value, "FingerPrint needs to be trivial.");
static_assert(std::is_standard_layout<FingerPrint>::value, "FingerPrint needs have a standard layout.");
static_assert(std::is_standard_layout<FingerPrint>::value,
"FingerPrint needs have a standard layout.");
} // namespace osrm::util

#endif /* FingerPrint_H */
6 changes: 4 additions & 2 deletions include/util/typedefs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ struct turn_penalty
using OSMNodeID = osrm::Alias<std::uint64_t, tag::osm_node_id>;
// clang-tidy fires `bugprone-throw-keyword-missing` here for unknown reason
// NOLINTNEXTLINE(bugprone-throw-keyword-missing)
static_assert(std::is_standard_layout<OSMNodeID>() && std::is_trivial<OSMNodeID>(), "OSMNodeID is not a valid alias");
static_assert(std::is_standard_layout<OSMNodeID>() && std::is_trivial<OSMNodeID>(),
"OSMNodeID is not a valid alias");
using OSMWayID = osrm::Alias<std::uint64_t, tag::osm_way_id>;
// NOLINTNEXTLINE(bugprone-throw-keyword-missing)
static_assert(std::is_standard_layout<OSMWayID>() && std::is_trivial<OSMWayID>(), "OSMWayID is not a valid alias");
static_assert(std::is_standard_layout<OSMWayID>() && std::is_trivial<OSMWayID>(),
"OSMWayID is not a valid alias");

using DuplicatedNodeID = std::uint64_t;
using RestrictionID = std::uint64_t;
Expand Down

0 comments on commit 4cce950

Please sign in to comment.