Commit 8077b2fb authored by Pavel Vainerman's avatar Pavel Vainerman

(step 3): fixes after coverity scan

parent 053f990d
......@@ -422,12 +422,6 @@ void MBTCPMultiMaster::MBSlaveInfo::setUse( bool st )
use = st;
}
// -----------------------------------------------------------------------------
bool MBTCPMultiMaster::MBSlaveInfo::isUse()
{
std::lock_guard<std::mutex> l(mutInit);
return use;
}
// -----------------------------------------------------------------------------
bool MBTCPMultiMaster::MBSlaveInfo::init( std::shared_ptr<DebugStream>& mblog )
{
std::lock_guard<std::mutex> l(mutInit);
......@@ -543,7 +537,11 @@ void MBTCPMultiMaster::check_thread()
{
bool set = it->respond_invert ? !r : r;
shm->localSetValue(it->respond_it, it->respond_id, (set ? 1 : 0), getId());
it->respond_init = true;
{
std::lock_guard<std::mutex> l(it->mutInit);
it->respond_init = true;
}
}
}
catch( const uniset::Exception& ex )
......
......@@ -354,7 +354,6 @@ namespace uniset
bool init( std::shared_ptr<DebugStream>& mblog );
bool check();
void setUse( bool st );
bool isUse();
timeout_t recv_timeout;
timeout_t aftersend_pause;
......
......@@ -63,7 +63,7 @@ namespace uniset
std::mutex looprunOK_mutex;
std::condition_variable looprunOK_event;
std::atomic_bool isrunning;
std::atomic_bool isrunning = { false };
ev::timer evruntimer;
};
// -------------------------------------------------------------------------
......
......@@ -757,7 +757,9 @@ namespace uniset
void ReadInputStatusMessage::init( const ModbusMessage& m )
{
assert( m.pduhead.func == fnReadInputStatus );
memcpy(this, &(m.pduhead), sizeof(m.pduhead) + szData());
func = m.pduhead.func;
addr = m.pduhead.addr;
memcpy(&start, &m.data, szData());
// переворачиваем слова
start = SWAPSHORT(start);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment