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