Commit c76b0321 authored by Vitaly Lipatov's avatar Vitaly Lipatov

исправлено сравнение типов: string, указателей с NULL

parent 5a7336a6
......@@ -29,7 +29,7 @@ void Element::addChildOut( Element* el, int num )
//
// el myid
if( el->find(myid) != 0 )
if( el->find(myid) != NULL )
{
ostringstream msg;
msg << "(" << myid << "): !!!\n";
......@@ -74,7 +74,7 @@ Element* Element::find( ElementID id )
return it->el;
Element* el( it->el->find(id) );
if( el != 0 )
if( el != NULL )
return el;
}
......
......@@ -243,7 +243,7 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
// Init MessageInterface
{
xmlNode* cnode = unixml.findNode(unixml.getFirstNode(),"messages");
if( !cnode )
if( cnode == NULL )
mi = new DefaultMessageInterface();
else
{
......@@ -713,7 +713,7 @@ void Configuration::initNode( UniSetTypes::NodeInfo& ninfo, UniXML_iterator& it
string Configuration::getPropByNodeName(const string& nodename, const string& prop)
{
xmlNode* node = getNode(nodename);
if(!node)
if(node == NULL)
return "";
return getProp(node,prop);
......@@ -730,7 +730,7 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname )
string debname(_debname);
xmlNode* dnode = conf->getNode(_debname);
if( !dnode )
if( dnode == NULL )
{
deb << "(Configuration)(initDebug): WARNING! " << _debname << endl;
// , DebugStream
......@@ -744,7 +744,7 @@ xmlNode* Configuration::initDebug( DebugStream& deb, const string& _debname )
string no_deb("--"+debname+"-no-debug");
for (int i=1; i<_argc; i++)
{
if( !strcmp(_argv[i],no_deb.c_str()) )
if( no_deb == _argv[i] )
{
deb.addLevel(Debug::NONE);
return dnode;
......@@ -794,7 +794,7 @@ void Configuration::initRepSections()
{
// ֣
xmlNode* node( unixml.findNode(unixml.getFirstNode(),"RootSection") );
if( node==0 )
if( node == NULL )
{
ostringstream msg;
msg << "Configuration(initRepSections): RootSection . " << fileConfName;
......@@ -812,7 +812,7 @@ void Configuration::initRepSections()
string Configuration::getRepSectionName( const string sec, xmlNode* secnode )
{
xmlNode* node = unixml.findNode(unixml.getFirstNode(),sec);
if( node==0 )
if( node == NULL )
{
ostringstream msg;
msg << "Configuration(initRepSections): " << sec << " . " << fileConfName;
......
......@@ -130,7 +130,7 @@ ci(ci),
threshold(false),
tid(UniSetTypes::DefaultThresholdId)
{
state = value!=0 ? true:false;
state = value != 0;
type = Message::SensorInfo;
this->priority = priority;
this->consumer = consumer;
......
......@@ -216,7 +216,7 @@ xmlNode* Restorer_XML::find_node( UniXML& xml, xmlNode* root,
if( nm.empty() )
return it;
if( xml.getProp(it, "name")==nm )
if( xml.getProp(it, "name") == nm )
return it;
}
}
......
......@@ -354,9 +354,9 @@ bool UniXML_iterator::goNext()
return false;
curNode = curNode->next;
if ( getName() == string("text") )
if ( getName() == "text" )
return goNext();
if ( getName() == string("comment") )
if ( getName() == "comment" )
return goNext();
return true;
}
......@@ -367,9 +367,9 @@ bool UniXML_iterator::goThrowNext()
if (!node)
return false;
curNode = node;
if ( getName() == string("text") )
if ( getName() == "text" )
return goThrowNext();
if ( getName() == string("comment") )
if ( getName() == "comment" )
return goThrowNext();
return true;
}
......@@ -379,9 +379,9 @@ bool UniXML_iterator::goPrev()
if( !curNode ) // || !curNode->prev )
return false;
curNode = curNode->prev;
if ( getName() == string("text") )
if ( getName() == "text" )
return goPrev();
if ( getName() == string("comment") )
if ( getName() == "comment" )
return goPrev();
return true;
}
......@@ -420,11 +420,11 @@ bool UniXML_iterator::goChildren()
xmlNode* tmp(curNode);
curNode = curNode->children;
// xmlIsBlankNode,
if ( getName() == string("text") )
if ( getName() == "text" )
return goNext();
if ( getName() == string("comment") )
if ( getName() == "comment" )
return goNext();
if ( getName() == string("") )
if ( getName().empty() )
{
curNode = tmp;
return false;
......
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