Commit 07eba77f authored by Pavel Vainerman's avatar Pavel Vainerman

make style..

parent 6db2f221
...@@ -56,13 +56,15 @@ int main( int argc, const char** argv ) ...@@ -56,13 +56,15 @@ int main( int argc, const char** argv )
auto act = UniSetActivator::Instance(); auto act = UniSetActivator::Instance();
int count = conf->getArgPInt("--count",50); int count = conf->getArgPInt("--count", 50);
for( int i=1; i<=count; i++ )
for( int i = 1; i <= count; i++ )
{ {
ostringstream prefix; ostringstream prefix;
prefix << "mbtcp" << i; prefix << "mbtcp" << i;
auto mb = MBTCPMultiMaster::init_mbmaster(argc, argv,shmID,nullptr, prefix.str()); auto mb = MBTCPMultiMaster::init_mbmaster(argc, argv, shmID, nullptr, prefix.str());
if( !mb ) if( !mb )
{ {
cerr << "(main): " << prefix.str() << " init failed..." << endl; cerr << "(main): " << prefix.str() << " init failed..." << endl;
......
...@@ -229,7 +229,7 @@ namespace UniSetTypes ...@@ -229,7 +229,7 @@ namespace UniSetTypes
ConfirmMessage( const VoidMessage* msg ); ConfirmMessage( const VoidMessage* msg );
ConfirmMessage(ObjectId in_sensor_id, ConfirmMessage(ObjectId in_sensor_id,
double in_sensor_value, const double& in_sensor_value,
const timespec& in_sensor_time, const timespec& in_sensor_time,
const timespec& in_confirm_time, const timespec& in_confirm_time,
Priority in_priority = Message::Medium); Priority in_priority = Message::Medium);
......
...@@ -185,7 +185,7 @@ namespace UniSetTypes ...@@ -185,7 +185,7 @@ namespace UniSetTypes
inline bool operator!=( const struct timespec& r1, const struct timespec& r2 ) inline bool operator!=( const struct timespec& r1, const struct timespec& r2 )
{ {
return !(operator==(r1,r2)); return !(operator==(r1, r2));
} }
/*! Разбивка строки по указанному символу */ /*! Разбивка строки по указанному символу */
......
...@@ -34,7 +34,7 @@ size_t ModbusTCPCore::readNextData(UTCPStream* tcp, ...@@ -34,7 +34,7 @@ size_t ModbusTCPCore::readNextData(UTCPStream* tcp,
#ifdef USE_BUFFER_FOR_READ #ifdef USE_BUFFER_FOR_READ
max = std::max(max,(size_t)DEFAULT_BUFFER_SIZE_FOR_READ); max = std::max(max, (size_t)DEFAULT_BUFFER_SIZE_FOR_READ);
char* buf = new char[max]; char* buf = new char[max];
...@@ -136,7 +136,7 @@ size_t ModbusTCPCore::readDataFD( int fd, std::queue<unsigned char>& qrecv, size ...@@ -136,7 +136,7 @@ size_t ModbusTCPCore::readDataFD( int fd, std::queue<unsigned char>& qrecv, size
#ifdef USE_BUFFER_FOR_READ #ifdef USE_BUFFER_FOR_READ
max = std::max(max,(size_t)DEFAULT_BUFFER_SIZE_FOR_READ); max = std::max(max, (size_t)DEFAULT_BUFFER_SIZE_FOR_READ);
char* buf = new char[max]; char* buf = new char[max];
...@@ -197,7 +197,7 @@ size_t ModbusTCPCore::readDataFD( int fd, std::queue<unsigned char>& qrecv, size ...@@ -197,7 +197,7 @@ size_t ModbusTCPCore::readDataFD( int fd, std::queue<unsigned char>& qrecv, size
if( commfail ) if( commfail )
throw UniSetTypes::CommFailed(); throw UniSetTypes::CommFailed();
return std::min(qrecv.size(),max); return std::min(qrecv.size(), max);
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
size_t ModbusTCPCore::getDataFD( int fd, std::queue<unsigned char>& qrecv, size_t ModbusTCPCore::getDataFD( int fd, std::queue<unsigned char>& qrecv,
......
...@@ -329,7 +329,7 @@ void ModbusTCPMaster::cleanInputStream() ...@@ -329,7 +329,7 @@ void ModbusTCPMaster::cleanInputStream()
} }
while( ret > 0); while( ret > 0);
} }
catch( ... ){} catch( ... ) {}
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void ModbusTCPMaster::setReadTimeout( timeout_t msec ) void ModbusTCPMaster::setReadTimeout( timeout_t msec )
......
...@@ -88,7 +88,8 @@ SimpleInfo* IONotifyController::getInfo( ::CORBA::Long userparam ) ...@@ -88,7 +88,8 @@ SimpleInfo* IONotifyController::getInfo( ::CORBA::Long userparam )
auto oind = uniset_conf()->oind; auto oind = uniset_conf()->oind;
uniset_rwmutex_rlock lock(askIOMutex); uniset_rwmutex_rlock lock(askIOMutex);
for( auto&& a: askIOList )
for( auto && a : askIOList )
{ {
auto& i = a.second; auto& i = a.second;
...@@ -100,7 +101,7 @@ SimpleInfo* IONotifyController::getInfo( ::CORBA::Long userparam ) ...@@ -100,7 +101,7 @@ SimpleInfo* IONotifyController::getInfo( ::CORBA::Long userparam )
inf << "(" << setw(6) << a.first << ")[" << oind->getMapName(a.first) << "]" << endl; inf << "(" << setw(6) << a.first << ")[" << oind->getMapName(a.first) << "]" << endl;
for( const auto& c: i.clst ) for( const auto& c : i.clst )
{ {
inf << " " << "(" << setw(6) << c.id << ")" inf << " " << "(" << setw(6) << c.id << ")"
<< setw(35) << ORepHelpers::getShortName(oind->getMapName(c.id)) << setw(35) << ORepHelpers::getShortName(oind->getMapName(c.id))
......
...@@ -442,6 +442,7 @@ void NCRestorer_XML::read_consumers( const std::shared_ptr<UniXML>& xml, xmlNode ...@@ -442,6 +442,7 @@ void NCRestorer_XML::read_consumers( const std::shared_ptr<UniXML>& xml, xmlNode
if( cit.goChildren() ) if( cit.goChildren() )
{ {
IONotifyController::ConsumerListInfo lst; IONotifyController::ConsumerListInfo lst;
if( getConsumerList(xml, cit, lst) ) if( getConsumerList(xml, cit, lst) )
{ {
std::shared_ptr<IOController::USensorInfo> uinf = std::static_pointer_cast<IOController::USensorInfo>(inf); std::shared_ptr<IOController::USensorInfo> uinf = std::static_pointer_cast<IOController::USensorInfo>(inf);
......
...@@ -196,7 +196,7 @@ namespace UniSetTypes ...@@ -196,7 +196,7 @@ namespace UniSetTypes
} }
//-------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------
ConfirmMessage::ConfirmMessage(UniSetTypes::ObjectId in_sensor_id, ConfirmMessage::ConfirmMessage(UniSetTypes::ObjectId in_sensor_id,
double in_sensor_value, const double& in_sensor_value,
const timespec& in_sensor_time, const timespec& in_sensor_time,
const timespec& in_confirm_time, const timespec& in_confirm_time,
Priority in_priority ): Priority in_priority ):
......
...@@ -30,7 +30,7 @@ int main( int argc, const char** argv ) ...@@ -30,7 +30,7 @@ int main( int argc, const char** argv )
return 0; return 0;
std::chrono::time_point<std::chrono::system_clock> p1, p2, p3; std::chrono::time_point<std::chrono::system_clock> p1, p2, p3;
p2 = std::chrono::system_clock::now(); p2 = std::chrono::system_clock::now();
p3 = p2 - std::chrono::hours(24); p3 = p2 - std::chrono::hours(24);
......
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