diff --git a/src/tmx/TmxCore/src/MessageRouterBasic.cpp b/src/tmx/TmxCore/src/MessageRouterBasic.cpp index 4ac9a61d1..75e0e368f 100644 --- a/src/tmx/TmxCore/src/MessageRouterBasic.cpp +++ b/src/tmx/TmxCore/src/MessageRouterBasic.cpp @@ -52,8 +52,7 @@ void MessageRouterBasic::broadcastMessage(MessageReceiver *sender, IvpMessage *m pthread_mutex_lock(&this->mActiveBroadcastsLock); // Volatile type should not be used in compound operations cpp:S6191 - auto val = this->mActiveBroadcasts; - this->mActiveBroadcasts = val + 1; + this->mActiveBroadcasts++; pthread_mutex_unlock(&this->mActiveBroadcastsLock); int broadcastCount = 0; @@ -107,10 +106,10 @@ void MessageRouterBasic::broadcastMessage(MessageReceiver *sender, IvpMessage *m } } } + // Volatile type should not be used in compound operations cpp:S6191 pthread_mutex_lock(&this->mActiveBroadcastsLock); - auto val = this->mActiveBroadcasts; - this->mActiveBroadcasts = val - 1; + this->mActiveBroadcasts--; pthread_mutex_unlock(&this->mActiveBroadcastsLock); //LOG_DEBUG("MessageRouterBasic::broadcastMessage for " << msg->subtype << " from "<< sender->pluginName << " Time (ms) "<