Commit e3418768 authored by Vitaly Lipatov's avatar Vitaly Lipatov

fix code style (add missed spaces)

parent 8673fe98
......@@ -1194,7 +1194,7 @@ int getValue(string args, UniversalInterface &ui )
int getCalibrate(string arg, UniversalInterface &ui)
{
UniSetTypes::ObjectId sid(uni_atoi(arg));
if( sid<=0 )
if( sid <= 0 )
{
cout << "(getCalibrate): SensorId !!!!!!"<< endl;
return 1;
......
......@@ -341,7 +341,7 @@ ModbusRTU::mbErrCode MBSlave::fileTransfer( ModbusRTU::FileTransferMessage& quer
std::string fname(it->second);
int fd = open(fname.c_str(), O_RDONLY | O_NONBLOCK );
if( fd <=0 )
if( fd <= 0 )
{
dlog[Debug::WARN] << "(fileTransfer): open '" << fname << "' with error: " << strerror(errno) << endl;
return ModbusRTU::erOperationFailed;
......
......@@ -341,7 +341,7 @@ ModbusRTU::mbErrCode MBTCPServer::fileTransfer( ModbusRTU::FileTransferMessage&
std::string fname(it->second);
int fd = open(fname.c_str(), O_RDONLY | O_NONBLOCK );
if( fd <=0 )
if( fd <= 0 )
{
dlog[Debug::WARN] << "(fileTransfer): open '" << fname << "' with error: " << strerror(errno) << endl;
return ModbusRTU::erOperationFailed;
......
......@@ -612,7 +612,7 @@ void SharedMemory::buildHistoryList( xmlNode* cnode )
HistoryInfo hi;
hi.id = it.getIntProp("id");
hi.size = it.getIntProp("size");
if( hi.size <=0 )
if( hi.size <= 0 )
continue;
hi.filter = it.getProp("filter");
......
......@@ -566,7 +566,7 @@ bool UDPExchange::initItem( UniXML_iterator& it )
if( !tid.empty() )
{
sid = UniSetTypes::uni_atoi(tid);
if( sid<=0 )
if( sid <= 0 )
sid = DefaultObjectId;
}
else
......
......@@ -96,7 +96,7 @@ double DigitalFilter::firstLevel()
//--------------------------------------------------------------------------
int DigitalFilter::filterRC( int rawval )
{
if( Ti<=0 )
if( Ti <= 0 )
return rawval;
return lroundf(secondLevel(rawval));
......@@ -105,7 +105,7 @@ int DigitalFilter::filterRC( int rawval )
double DigitalFilter::secondLevel( double rawval )
{
if( Ti<=0 )
if( Ti <= 0 )
return rawval;
//
......
......@@ -16,7 +16,7 @@ std::ostream& operator<<( std::ostream& os, IOBase& inf )
bool IOBase::check_channel_break( long val )
{
// ... ( )
if( breaklim <=0 )
if( breaklim <= 0 )
return false;
return ( val < breaklim );
......
......@@ -205,7 +205,7 @@ unsigned char ComPort::m_receiveByte( bool wait )
}
else
bufLength=read(fd,buf,BufSize);
if(bufLength<=0)
if(bufLength <= 0)
{
throw UniSetTypes::TimeOut();
}
......
......@@ -123,7 +123,7 @@ unsigned char ComPort485F::m_receiveByte( bool wait )
}
}
if( rc<=0 )
if( rc <= 0 )
throw UniSetTypes::TimeOut();
}
......
......@@ -222,7 +222,7 @@ void ModbusClient::fileTransfer( ModbusAddr addr, ModbusData numfile,
<< ret.numpacks << " curpack=" << curpack+1 << endl;
// save data...
if( fwrite(&ret.data,ret.dlen,1,fdsave) <=0 )
if( fwrite(&ret.data,ret.dlen,1,fdsave) <= 0 )
{
dlog[Debug::WARN] << "(fileTransfer): fwrite '"
<< save2filename << "' with error: "
......
......@@ -1121,7 +1121,7 @@ ModbusRTU::mbErrCode ModbusServer::replyFileTransfer( const std::string fname,
(*dlog)[Debug::INFO] << "(replyFileTransfer): " << query << endl;
int fd = open(fname.c_str(), O_RDONLY | O_NONBLOCK );
if( fd <=0 )
if( fd <= 0 )
{
if( dlog && dlog->debugging(Debug::WARN) )
(*dlog)[Debug::WARN] << "(replyFileTransfer): open '" << fname << "' with error: " << strerror(errno) << endl;
......
......@@ -16,7 +16,7 @@ int ModbusTCPCore::readNextData( ost::TCPStream* tcp,
{
char c;
tcp->read(&c,sizeof(c));
if( tcp->gcount()<=0 )
if( tcp->gcount() <= 0 )
break;
qrecv.push( (unsigned char)(c) );
......@@ -34,12 +34,12 @@ int ModbusTCPCore::getNextData( unsigned char* buf, int len,
if( qrecv.empty() )
{
if( len <=0 )
if( len <= 0 )
len = 7;
int ret = ModbusTCPCore::readNextData(tcp,qrecv,len);
if( ret <=0 )
if( ret <= 0 )
return 0;
}
......
......@@ -382,13 +382,13 @@ bool CycleStorage::delAllRows()
/*! TODO: str, */
void* CycleStorage::readRow(int num, void* str)
{
if( size<=0 ) return 0;
if( size <= 0 ) return NULL;
/*! */
int j=(head+num)%size;
if((file==NULL)||(num>=size)) return 0;
if((file==NULL)||(num>=size)) return NULL;
if((head!=tail+1)&&(num>tail)&&(head!=tail)) return 0;
if((head!=tail+1)&&(num>tail)&&(head!=tail)) return NULL;
CycleStorageElem *jrn = (CycleStorageElem*)new char[full_size];
fseek(file,seekpos+j*full_size,0);
......
......@@ -153,7 +153,7 @@ uniset_mutex::uniset_mutex( const uniset_mutex& r ):
uniset_mutex_lock::uniset_mutex_lock( uniset_mutex& m, int timeMS ):
mutex(&m)
{
if( timeMS<=0 || mutex->isRelease() )
if( timeMS <= 0 || mutex->isRelease() )
{
mutex->lock();
mutex_atomic_set(&mlock,1);
......
......@@ -9,7 +9,6 @@ PassiveTimer pt(1000);
int main()
{
PassiveTimer pt1(5000);
cout << " pt1.getInterval()=" << pt1.getInterval() << endl;
......
......@@ -13,7 +13,7 @@ int main( int argc, const char **argv )
uniset_init(argc,argv,"test.xml");
int id = conf->getArgInt("--sid");
if( id <=0 )
if( id <= 0 )
{
cerr << "unknown sensor ID. Use --sid " << endl;
return 1;
......
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