diff options
author | Hans Goudey <h.goudey@me.com> | 2022-10-04 01:37:25 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-10-04 01:38:16 +0300 |
commit | 97746129d5870beedc40e3c035c7982ce8a6bebc (patch) | |
tree | b819b8e7875e6684aad7ea1f6bb7922d4fa1c8fc /source/blender/blenlib/tests | |
parent | ed7f5713f8f9d605e3cd4cce42e40fb5c6bf4bf5 (diff) |
Cleanup: replace UNUSED macro with commented args in C++ code
This is the conventional way of dealing with unused arguments in C++,
since it works on all compilers.
Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
Diffstat (limited to 'source/blender/blenlib/tests')
8 files changed, 20 insertions, 21 deletions
diff --git a/source/blender/blenlib/tests/BLI_cpp_type_test.cc b/source/blender/blenlib/tests/BLI_cpp_type_test.cc index 6a59bedc649..5823d54f51b 100644 --- a/source/blender/blenlib/tests/BLI_cpp_type_test.cc +++ b/source/blender/blenlib/tests/BLI_cpp_type_test.cc @@ -63,7 +63,7 @@ struct TestType { return stream; } - friend bool operator==(const TestType &UNUSED(a), const TestType &UNUSED(b)) + friend bool operator==(const TestType & /*a*/, const TestType & /*b*/) { return false; } diff --git a/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc b/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc index adcfe7f5d2d..ca99c678754 100644 --- a/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc +++ b/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc @@ -110,7 +110,7 @@ static int get_orig_index(const Array<Vector<int>> &out_to_orig, int orig_index) return -1; } -template<typename T> static double math_to_double(const T UNUSED(v)) +template<typename T> static double math_to_double(const T /*v*/) { BLI_assert(false); /* Need implementation for other type. */ return 0.0; diff --git a/source/blender/blenlib/tests/BLI_map_test.cc b/source/blender/blenlib/tests/BLI_map_test.cc index 0ca07309836..69ae82d6f05 100644 --- a/source/blender/blenlib/tests/BLI_map_test.cc +++ b/source/blender/blenlib/tests/BLI_map_test.cc @@ -560,8 +560,8 @@ TEST(map, PopExceptions) TEST(map, AddOrModifyExceptions) { Map<ExceptionThrower, ExceptionThrower> map; - auto create_fn = [](ExceptionThrower *UNUSED(v)) { throw std::runtime_error(""); }; - auto modify_fn = [](ExceptionThrower *UNUSED(v)) {}; + auto create_fn = [](ExceptionThrower * /*v*/) { throw std::runtime_error(""); }; + auto modify_fn = [](ExceptionThrower * /*v*/) {}; EXPECT_ANY_THROW({ map.add_or_modify(3, create_fn, modify_fn); }); } diff --git a/source/blender/blenlib/tests/BLI_memory_utils_test.cc b/source/blender/blenlib/tests/BLI_memory_utils_test.cc index ab716e5d011..939ac6151b0 100644 --- a/source/blender/blenlib/tests/BLI_memory_utils_test.cc +++ b/source/blender/blenlib/tests/BLI_memory_utils_test.cc @@ -20,7 +20,7 @@ struct MyValue { alive++; } - MyValue(const MyValue &UNUSED(other)) + MyValue(const MyValue & /*other*/) { if (alive == 15) { throw std::exception(); diff --git a/source/blender/blenlib/tests/BLI_mesh_boolean_test.cc b/source/blender/blenlib/tests/BLI_mesh_boolean_test.cc index fabc2412828..ea324534d78 100644 --- a/source/blender/blenlib/tests/BLI_mesh_boolean_test.cc +++ b/source/blender/blenlib/tests/BLI_mesh_boolean_test.cc @@ -106,7 +106,7 @@ class IMeshBuilder { } }; -static int all_shape_zero(int UNUSED(t)) +static int all_shape_zero(int /*t*/) { return 0; } diff --git a/source/blender/blenlib/tests/BLI_task_test.cc b/source/blender/blenlib/tests/BLI_task_test.cc index a933d45e7cd..63bb767466f 100644 --- a/source/blender/blenlib/tests/BLI_task_test.cc +++ b/source/blender/blenlib/tests/BLI_task_test.cc @@ -27,7 +27,7 @@ static void task_range_iter_func(void *userdata, int index, const TaskParallelTL // printf("%d, %d, %d\n", index, data[index], *((int *)tls->userdata_chunk)); } -static void task_range_iter_reduce_func(const void *__restrict UNUSED(userdata), +static void task_range_iter_reduce_func(const void *__restrict /*userdata*/, void *__restrict join_v, void *__restrict userdata_chunk) { @@ -71,7 +71,7 @@ TEST(task, RangeIter) static void task_mempool_iter_func(void *userdata, MempoolIterData *item, - const TaskParallelTLS *__restrict UNUSED(tls)) + const TaskParallelTLS *__restrict /*tls*/) { int *data = (int *)item; int *count = (int *)userdata; @@ -147,7 +147,7 @@ using TaskMemPool_Chunk = struct TaskMemPool_Chunk { ListBase *accumulate_items; }; -static void task_mempool_iter_tls_func(void *UNUSED(userdata), +static void task_mempool_iter_tls_func(void * /*userdata*/, MempoolIterData *item, const TaskParallelTLS *__restrict tls) { @@ -165,7 +165,7 @@ static void task_mempool_iter_tls_func(void *UNUSED(userdata), BLI_addtail(task_data->accumulate_items, BLI_genericNodeN(data)); } -static void task_mempool_iter_tls_reduce(const void *__restrict UNUSED(userdata), +static void task_mempool_iter_tls_reduce(const void *__restrict /*userdata*/, void *__restrict chunk_join, void *__restrict chunk) { @@ -180,8 +180,7 @@ static void task_mempool_iter_tls_reduce(const void *__restrict UNUSED(userdata) } } -static void task_mempool_iter_tls_free(const void *UNUSED(userdata), - void *__restrict userdata_chunk) +static void task_mempool_iter_tls_free(const void * /*userdata*/, void *__restrict userdata_chunk) { TaskMemPool_Chunk *task_data = (TaskMemPool_Chunk *)userdata_chunk; MEM_freeN(task_data->accumulate_items); @@ -240,7 +239,7 @@ TEST(task, MempoolIterTLS) static void task_listbase_iter_func(void *userdata, void *item, int index, - const TaskParallelTLS *__restrict UNUSED(tls)) + const TaskParallelTLS *__restrict /*tls*/) { LinkData *data = (LinkData *)item; int *count = (int *)userdata; diff --git a/source/blender/blenlib/tests/BLI_vector_test.cc b/source/blender/blenlib/tests/BLI_vector_test.cc index c603f5dff27..29bf6c0cfb1 100644 --- a/source/blender/blenlib/tests/BLI_vector_test.cc +++ b/source/blender/blenlib/tests/BLI_vector_test.cc @@ -506,11 +506,11 @@ class TypeConstructMock { { } - TypeConstructMock(const TypeConstructMock &UNUSED(other)) : copy_constructed(true) + TypeConstructMock(const TypeConstructMock & /*other*/) : copy_constructed(true) { } - TypeConstructMock(TypeConstructMock &&UNUSED(other)) noexcept : move_constructed(true) + TypeConstructMock(TypeConstructMock && /*other*/) noexcept : move_constructed(true) { } diff --git a/source/blender/blenlib/tests/performance/BLI_task_performance_test.cc b/source/blender/blenlib/tests/performance/BLI_task_performance_test.cc index adebb1edb8b..68fdf4031ab 100644 --- a/source/blender/blenlib/tests/performance/BLI_task_performance_test.cc +++ b/source/blender/blenlib/tests/performance/BLI_task_performance_test.cc @@ -36,10 +36,10 @@ static uint gen_pseudo_random_number(uint num) /* *** Parallel iterations over double-linked list items. *** */ -static void task_listbase_light_iter_func(void *UNUSED(userdata), +static void task_listbase_light_iter_func(void * /*userdata*/, void *item, int index, - const TaskParallelTLS *__restrict UNUSED(tls)) + const TaskParallelTLS *__restrict /*tls*/) { LinkData *data = (LinkData *)item; @@ -50,7 +50,7 @@ static void task_listbase_light_iter_func(void *UNUSED(userdata), static void task_listbase_light_membarrier_iter_func(void *userdata, void *item, int index, - const TaskParallelTLS *__restrict UNUSED(tls)) + const TaskParallelTLS *__restrict /*tls*/) { LinkData *data = (LinkData *)item; @@ -60,10 +60,10 @@ static void task_listbase_light_membarrier_iter_func(void *userdata, atomic_sub_and_fetch_uint32((uint32_t *)count, 1); } -static void task_listbase_heavy_iter_func(void *UNUSED(userdata), +static void task_listbase_heavy_iter_func(void * /*userdata*/, void *item, int index, - const TaskParallelTLS *__restrict UNUSED(tls)) + const TaskParallelTLS *__restrict /*tls*/) { LinkData *data = (LinkData *)item; @@ -79,7 +79,7 @@ static void task_listbase_heavy_iter_func(void *UNUSED(userdata), static void task_listbase_heavy_membarrier_iter_func(void *userdata, void *item, int index, - const TaskParallelTLS *__restrict UNUSED(tls)) + const TaskParallelTLS *__restrict /*tls*/) { LinkData *data = (LinkData *)item; |