Skip to content

Commit 8d4f676

Browse files
committed
squash! squash! fixup! squash! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Code Quality: Address shadowing
Removed explicit template from unique_ptr throughout codebase
1 parent 82bdae8 commit 8d4f676

File tree

92 files changed

+165
-163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+165
-163
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
/Testing
1717
/logs
1818
!build_qnx/*
19+
CMakeUserPresets.json

examples/hello_world/hello_world_service.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class hello_world_service {
7979

8080
void stop()
8181
{
82-
std::unique_lock<std::mutex> its_lock(mutex_);
82+
std::unique_lock its_lock{mutex_};
8383
while(!stop_) {
8484
condition_.wait(its_lock);
8585
}

examples/notify-sample.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class service_sample {
153153
}
154154

155155
void run() {
156-
std::unique_lock<std::mutex> its_lock(mutex_);
156+
std::unique_lock its_lock{mutex_};
157157
while (!blocked_)
158158
condition_.wait(its_lock);
159159

@@ -177,7 +177,7 @@ class service_sample {
177177
uint32_t its_size = 1;
178178

179179
while (running_) {
180-
std::unique_lock<std::mutex> its_lock(notify_mutex_);
180+
std::unique_lock its_lock{notify_mutex_};
181181
while (!is_offered_ && running_)
182182
notify_condition_.wait(its_lock);
183183
while (is_offered_ && running_) {

examples/request-sample.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class client_sample {
151151
void run() {
152152
while (running_) {
153153
{
154-
std::unique_lock<std::mutex> its_lock(mutex_);
154+
std::unique_lock its_lock{mutex_};
155155
while (!blocked_) condition_.wait(its_lock);
156156
if (is_available_) {
157157
app_->send(request_);

examples/response-sample.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class service_sample {
116116
}
117117

118118
void run() {
119-
std::unique_lock<std::mutex> its_lock(mutex_);
119+
std::unique_lock its_lock{mutex_};
120120
while (!blocked_)
121121
condition_.wait(its_lock);
122122

implementation/configuration/src/configuration_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3051,7 +3051,7 @@ const std::string & configuration_impl::get_logfile() const {
30513051
}
30523052

30533053
vsomeip_v3::logger::level_e configuration_impl::get_loglevel() const {
3054-
std::unique_lock<std::mutex> its_lock(mutex_loglevel_);
3054+
std::unique_lock its_lock{mutex_loglevel_};
30553055
return loglevel_;
30563056
}
30573057

implementation/endpoints/src/endpoint_manager_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ bool endpoint_manager_impl::on_bind_error(std::shared_ptr<endpoint> _endpoint,
976976
uint16_t its_old_local_port = _endpoint->get_local_port();
977977
uint16_t its_new_local_port(ILLEGAL_PORT);
978978

979-
std::unique_lock<std::mutex> its_lock(used_client_ports_mutex_);
979+
std::unique_lock its_lock{used_client_ports_mutex_};
980980
std::map<bool, std::set<port_t> > its_used_client_ports;
981981
get_used_client_ports(_remote_address, _remote_port, its_used_client_ports);
982982
if (configuration_->get_client_port(
@@ -1346,7 +1346,7 @@ endpoint_manager_impl::add_multicast_option(const multicast_option_t &_option) {
13461346
void
13471347
endpoint_manager_impl::process_multicast_options() {
13481348

1349-
std::unique_lock<std::mutex> its_lock(options_mutex_);
1349+
std::unique_lock its_lock{options_mutex_};
13501350
while (is_processing_options_) {
13511351
if (options_queue_.size() > 0
13521352
&& static_cast<routing_manager_impl*>(rm_)->is_external_routing_ready()) {

implementation/endpoints/src/local_tcp_client_endpoint_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void local_tcp_client_endpoint_impl::stop() {
115115

116116
void local_tcp_client_endpoint_impl::connect() {
117117
boost::system::error_code its_connect_error;
118-
std::unique_lock<std::mutex> its_lock(socket_mutex_);
118+
std::unique_lock its_lock{socket_mutex_};
119119
boost::system::error_code its_error;
120120
socket_->open(remote_.protocol(), its_error);
121121
if (!its_error || its_error == boost::asio::error::already_open) {

implementation/endpoints/src/local_tcp_server_endpoint_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void local_tcp_server_endpoint_impl::accept_cbk(
235235
boost::system::error_code its_error;
236236
endpoint_type remote;
237237
{
238-
std::unique_lock<std::mutex> its_socket_lock(_connection->get_socket_lock());
238+
std::unique_lock its_socket_lock{_connection->get_socket_lock()};
239239
socket_type &new_connection_socket = _connection->get_socket();
240240

241241
// Nagle algorithm off
@@ -867,7 +867,7 @@ void local_tcp_server_endpoint_impl::print_status() {
867867

868868
std::size_t its_recv_size(0);
869869
{
870-
std::unique_lock<std::mutex> c_s_lock(c.second->get_socket_lock());
870+
std::unique_lock c_s_lock{c.second->get_socket_lock()};
871871
its_recv_size = c.second->get_recv_buffer_capacity();
872872
}
873873

implementation/endpoints/src/local_uds_client_endpoint_impl.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void local_uds_client_endpoint_impl::restart(bool _force) {
5656
queue_size_ = 0;
5757
}
5858
{
59-
std::lock_guard<std::mutex> its_lock(socket_mutex_);
59+
std::lock_guard its_lock(socket_mutex_);
6060
shutdown_and_close_socket_unlocked(true);
6161
}
6262
state_ = cei_state_e::CONNECTING;
@@ -77,19 +77,19 @@ void local_uds_client_endpoint_impl::start() {
7777

7878
void local_uds_client_endpoint_impl::stop() {
7979
{
80-
std::lock_guard<std::recursive_mutex> its_lock(mutex_);
80+
std::lock_guard its_lock(mutex_);
8181
sending_blocked_ = true;
8282
}
8383
{
84-
std::lock_guard<std::mutex> its_lock(connect_timer_mutex_);
84+
std::lock_guard its_lock(connect_timer_mutex_);
8585
boost::system::error_code ec;
8686
connect_timer_.cancel(ec);
8787
}
8888
connect_timeout_ = VSOMEIP_DEFAULT_CONNECT_TIMEOUT;
8989

9090
bool is_open(false);
9191
{
92-
std::lock_guard<std::mutex> its_lock(socket_mutex_);
92+
std::lock_guard its_lock(socket_mutex_);
9393
is_open = socket_->is_open();
9494
}
9595
if (is_open) {
@@ -116,7 +116,7 @@ void local_uds_client_endpoint_impl::connect() {
116116
start_connecting_timer();
117117
boost::system::error_code its_connect_error;
118118
{
119-
std::lock_guard<std::mutex> its_lock(socket_mutex_);
119+
std::lock_guard its_lock(socket_mutex_);
120120
boost::system::error_code its_error;
121121
socket_->open(remote_.protocol(), its_error);
122122

@@ -153,7 +153,7 @@ void local_uds_client_endpoint_impl::connect() {
153153
}
154154
std::size_t operations_cancelled;
155155
{
156-
std::lock_guard<std::mutex> its_lock(connecting_timer_mutex_);
156+
std::lock_guard its_lock(connecting_timer_mutex_);
157157
operations_cancelled = connecting_timer_.cancel();
158158
connecting_timer_state_ = connecting_timer_state_e::FINISH_ERROR;
159159
if (operations_cancelled != 0) {
@@ -174,7 +174,7 @@ void local_uds_client_endpoint_impl::connect() {
174174
}
175175

176176
void local_uds_client_endpoint_impl::receive() {
177-
std::lock_guard<std::mutex> its_lock(socket_mutex_);
177+
std::lock_guard its_lock(socket_mutex_);
178178
if (socket_->is_open()) {
179179
socket_->async_receive(
180180
boost::asio::buffer(recv_buffer_),
@@ -232,7 +232,7 @@ void local_uds_client_endpoint_impl::send_queued(std::pair<message_buffer_ptr_t,
232232
bufs.push_back(boost::asio::buffer(its_end_tag));
233233

234234
{
235-
std::lock_guard<std::mutex> its_lock(socket_mutex_);
235+
std::lock_guard its_lock(socket_mutex_);
236236
if(socket_->is_open()) {
237237
boost::asio::async_write(
238238
*socket_, bufs,
@@ -284,7 +284,7 @@ void local_uds_client_endpoint_impl::receive_cbk(
284284
}
285285
error_handler_t handler;
286286
{
287-
std::lock_guard<std::mutex> its_lock(error_handler_mutex_);
287+
std::lock_guard its_lock(error_handler_mutex_);
288288
handler = error_handler_;
289289
}
290290
if (handler)
@@ -391,7 +391,7 @@ void local_uds_client_endpoint_impl::max_allowed_reconnects_reached() {
391391
<< get_remote_information();
392392
error_handler_t handler;
393393
{
394-
std::lock_guard<std::mutex> its_lock(error_handler_mutex_);
394+
std::lock_guard its_lock(error_handler_mutex_);
395395
handler = error_handler_;
396396
}
397397
if (handler)

0 commit comments

Comments
 (0)