Skip to content

Commit 1be1885

Browse files
committed
clang-tidy fixes
1 parent 4435a6a commit 1be1885

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/cross_module_gil_utils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ namespace py = pybind11;
3131
void gil_acquire() { py::gil_scoped_acquire gil; }
3232

3333
std::string gil_multi_acquire_release(unsigned bits) {
34-
if (bits & 0x1u) {
34+
if ((bits & 0x1u) != 0u) {
3535
py::gil_scoped_acquire gil;
3636
}
37-
if (bits & 0x2u) {
37+
if ((bits & 0x2u) != 0u) {
3838
py::gil_scoped_release gil;
3939
}
40-
if (bits & 0x4u) {
40+
if ((bits & 0x4u) != 0u) {
4141
py::gil_scoped_acquire gil;
4242
}
43-
if (bits & 0x8u) {
43+
if ((bits & 0x8u) != 0u) {
4444
py::gil_scoped_release gil;
4545
}
4646
return PYBIND11_INTERNALS_ID;

tests/test_gil_scoped.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ TEST_SUBMODULE(gil_scoped, m) {
118118
std::string cm_internals_id = target(bits >> 3);
119119
internals_ids.add(cm_internals_id);
120120
};
121-
if (bits & 0x1u) {
121+
if ((bits & 0x1u) != 0u) {
122122
thread_f();
123123
}
124-
if (bits & 0x2u) {
125-
std::thread non_python_thread(std::move(thread_f));
124+
if ((bits & 0x2u) != 0u) {
125+
std::thread non_python_thread(thread_f);
126126
non_python_thread.join();
127127
}
128-
if (bits & 0x4u) {
128+
if ((bits & 0x4u) != 0u) {
129129
thread_f();
130130
}
131131
}

0 commit comments

Comments
 (0)