From 81b0447024921899b3d80fc2435efe2b09f9fd3a Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Tue, 21 Oct 2014 18:06:58 +0200 Subject: [PATCH] remove inline keywords --- Algorithms/IteratorBasedCRC32.h | 4 +-- Contractor/Contractor.h | 18 +++++----- DataStructures/ConcurrentQueue.h | 8 ++--- DataStructures/DeallocatingVector.h | 40 +++++++++++----------- DataStructures/EdgeBasedNode.h | 2 +- DataStructures/HashTable.h | 8 ++--- DataStructures/HilbertValue.h | 4 +-- DataStructures/ImportNode.h | 2 +- DataStructures/JSONContainer.h | 8 +++-- DataStructures/NodeBasedGraph.h | 6 ++-- DataStructures/PhantomNodes.h | 12 ++++--- DataStructures/RangeTable.h | 4 +-- DataStructures/Restriction.h | 8 ++--- DataStructures/RestrictionMap.h | 4 +-- DataStructures/StaticGraph.h | 4 +-- DataStructures/StaticRTree.h | 38 ++++++++++---------- DataStructures/TurnInstructions.h | 4 +-- DataStructures/XORFastHash.h | 2 +- Descriptors/JSONDescriptor.h | 8 ++--- Include/osrm/Coordinate.h | 6 ++-- RoutingAlgorithms/AlternativePathRouting.h | 10 +++--- RoutingAlgorithms/BasicRoutingInterface.h | 10 +++--- RoutingAlgorithms/ManyToManyRouting.h | 4 +-- Server/DataStructures/SharedDataType.h | 10 +++--- Server/RequestParser.cpp | 8 ++--- Server/RequestParser.h | 8 ++--- 26 files changed, 125 insertions(+), 115 deletions(-) diff --git a/Algorithms/IteratorBasedCRC32.h b/Algorithms/IteratorBasedCRC32.h index a68514dce..4347a5729 100644 --- a/Algorithms/IteratorBasedCRC32.h +++ b/Algorithms/IteratorBasedCRC32.h @@ -108,7 +108,7 @@ class IteratorbasedCRC32 return crc; } - inline unsigned cpuid() const + unsigned cpuid() const { unsigned eax = 0, ebx = 0, ecx = 0, edx = 0; // on X64 this calls hardware cpuid(.) instr. otherwise a dummy impl. @@ -117,7 +117,7 @@ class IteratorbasedCRC32 } #if defined(__MINGW64__) || defined(_MSC_VER) - inline void + void __get_cpuid(int param, unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx) const { *ecx = 0; diff --git a/Contractor/Contractor.h b/Contractor/Contractor.h index 9e1214f63..2d78b7d3d 100644 --- a/Contractor/Contractor.h +++ b/Contractor/Contractor.h @@ -137,7 +137,7 @@ class Contractor { explicit ThreadDataContainer(int number_of_nodes) : number_of_nodes(number_of_nodes) {} - inline ContractorThreadData* getThreadData() + ContractorThreadData* getThreadData() { bool exists = false; auto& ref = data.local(exists); @@ -551,7 +551,7 @@ class Contractor thread_data_list.data.clear(); } - template inline void GetEdges(DeallocatingVector &edges) + template void GetEdges(DeallocatingVector &edges) { Percent p(contractor_graph->GetNumberOfNodes()); SimpleLogger().Write() << "Getting edges of minimized graph"; @@ -607,7 +607,7 @@ class Contractor } private: - inline void Dijkstra(const int max_distance, + void Dijkstra(const int max_distance, const unsigned number_of_targets, const int maxNodes, ContractorThreadData *const data, @@ -673,7 +673,7 @@ class Contractor } } - inline float EvaluateNodePriority(ContractorThreadData *const data, + float EvaluateNodePriority(ContractorThreadData *const data, NodePriorityData *const node_data, const NodeID node) { @@ -700,7 +700,7 @@ class Contractor } template - inline bool + bool ContractNode(ContractorThreadData *data, const NodeID node, ContractionStats *stats = nullptr) { ContractorHeap &heap = data->heap; @@ -829,7 +829,7 @@ class Contractor return true; } - inline void DeleteIncomingEdges(ContractorThreadData *data, const NodeID node) + void DeleteIncomingEdges(ContractorThreadData *data, const NodeID node) { std::vector &neighbours = data->neighbours; neighbours.clear(); @@ -853,7 +853,7 @@ class Contractor } } - inline bool UpdateNodeNeighbours(std::vector &priorities, + bool UpdateNodeNeighbours(std::vector &priorities, std::vector &node_data, ContractorThreadData *const data, const NodeID node) @@ -884,7 +884,7 @@ class Contractor return true; } - inline bool IsNodeIndependent( + bool IsNodeIndependent( const std::vector &priorities, ContractorThreadData *const data, NodeID node) const @@ -949,7 +949,7 @@ class Contractor } // This bias function takes up 22 assembly instructions in total on X86 - inline bool bias(const NodeID a, const NodeID b) const + bool bias(const NodeID a, const NodeID b) const { const unsigned short hasha = fast_hash(a); const unsigned short hashb = fast_hash(b); diff --git a/DataStructures/ConcurrentQueue.h b/DataStructures/ConcurrentQueue.h index a61503a6d..99bf24774 100644 --- a/DataStructures/ConcurrentQueue.h +++ b/DataStructures/ConcurrentQueue.h @@ -37,7 +37,7 @@ template class ConcurrentQueue public: explicit ConcurrentQueue(const size_t max_size) : m_internal_queue(max_size) {} - inline void push(const Data &data) + void push(const Data &data) { std::unique_lock lock(m_mutex); m_not_full.wait(lock, @@ -47,9 +47,9 @@ template class ConcurrentQueue m_not_empty.notify_one(); } - inline bool empty() const { return m_internal_queue.empty(); } + bool empty() const { return m_internal_queue.empty(); } - inline void wait_and_pop(Data &popped_value) + void wait_and_pop(Data &popped_value) { std::unique_lock lock(m_mutex); m_not_empty.wait(lock, @@ -60,7 +60,7 @@ template class ConcurrentQueue m_not_full.notify_one(); } - inline bool try_pop(Data &popped_value) + bool try_pop(Data &popped_value) { std::unique_lock lock(m_mutex); if (m_internal_queue.empty()) diff --git a/DataStructures/DeallocatingVector.h b/DataStructures/DeallocatingVector.h index 422dd5f19..2e0e4cfdf 100644 --- a/DataStructures/DeallocatingVector.h +++ b/DataStructures/DeallocatingVector.h @@ -50,7 +50,7 @@ template struct DeallocatingVectorIteratorState std::size_t index; std::vector *bucket_list; - inline DeallocatingVectorIteratorState &operator=(const DeallocatingVectorIteratorState &other) + DeallocatingVectorIteratorState &operator=(const DeallocatingVectorIteratorState &other) { index = other.index; bucket_list = other.bucket_list; @@ -175,13 +175,13 @@ class DeallocatingVector ~DeallocatingVector() { clear(); } - inline void swap(DeallocatingVector &other) + void swap(DeallocatingVector &other) { std::swap(current_size, other.current_size); bucket_list.swap(other.bucket_list); } - inline void clear() + void clear() { // Delete[]'ing ptr's to all Buckets for (auto bucket : bucket_list) @@ -196,7 +196,7 @@ class DeallocatingVector current_size = 0; } - inline void push_back(const ElementT &element) + void push_back(const ElementT &element) { const std::size_t current_capacity = capacity(); if (current_size == current_capacity) @@ -209,7 +209,7 @@ class DeallocatingVector ++current_size; } - template inline void emplace_back(Ts &&... element) + template void emplace_back(Ts &&... element) { const std::size_t current_capacity = capacity(); if (current_size == current_capacity) @@ -222,9 +222,9 @@ class DeallocatingVector ++current_size; } - inline void reserve(const std::size_t) const { /* don't do anything */ } + void reserve(const std::size_t) const { /* don't do anything */ } - inline void resize(const std::size_t new_size) + void resize(const std::size_t new_size) { if (new_size >= current_size) { @@ -248,50 +248,50 @@ class DeallocatingVector current_size = new_size; } - inline std::size_t size() const { return current_size; } + std::size_t size() const { return current_size; } - inline std::size_t capacity() const { return bucket_list.size() * ELEMENTS_PER_BLOCK; } + std::size_t capacity() const { return bucket_list.size() * ELEMENTS_PER_BLOCK; } - inline iterator begin() { return iterator(static_cast(0), &bucket_list); } + iterator begin() { return iterator(static_cast(0), &bucket_list); } - inline iterator end() { return iterator(size(), &bucket_list); } + iterator end() { return iterator(size(), &bucket_list); } - inline deallocation_iterator dbegin() + deallocation_iterator dbegin() { return deallocation_iterator(static_cast(0), &bucket_list); } - inline deallocation_iterator dend() { return deallocation_iterator(size(), &bucket_list); } + deallocation_iterator dend() { return deallocation_iterator(size(), &bucket_list); } - inline const_iterator begin() const + const_iterator begin() const { return const_iterator(static_cast(0), &bucket_list); } - inline const_iterator end() const { return const_iterator(size(), &bucket_list); } + const_iterator end() const { return const_iterator(size(), &bucket_list); } - inline ElementT &operator[](const std::size_t index) + ElementT &operator[](const std::size_t index) { const std::size_t _bucket = index / ELEMENTS_PER_BLOCK; const std::size_t _index = index % ELEMENTS_PER_BLOCK; return (bucket_list[_bucket][_index]); } - const inline ElementT &operator[](const std::size_t index) const + const ElementT &operator[](const std::size_t index) const { const std::size_t _bucket = index / ELEMENTS_PER_BLOCK; const std::size_t _index = index % ELEMENTS_PER_BLOCK; return (bucket_list[_bucket][_index]); } - inline ElementT &back() + ElementT &back() { const std::size_t _bucket = current_size / ELEMENTS_PER_BLOCK; const std::size_t _index = current_size % ELEMENTS_PER_BLOCK; return (bucket_list[_bucket][_index]); } - const inline ElementT &back() const + const ElementT &back() const { const std::size_t _bucket = current_size / ELEMENTS_PER_BLOCK; const std::size_t _index = current_size % ELEMENTS_PER_BLOCK; @@ -299,7 +299,7 @@ class DeallocatingVector } template - const inline void append(InputIterator first, const InputIterator last) + const void append(InputIterator first, const InputIterator last) { InputIterator position = first; while (position != last) diff --git a/DataStructures/EdgeBasedNode.h b/DataStructures/EdgeBasedNode.h index e2ac9acab..ee516e0b6 100644 --- a/DataStructures/EdgeBasedNode.h +++ b/DataStructures/EdgeBasedNode.h @@ -65,7 +65,7 @@ struct EdgeBasedNode (reverse_edge_based_node_id != SPECIAL_NODEID)); } - static inline FixedPointCoordinate Centroid(const FixedPointCoordinate & a, const FixedPointCoordinate & b) + static FixedPointCoordinate Centroid(const FixedPointCoordinate & a, const FixedPointCoordinate & b) { FixedPointCoordinate centroid; //The coordinates of the midpoint are given by: diff --git a/DataStructures/HashTable.h b/DataStructures/HashTable.h index 8ff468836..272a888f4 100644 --- a/DataStructures/HashTable.h +++ b/DataStructures/HashTable.h @@ -40,17 +40,17 @@ class HashTable public: HashTable() {} - inline void Add(Key const &key, Value const &value) + void Add(Key const &key, Value const &value) { table.emplace_back(std::move(key), std::move(value)); } - inline void Clear() + void Clear() { table.clear(); } - inline const Value Find(Key const &key) const + const Value Find(Key const &key) const { for (const auto &key_val_pair : table) { @@ -62,7 +62,7 @@ class HashTable return Value(); } - inline const bool Holds(Key const &key) const + const bool Holds(Key const &key) const { for (const auto &key_val_pair : table) { diff --git a/DataStructures/HilbertValue.h b/DataStructures/HilbertValue.h index 9de23724f..19bc02adf 100644 --- a/DataStructures/HilbertValue.h +++ b/DataStructures/HilbertValue.h @@ -42,8 +42,8 @@ class HilbertCode HilbertCode(const HilbertCode &) = delete; private: - inline uint64_t BitInterleaving(const uint32_t a, const uint32_t b) const; - inline void TransposeCoordinate(uint32_t *X) const; + uint64_t BitInterleaving(const uint32_t a, const uint32_t b) const; + void TransposeCoordinate(uint32_t *X) const; }; #endif /* HILBERTVALUE_H_ */ diff --git a/DataStructures/ImportNode.h b/DataStructures/ImportNode.h index b8a945120..052787c8e 100644 --- a/DataStructures/ImportNode.h +++ b/DataStructures/ImportNode.h @@ -51,7 +51,7 @@ struct ImportNode : public ExternalMemoryNode { HashTable keyVals; - inline void Clear(); + void Clear(); }; #endif /* IMPORTNODE_H_ */ diff --git a/DataStructures/JSONContainer.h b/DataStructures/JSONContainer.h index 350441d12..a497dfcdb 100644 --- a/DataStructures/JSONContainer.h +++ b/DataStructures/JSONContainer.h @@ -219,18 +219,20 @@ struct ArrayRenderer : mapbox::util::static_visitor<> std::vector &out; }; -inline void render(std::ostream &out, const Object &object) +namespace +{ +void render(std::ostream &out, const Object &object) { Value value = object; mapbox::util::apply_visitor(Renderer(out), value); } -inline void render(std::vector &out, const Object &object) +void render(std::vector &out, const Object &object) { Value value = object; mapbox::util::apply_visitor(ArrayRenderer(out), value); } - +} // anonymous namespace to guard against duplicate symbols } // namespace JSON #endif // JSON_CONTAINER_H diff --git a/DataStructures/NodeBasedGraph.h b/DataStructures/NodeBasedGraph.h index cceb4a078..3eb836ac1 100644 --- a/DataStructures/NodeBasedGraph.h +++ b/DataStructures/NodeBasedGraph.h @@ -54,8 +54,9 @@ struct SimpleEdgeData using NodeBasedDynamicGraph = DynamicGraph; using SimpleNodeBasedDynamicGraph = DynamicGraph; +namespace { // Factory method to create NodeBasedDynamicGraph from ImportEdges -inline std::shared_ptr +std::shared_ptr NodeBasedDynamicGraphFromImportEdges(int number_of_nodes, std::vector &input_edge_list) { static_assert(sizeof(NodeBasedEdgeData) == 16, "changing node based edge data size changes memory consumption"); @@ -169,7 +170,7 @@ NodeBasedDynamicGraphFromImportEdges(int number_of_nodes, std::vector -inline std::shared_ptr +std::shared_ptr SimpleNodeBasedDynamicGraphFromEdges(int number_of_nodes, std::vector &input_edge_list) { static_assert(sizeof(NodeBasedEdgeData) == 16, "changing node based edge data size changes memory consumption"); @@ -240,5 +241,6 @@ SimpleNodeBasedDynamicGraphFromEdges(int number_of_nodes, std::vector(number_of_nodes, edges_list); return graph; } +} #endif // NODE_BASED_GRAPH_H_ diff --git a/DataStructures/PhantomNodes.h b/DataStructures/PhantomNodes.h index 7c1279072..6a1ed697c 100644 --- a/DataStructures/PhantomNodes.h +++ b/DataStructures/PhantomNodes.h @@ -156,14 +156,17 @@ struct PhantomNodes PhantomNode target_phantom; }; -inline std::ostream& operator<<(std::ostream &out, const PhantomNodes & pn) +namespace { - out << "source_coord: " << pn.source_phantom.location << "\n"; - out << "target_coord: " << pn.target_phantom.location << std::endl; + +std::ostream& operator<<(std::ostream &out, const PhantomNodes &pn) +{ + out << "source_coord: " << pn.source_phantom.location << "\n"; + out << "target_coord: " << pn.target_phantom.location << std::endl; return out; } -inline std::ostream& operator<<(std::ostream &out, const PhantomNode & pn) +std::ostream& operator<<(std::ostream &out, const PhantomNode &pn) { out << "node1: " << pn.forward_node_id << ", " << "node2: " << pn.reverse_node_id << ", " << @@ -177,5 +180,6 @@ inline std::ostream& operator<<(std::ostream &out, const PhantomNode & pn) "loc: " << pn.location; return out; } +} // anonymous namespace to guard against duplicate symbols #endif // PHANTOM_NODES_H diff --git a/DataStructures/RangeTable.h b/DataStructures/RangeTable.h index 46333aefb..ef60009e7 100644 --- a/DataStructures/RangeTable.h +++ b/DataStructures/RangeTable.h @@ -133,7 +133,7 @@ public: sum_lengths = lengths_prefix_sum; } - inline RangeT GetRange(const unsigned id) const + RangeT GetRange(const unsigned id) const { BOOST_ASSERT(id < block_offsets.size() + diff_blocks.size() * BLOCK_SIZE); // internal_idx 0 is implicitly stored in block_offsets[block_idx] @@ -170,7 +170,7 @@ public: } private: - inline unsigned PrefixSumAtIndex(int index, const BlockT& block) const; + unsigned PrefixSumAtIndex(int index, const BlockT& block) const; // contains offset for each differential block OffsetContainerT block_offsets; diff --git a/DataStructures/Restriction.h b/DataStructures/Restriction.h index bda0f0196..36f4e0fd4 100644 --- a/DataStructures/Restriction.h +++ b/DataStructures/Restriction.h @@ -102,19 +102,19 @@ struct InputRestrictionContainer struct CmpRestrictionContainerByFrom { using value_type = InputRestrictionContainer; - inline bool operator()(const InputRestrictionContainer &a, const InputRestrictionContainer &b) + bool operator()(const InputRestrictionContainer &a, const InputRestrictionContainer &b) const { return a.fromWay < b.fromWay; } - inline value_type max_value() const { return InputRestrictionContainer::max_value(); } - inline value_type min_value() const { return InputRestrictionContainer::min_value(); } + value_type max_value() const { return InputRestrictionContainer::max_value(); } + value_type min_value() const { return InputRestrictionContainer::min_value(); } }; struct CmpRestrictionContainerByTo { using value_type = InputRestrictionContainer; - inline bool operator()(const InputRestrictionContainer &a, const InputRestrictionContainer &b) + bool operator()(const InputRestrictionContainer &a, const InputRestrictionContainer &b) const { return a.toWay < b.toWay; diff --git a/DataStructures/RestrictionMap.h b/DataStructures/RestrictionMap.h index 3945a3982..03d85f390 100644 --- a/DataStructures/RestrictionMap.h +++ b/DataStructures/RestrictionMap.h @@ -48,7 +48,7 @@ struct RestrictionSource { } - friend inline bool operator==(const RestrictionSource &lhs, const RestrictionSource &rhs) + friend bool operator==(const RestrictionSource &lhs, const RestrictionSource &rhs) { return (lhs.start_node == rhs.start_node && lhs.via_node == rhs.via_node); } @@ -63,7 +63,7 @@ struct RestrictionTarget { } - friend inline bool operator==(const RestrictionTarget &lhs, const RestrictionTarget &rhs) + friend bool operator==(const RestrictionTarget &lhs, const RestrictionTarget &rhs) { return (lhs.target_node == rhs.target_node && lhs.is_only == rhs.is_only); } diff --git a/DataStructures/StaticGraph.h b/DataStructures/StaticGraph.h index 456acfe32..4ec9530e7 100644 --- a/DataStructures/StaticGraph.h +++ b/DataStructures/StaticGraph.h @@ -135,12 +135,12 @@ template class StaticGraph unsigned GetOutDegree(const NodeIterator n) const { return EndEdges(n) - BeginEdges(n); } - inline NodeIterator GetTarget(const EdgeIterator e) const + NodeIterator GetTarget(const EdgeIterator e) const { return NodeIterator(edge_array[e].target); } - inline EdgeDataT &GetEdgeData(const EdgeIterator e) { return edge_array[e].data; } + EdgeDataT &GetEdgeData(const EdgeIterator e) { return edge_array[e].data; } const EdgeDataT &GetEdgeData(const EdgeIterator e) const { return edge_array[e].data; } diff --git a/DataStructures/StaticRTree.h b/DataStructures/StaticRTree.h index 6e09b4347..7c873ff06 100644 --- a/DataStructures/StaticRTree.h +++ b/DataStructures/StaticRTree.h @@ -77,7 +77,7 @@ class StaticRTree int32_t min_lon, max_lon; int32_t min_lat, max_lat; - inline void InitializeMBRectangle(const std::array &objects, + void InitializeMBRectangle(const std::array &objects, const uint32_t element_count, const std::vector &coordinate_list) { @@ -103,7 +103,7 @@ class StaticRTree BOOST_ASSERT(max_lon != std::numeric_limits::min()); } - inline void MergeBoundingBoxes(const RectangleInt2D &other) + void MergeBoundingBoxes(const RectangleInt2D &other) { min_lon = std::min(min_lon, other.min_lon); max_lon = std::max(max_lon, other.max_lon); @@ -115,7 +115,7 @@ class StaticRTree BOOST_ASSERT(max_lon != std::numeric_limits::min()); } - inline FixedPointCoordinate Centroid() const + FixedPointCoordinate Centroid() const { FixedPointCoordinate centroid; // The coordinates of the midpoints are given by: @@ -125,7 +125,7 @@ class StaticRTree return centroid; } - inline bool Intersects(const RectangleInt2D &other) const + bool Intersects(const RectangleInt2D &other) const { FixedPointCoordinate upper_left(other.max_lat, other.min_lon); FixedPointCoordinate upper_right(other.max_lat, other.max_lon); @@ -136,7 +136,7 @@ class StaticRTree Contains(lower_left)); } - inline float GetMinDist(const FixedPointCoordinate &location) const + float GetMinDist(const FixedPointCoordinate &location) const { const bool is_contained = Contains(location); if (is_contained) @@ -205,7 +205,7 @@ class StaticRTree return min_dist; } - inline float GetMinMaxDist(const FixedPointCoordinate &location) const + float GetMinMaxDist(const FixedPointCoordinate &location) const { float min_max_dist = std::numeric_limits::max(); // Get minmax distance to each of the four sides @@ -238,14 +238,14 @@ class StaticRTree return min_max_dist; } - inline bool Contains(const FixedPointCoordinate &location) const + bool Contains(const FixedPointCoordinate &location) const { const bool lats_contained = (location.lat >= min_lat) && (location.lat <= max_lat); const bool lons_contained = (location.lon >= min_lon) && (location.lon <= max_lon); return lats_contained && lons_contained; } - inline friend std::ostream &operator<<(std::ostream &out, const RectangleInt2D &rect) + friend std::ostream &operator<<(std::ostream &out, const RectangleInt2D &rect) { out << rect.min_lat / COORDINATE_PRECISION << "," << rect.min_lon / COORDINATE_PRECISION << " " << rect.max_lat / COORDINATE_PRECISION << "," @@ -278,7 +278,7 @@ class StaticRTree uint64_t m_hilbert_value; uint32_t m_array_index; - inline bool operator<(const WrappedInputElement &other) const + bool operator<(const WrappedInputElement &other) const { return m_hilbert_value < other.m_hilbert_value; } @@ -300,7 +300,7 @@ class StaticRTree QueryCandidate() : min_dist(std::numeric_limits::max()), node_id(UINT_MAX) {} float min_dist; uint32_t node_id; - inline bool operator<(const QueryCandidate &other) const + bool operator<(const QueryCandidate &other) const { // Attn: this is reversed order. std::pq is a max pq! return other.min_dist < min_dist; @@ -317,7 +317,7 @@ class StaticRTree IncrementalQueryCandidate() : min_dist(std::numeric_limits::max()) {} - inline bool operator<(const IncrementalQueryCandidate &other) const + bool operator<(const IncrementalQueryCandidate &other) const { // Attn: this is reversed order. std::pq is a max pq! return other.min_dist < min_dist; @@ -1110,7 +1110,7 @@ class StaticRTree private: - inline void SetForwardAndReverseWeightsOnPhantomNode(const EdgeDataT & nearest_edge, + void SetForwardAndReverseWeightsOnPhantomNode(const EdgeDataT & nearest_edge, PhantomNode &result_phantom_node) const { const float distance_1 = FixedPointCoordinate::ApproximateEuclideanDistance( @@ -1130,7 +1130,7 @@ class StaticRTree } // fixup locations if too close to inputs - inline void FixUpRoundingIssue(const FixedPointCoordinate &input_coordinate, + void FixUpRoundingIssue(const FixedPointCoordinate &input_coordinate, PhantomNode &result_phantom_node) const { if (1 == std::abs(input_coordinate.lon - result_phantom_node.location.lon)) @@ -1144,7 +1144,7 @@ class StaticRTree } template - inline float ExploreTreeNode(const TreeNode &parent, + float ExploreTreeNode(const TreeNode &parent, const FixedPointCoordinate &input_coordinate, const float min_dist, const float min_max_dist, @@ -1173,7 +1173,7 @@ class StaticRTree return new_min_max_dist; } - inline void LoadLeafFromDisk(const uint32_t leaf_id, LeafNode &result_node) + void LoadLeafFromDisk(const uint32_t leaf_id, LeafNode &result_node) { if (!leaves_stream.is_open()) { @@ -1192,10 +1192,10 @@ class StaticRTree BOOST_ASSERT_MSG(leaves_stream.good(), "Reading from leaf file failed."); } - inline bool EdgesAreEquivalent(const FixedPointCoordinate &a, - const FixedPointCoordinate &b, - const FixedPointCoordinate &c, - const FixedPointCoordinate &d) const + bool EdgesAreEquivalent(const FixedPointCoordinate &a, + const FixedPointCoordinate &b, + const FixedPointCoordinate &c, + const FixedPointCoordinate &d) const { return (a == b && c == d) || (a == c && b == d) || (a == d && b == c); } diff --git a/DataStructures/TurnInstructions.h b/DataStructures/TurnInstructions.h index 611b574dd..f692ae854 100644 --- a/DataStructures/TurnInstructions.h +++ b/DataStructures/TurnInstructions.h @@ -44,7 +44,7 @@ struct TurnInstructionsClass TurnInstructionsClass() = delete; TurnInstructionsClass(const TurnInstructionsClass&) = delete; - static inline TurnInstruction GetTurnDirectionOfInstruction(const double angle) + static TurnInstruction GetTurnDirectionOfInstruction(const double angle) { if (angle >= 23 && angle < 67) { @@ -77,7 +77,7 @@ struct TurnInstructionsClass return TurnInstruction::UTurn; } - static inline bool TurnIsNecessary(const TurnInstruction turn_instruction) + static bool TurnIsNecessary(const TurnInstruction turn_instruction) { if (TurnInstruction::NoTurn == turn_instruction || TurnInstruction::StayOnRoundAbout == turn_instruction) { diff --git a/DataStructures/XORFastHash.h b/DataStructures/XORFastHash.h index aba6ef40a..3a2fd6271 100644 --- a/DataStructures/XORFastHash.h +++ b/DataStructures/XORFastHash.h @@ -68,7 +68,7 @@ class XORFastHash std::random_shuffle(table2.begin(), table2.end()); } - inline unsigned short operator()(const unsigned originalValue) const + unsigned short operator()(const unsigned originalValue) const { unsigned short lsb = ((originalValue)&0xffff); unsigned short msb = (((originalValue) >> 16) & 0xffff); diff --git a/Descriptors/JSONDescriptor.h b/Descriptors/JSONDescriptor.h index 1fd2182d0..13b4467cd 100644 --- a/Descriptors/JSONDescriptor.h +++ b/Descriptors/JSONDescriptor.h @@ -299,10 +299,10 @@ template class JSONDescriptor final : public BaseDescriptor< } // TODO: reorder parameters - inline void BuildTextualDescription(DescriptionFactory &description_factory, - JSON::Array &json_instruction_array, - const int route_length, - std::vector &route_segments_list) + void BuildTextualDescription(DescriptionFactory &description_factory, + JSON::Array &json_instruction_array, + const int route_length, + std::vector &route_segments_list) { // Segment information has following format: //["instruction id","streetname",length,position,time,"length","earth_direction",azimuth] diff --git a/Include/osrm/Coordinate.h b/Include/osrm/Coordinate.h index 462ac0b63..8bc8d0bc0 100644 --- a/Include/osrm/Coordinate.h +++ b/Include/osrm/Coordinate.h @@ -102,10 +102,12 @@ struct FixedPointCoordinate static float RadianToDegree(const float radian); }; -inline std::ostream &operator<<(std::ostream &out_stream, FixedPointCoordinate const &coordinate) +namespace +{ +std::ostream &operator<<(std::ostream &out_stream, FixedPointCoordinate const &coordinate) { coordinate.Output(out_stream); return out_stream; } - +} // anonymous namespace to guard against duplicate symbols #endif /* FIXED_POINT_COORDINATE_H_ */ diff --git a/RoutingAlgorithms/AlternativePathRouting.h b/RoutingAlgorithms/AlternativePathRouting.h index 83875f3d0..1f67da16b 100644 --- a/RoutingAlgorithms/AlternativePathRouting.h +++ b/RoutingAlgorithms/AlternativePathRouting.h @@ -370,7 +370,7 @@ template class AlternativeRouting final : private BasicRouti private: // unpack alternate by exploring search spaces from v - inline void RetrievePackedAlternatePath(const QueryHeap &forward_heap1, + void RetrievePackedAlternatePath(const QueryHeap &forward_heap1, const QueryHeap &reverse_heap1, const QueryHeap &forward_heap2, const QueryHeap &reverse_heap2, @@ -394,7 +394,7 @@ template class AlternativeRouting final : private BasicRouti // compute and unpack and by exploring search spaces // from v and intersecting against queues. only half-searches have to be // done at this stage - inline void ComputeLengthAndSharingOfViaPath(const NodeID via_node, + void ComputeLengthAndSharingOfViaPath(const NodeID via_node, int *real_length_of_via_path, int *sharing_of_via_path, const std::vector &packed_shortest_path, @@ -551,7 +551,7 @@ template class AlternativeRouting final : private BasicRouti // variable } - // inline int approximateAmountOfSharing( + // int approximateAmountOfSharing( // const NodeID alternate_path_middle_node_id, // QueryHeap & forward_heap, // QueryHeap & reverse_heap, @@ -598,7 +598,7 @@ template class AlternativeRouting final : private BasicRouti // todo: reorder parameters template - inline void AlternativeRoutingStep(QueryHeap &forward_heap, + void AlternativeRoutingStep(QueryHeap &forward_heap, QueryHeap &reverse_heap, NodeID *middle_node, int *upper_bound_to_shortest_path_distance, @@ -674,7 +674,7 @@ template class AlternativeRouting final : private BasicRouti } // conduct T-Test - inline bool ViaNodeCandidatePassesTTest(QueryHeap &existing_forward_heap, + bool ViaNodeCandidatePassesTTest(QueryHeap &existing_forward_heap, QueryHeap &existing_reverse_heap, QueryHeap &new_forward_heap, QueryHeap &new_reverse_heap, diff --git a/RoutingAlgorithms/BasicRoutingInterface.h b/RoutingAlgorithms/BasicRoutingInterface.h index 72f1155e5..ac1e6c503 100644 --- a/RoutingAlgorithms/BasicRoutingInterface.h +++ b/RoutingAlgorithms/BasicRoutingInterface.h @@ -58,7 +58,7 @@ template class BasicRoutingInterface explicit BasicRoutingInterface(DataFacadeT *facade) : facade(facade) {} virtual ~BasicRoutingInterface() {}; - inline void RoutingStep(SearchEngineData::QueryHeap &forward_heap, + void RoutingStep(SearchEngineData::QueryHeap &forward_heap, SearchEngineData::QueryHeap &reverse_heap, NodeID *middle_node_id, int *upper_bound, @@ -145,7 +145,7 @@ template class BasicRoutingInterface } } - inline void UnpackPath(const std::vector &packed_path, + void UnpackPath(const std::vector &packed_path, const PhantomNodes &phantom_node_pair, std::vector &unpacked_path) const { @@ -330,7 +330,7 @@ template class BasicRoutingInterface } } - inline void UnpackEdge(const NodeID s, const NodeID t, std::vector &unpacked_path) const + void UnpackEdge(const NodeID s, const NodeID t, std::vector &unpacked_path) const { std::stack> recursion_stack; recursion_stack.emplace(s, t); @@ -386,7 +386,7 @@ template class BasicRoutingInterface unpacked_path.emplace_back(t); } - inline void RetrievePackedPathFromHeap(const SearchEngineData::QueryHeap &forward_heap, + void RetrievePackedPathFromHeap(const SearchEngineData::QueryHeap &forward_heap, const SearchEngineData::QueryHeap &reverse_heap, const NodeID middle_node_id, std::vector &packed_path) const @@ -397,7 +397,7 @@ template class BasicRoutingInterface RetrievePackedPathFromSingleHeap(reverse_heap, middle_node_id, packed_path); } - inline void RetrievePackedPathFromSingleHeap(const SearchEngineData::QueryHeap &search_heap, + void RetrievePackedPathFromSingleHeap(const SearchEngineData::QueryHeap &search_heap, const NodeID middle_node_id, std::vector &packed_path) const { diff --git a/RoutingAlgorithms/ManyToManyRouting.h b/RoutingAlgorithms/ManyToManyRouting.h index 6761c25ca..3f0b2a648 100644 --- a/RoutingAlgorithms/ManyToManyRouting.h +++ b/RoutingAlgorithms/ManyToManyRouting.h @@ -204,7 +204,7 @@ template class ManyToManyRouting final : public BasicRouting } template - inline void + void RelaxOutgoingEdges(const NodeID node, const EdgeWeight distance, QueryHeap &query_heap) const { for (auto edge : super::facade->GetAdjacentEdgeRange(node)) @@ -237,7 +237,7 @@ template class ManyToManyRouting final : public BasicRouting // Stalling template - inline bool StallAtNode(const NodeID node, const EdgeWeight distance, QueryHeap &query_heap) + bool StallAtNode(const NodeID node, const EdgeWeight distance, QueryHeap &query_heap) const { for (auto edge : super::facade->GetAdjacentEdgeRange(node)) diff --git a/Server/DataStructures/SharedDataType.h b/Server/DataStructures/SharedDataType.h index 5f07f131f..7ce7cae87 100644 --- a/Server/DataStructures/SharedDataType.h +++ b/Server/DataStructures/SharedDataType.h @@ -111,13 +111,13 @@ struct SharedDataLayout } template - inline void SetBlockSize(BlockID bid, uint64_t entries) + void SetBlockSize(BlockID bid, uint64_t entries) { num_entries[bid] = entries; entry_size[bid] = sizeof(T); } - inline uint64_t GetBlockSize(BlockID bid) const + uint64_t GetBlockSize(BlockID bid) const { // special encoding if (bid == GEOMETRIES_INDICATORS) @@ -128,12 +128,12 @@ struct SharedDataLayout return num_entries[bid] * entry_size[bid]; } - inline uint64_t GetSizeOfLayout() const + uint64_t GetSizeOfLayout() const { return GetBlockOffset(NUM_BLOCKS) + NUM_BLOCKS*2*sizeof(CANARY); } - inline uint64_t GetBlockOffset(BlockID bid) const + uint64_t GetBlockOffset(BlockID bid) const { uint64_t result = sizeof(CANARY); for (auto i = 0; i < bid; i++) @@ -144,7 +144,7 @@ struct SharedDataLayout } template - inline T* GetBlockPtr(char* shared_memory, BlockID bid) + T* GetBlockPtr(char* shared_memory, BlockID bid) { T* ptr = (T*)(shared_memory + GetBlockOffset(bid)); if (WRITE_CANARY) diff --git a/Server/RequestParser.cpp b/Server/RequestParser.cpp index 6e9cddf5e..e2d2911c9 100644 --- a/Server/RequestParser.cpp +++ b/Server/RequestParser.cpp @@ -270,14 +270,14 @@ RequestParser::consume(Request &req, char input, http::CompressionType *compress } } -inline bool RequestParser::isChar(int character) { return character >= 0 && character <= 127; } +bool RequestParser::isChar(int character) { return character >= 0 && character <= 127; } -inline bool RequestParser::isCTL(int character) +bool RequestParser::isCTL(int character) { return (character >= 0 && character <= 31) || (character == 127); } -inline bool RequestParser::isTSpecial(int character) +bool RequestParser::isTSpecial(int character) { switch (character) { @@ -306,5 +306,5 @@ inline bool RequestParser::isTSpecial(int character) } } -inline bool RequestParser::isDigit(int character) { return character >= '0' && character <= '9'; } +bool RequestParser::isDigit(int character) { return character >= '0' && character <= '9'; } } diff --git a/Server/RequestParser.h b/Server/RequestParser.h index 4b74d83b9..c88ebcf02 100644 --- a/Server/RequestParser.h +++ b/Server/RequestParser.h @@ -51,13 +51,13 @@ class RequestParser private: boost::tribool consume(Request &req, char input, CompressionType *compressionType); - inline bool isChar(int c); + bool isChar(int c); - inline bool isCTL(int c); + bool isCTL(int c); - inline bool isTSpecial(int c); + bool isTSpecial(int c); - inline bool isDigit(int c); + bool isDigit(int c); enum state { method_start,