Skip to content

Commit 2e3f3e9

Browse files
Merge branch 'master' into sf-ankerl
2 parents 2e54842 + a2915f7 commit 2e3f3e9

File tree

19 files changed

+197
-161
lines changed

19 files changed

+197
-161
lines changed

.clang-tidy

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Checks: >
1313
-bugprone-forward-declaration-namespace,
1414
-bugprone-sizeof-expression,
1515
-bugprone-throw-keyword-missing,
16+
-bugprone-chained-comparison,
17+
-bugprone-incorrect-enable-if,
18+
-bugprone-switch-missing-default-case,
19+
-bugprone-empty-catch,
1620
-clang-analyzer-*,
1721
-clang-diagnostic-deprecated-declarations,
1822
-clang-diagnostic-constant-conversion,
@@ -49,11 +53,13 @@ Checks: >
4953
-misc-misplaced-const,
5054
-misc-definitions-in-headers,
5155
-misc-unused-parameters,
56+
-misc-include-cleaner,
5257
modernize-concat-nested-namespaces,
5358
modernize-use-using,
5459
performance-*,
55-
-performance-noexcept-move-constructor,
5660
-performance-no-int-to-ptr,
61+
-performance-enum-size,
62+
-performance-avoid-endl,
5763
readability-*,
5864
-readability-avoid-const-params-in-decls,
5965
-readability-braces-around-statements,
@@ -82,6 +88,10 @@ Checks: >
8288
-readability-make-member-function-const,
8389
-readability-redundant-string-init,
8490
-readability-non-const-parameter,
91+
-readability-redundant-inline-specifier,
92+
-readability-avoid-nested-conditional-operator,
93+
-readability-avoid-return-with-void-value,
94+
-readability-redundant-casting,
8595
-readability-static-accessed-through-instance
8696
8797
WarningsAsErrors: '*'

.github/workflows/osrm-backend.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,14 @@ jobs:
192192
CXXCOMPILER: clang++-15
193193
CUCUMBER_TIMEOUT: 60000
194194

195-
- name: clang-15-debug-clang-tidy
195+
- name: clang-18-debug-clang-tidy
196196
continue-on-error: false
197197
node: 18
198-
runs-on: ubuntu-22.04
198+
runs-on: ubuntu-24.04
199199
BUILD_TOOLS: ON
200200
BUILD_TYPE: Debug
201-
CCOMPILER: clang-15
202-
CXXCOMPILER: clang++-15
201+
CCOMPILER: clang-18
202+
CXXCOMPILER: clang++-18
203203
CUCUMBER_TIMEOUT: 60000
204204
ENABLE_CLANG_TIDY: ON
205205

@@ -656,7 +656,7 @@ jobs:
656656
path: pr
657657
- name: Install dependencies
658658
run: |
659-
python3 -m pip install "conan<2.0.0" "requests==2.31.0" "locust==2.28.0"
659+
python3 -m pip install "conan<2.0.0" "requests==2.31.0" "numpy==1.26.4"
660660
sudo apt-get update -y && sudo apt-get install ccache
661661
- name: Prepare data
662662
run: |

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- ADDED: Add support for opposite approach request parameter. [#6842](https://github.com/Project-OSRM/osrm-backend/pull/6842)
99
- ADDED: Add support for accessing edge flags in `process_segment` [#6658](https://github.com/Project-OSRM/osrm-backend/pull/6658)
1010
- Build:
11+
- CHANGED: Upgrade clang-format to version 15. [#6919](https://github.com/Project-OSRM/osrm-backend/pull/6919)
1112
- CHANGED: Use Debian Bookworm as base Docker image [#6904](https://github.com/Project-OSRM/osrm-backend/pull/6904)
1213
- CHANGED: Upgrade CI actions to latest versions [#6893](https://github.com/Project-OSRM/osrm-backend/pull/6893)
1314
- CHANGED: Remove outdated warnings #6894 [#6894](https://github.com/Project-OSRM/osrm-backend/pull/6894)
@@ -23,6 +24,9 @@
2324
- NodeJS:
2425
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
2526
- Misc:
27+
- FIXED: Fix bugprone-unused-return-value clang-tidy warning. [#6934](https://github.com/Project-OSRM/osrm-backend/pull/6934)
28+
- FIXED: Fix performance-noexcept-move-constructor clang-tidy warning. [#6931](https://github.com/Project-OSRM/osrm-backend/pull/6933)
29+
- FIXED: Fix performance-noexcept-swap clang-tidy warning. [#6931](https://github.com/Project-OSRM/osrm-backend/pull/6931)
2630
- CHANGED: Use custom struct instead of std::pair in QueryHeap. [#6921](https://github.com/Project-OSRM/osrm-backend/pull/6921)
2731
- CHANGED: Use std::string_view::starts_with instead of boost::starts_with. [#6918](https://github.com/Project-OSRM/osrm-backend/pull/6918)
2832
- CHANGED: Get rid of boost::math::constants::* and M_PI in favor of std::numbers. [#6916](https://github.com/Project-OSRM/osrm-backend/pull/6916)

include/extractor/serialization.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ inline void read(storage::tar::FileReader &reader,
215215
const std::string &name,
216216
detail::NameTableImpl<Ownership> &name_table)
217217
{
218-
std::string buffer;
219218
util::serialization::read(reader, name, name_table.indexed_data);
220219
}
221220
} // namespace osrm::extractor::serialization

include/server/http/header.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct header
1212
// explicitly use default copy c'tor as adding move c'tor
1313
header &operator=(const header &other) = default;
1414
header(std::string name, std::string value) : name(std::move(name)), value(std::move(value)) {}
15-
header(header &&other) : name(std::move(other.name)), value(std::move(other.value)) {}
15+
header(header &&other) noexcept : name(std::move(other.name)), value(std::move(other.value)) {}
1616

1717
void clear()
1818
{

include/storage/shared_memory.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class SharedMemory
6161
{
6262
shm = boost::interprocess::xsi_shared_memory(boost::interprocess::open_only, key);
6363

64-
util::Log(logDEBUG) << "opening " << (int)shm.get_shmid() << " from id " << (int)id;
64+
util::Log(logDEBUG) << "opening " << shm.get_shmid() << " from id " << (int)id;
6565

6666
region = boost::interprocess::mapped_region(shm, boost::interprocess::read_only);
6767
}

include/util/concurrent_id_map.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct ConcurrentIDMap
2626
mutable UpgradableMutex mutex;
2727

2828
ConcurrentIDMap() = default;
29-
ConcurrentIDMap(ConcurrentIDMap &&other)
29+
ConcurrentIDMap(ConcurrentIDMap &&other) noexcept
3030
{
3131
if (this != &other)
3232
{
@@ -36,7 +36,7 @@ struct ConcurrentIDMap
3636
data = std::move(other.data);
3737
}
3838
}
39-
ConcurrentIDMap &operator=(ConcurrentIDMap &&other)
39+
ConcurrentIDMap &operator=(ConcurrentIDMap &&other) noexcept
4040
{
4141
if (this != &other)
4242
{

include/util/deallocating_vector.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class DeallocatingVectorIterator
166166

167167
template <typename ElementT> class DeallocatingVector;
168168

169-
template <typename T> void swap(DeallocatingVector<T> &lhs, DeallocatingVector<T> &rhs);
169+
template <typename T> void swap(DeallocatingVector<T> &lhs, DeallocatingVector<T> &rhs) noexcept;
170170

171171
template <typename ElementT> class DeallocatingVector
172172
{
@@ -204,8 +204,8 @@ template <typename ElementT> class DeallocatingVector
204204
}
205205

206206
// moving is fine
207-
DeallocatingVector(DeallocatingVector &&other) { swap(other); }
208-
DeallocatingVector &operator=(DeallocatingVector &&other)
207+
DeallocatingVector(DeallocatingVector &&other) noexcept { swap(other); }
208+
DeallocatingVector &operator=(DeallocatingVector &&other) noexcept
209209
{
210210
swap(other);
211211
return *this;
@@ -221,9 +221,10 @@ template <typename ElementT> class DeallocatingVector
221221

222222
~DeallocatingVector() { clear(); }
223223

224-
friend void swap<>(DeallocatingVector<ElementT> &lhs, DeallocatingVector<ElementT> &rhs);
224+
friend void swap<>(DeallocatingVector<ElementT> &lhs,
225+
DeallocatingVector<ElementT> &rhs) noexcept;
225226

226-
void swap(DeallocatingVector<ElementT> &other)
227+
void swap(DeallocatingVector<ElementT> &other) noexcept
227228
{
228229
std::swap(current_size, other.current_size);
229230
bucket_list.swap(other.bucket_list);
@@ -342,7 +343,7 @@ template <typename ElementT> class DeallocatingVector
342343
}
343344
};
344345

345-
template <typename T> void swap(DeallocatingVector<T> &lhs, DeallocatingVector<T> &rhs)
346+
template <typename T> void swap(DeallocatingVector<T> &lhs, DeallocatingVector<T> &rhs) noexcept
346347
{
347348
lhs.swap(rhs);
348349
}

include/util/dynamic_graph.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ template <typename EdgeDataT> class DynamicGraph
154154
return *this;
155155
}
156156

157-
DynamicGraph(DynamicGraph &&other)
157+
DynamicGraph(DynamicGraph &&other) noexcept
158158
{
159159
number_of_nodes = other.number_of_nodes;
160160
// atomics can't be moved this is why we need an own constructor
@@ -164,7 +164,7 @@ template <typename EdgeDataT> class DynamicGraph
164164
edge_list = std::move(other.edge_list);
165165
}
166166

167-
DynamicGraph &operator=(DynamicGraph &&other)
167+
DynamicGraph &operator=(DynamicGraph &&other) noexcept
168168
{
169169
number_of_nodes = other.number_of_nodes;
170170
// atomics can't be moved this is why we need an own constructor

include/util/permutation.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ namespace osrm::util
1010

1111
namespace permutation_detail
1212
{
13-
template <typename T> static inline void swap(T &a, T &b) { std::swap(a, b); }
13+
template <typename T> static inline void swap(T &a, T &b) noexcept { std::swap(a, b); }
1414

15-
static inline void swap(std::vector<bool>::reference a, std::vector<bool>::reference b)
15+
static inline void swap(std::vector<bool>::reference a, std::vector<bool>::reference b) noexcept
1616
{
1717
std::vector<bool>::swap(a, b);
1818
}

0 commit comments

Comments
 (0)