[libxml++] Use nullptr instead of 0 at missing places - C++-11
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml++] Use nullptr instead of 0 at missing places - C++-11
- Date: Thu, 8 Oct 2015 09:26:39 +0000 (UTC)
commit a96e5fa354cb59e8300a77d0b85df7332887f2c6
Author: Gaurav Gupta <g gupta samsung com>
Date: Thu Oct 8 12:59:47 2015 +0530
Use nullptr instead of 0 at missing places - C++-11
libxml++/document.cc | 6 +++---
libxml++/nodes/element.cc | 24 ++++++++++++------------
libxml++/nodes/node.cc | 12 ++++++------
libxml++/parsers/textreader.cc | 4 ++--
4 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/libxml++/document.cc b/libxml++/document.cc
index fed1718..f85d70e 100644
--- a/libxml++/document.cc
+++ b/libxml++/document.cc
@@ -201,7 +201,7 @@ Dtd* Document::get_internal_subset() const
{
auto dtd = xmlGetIntSubset(impl_);
if(!dtd)
- return 0;
+ return nullptr;
if(!dtd->_private)
dtd->_private = new Dtd(dtd);
@@ -226,7 +226,7 @@ Element* Document::get_root_node()
{
auto root = xmlDocGetRootElement(impl_);
if(root == nullptr)
- return 0;
+ return nullptr;
else
{
Node::create_wrapper(root);
@@ -270,7 +270,7 @@ Element* Document::create_root_node_by_import(const Node* node,
bool recursive)
{
if (!node)
- return 0;
+ return nullptr;
//Create the node, by copying:
auto imported_node = xmlDocCopyNode(const_cast<xmlNode*>(node->cobj()), impl_, recursive);
diff --git a/libxml++/nodes/element.cc b/libxml++/nodes/element.cc
index cb9baa9..62a6605 100644
--- a/libxml++/nodes/element.cc
+++ b/libxml++/nodes/element.cc
@@ -67,7 +67,7 @@ Attribute* Element::get_attribute(const Glib::ustring& name,
{
ns_uri = get_namespace_uri_for_prefix(ns_prefix);
if (ns_uri.empty())
- return 0; // No such prefix.
+ return nullptr; // No such prefix.
}
// The return value of xmlHasNsProp() may be either an xmlAttr*, pointing to an
@@ -82,7 +82,7 @@ Attribute* Element::get_attribute(const Glib::ustring& name,
return reinterpret_cast<Attribute*>(attr->_private);
}
- return 0;
+ return nullptr;
}
const Attribute* Element::get_attribute(const Glib::ustring& name,
@@ -128,7 +128,7 @@ Attribute* Element::set_attribute(const Glib::ustring& name, const Glib::ustring
return reinterpret_cast<Attribute*>(attr->_private);
}
else
- return 0;
+ return nullptr;
}
void Element::remove_attribute(const Glib::ustring& name, const Glib::ustring& ns_prefix)
@@ -155,7 +155,7 @@ Element* Element::add_child_element(xmlpp::Node* previous_sibling,
const Glib::ustring& name, const Glib::ustring& ns_prefix)
{
if (!previous_sibling)
- return 0;
+ return nullptr;
auto child = create_new_child_element_node(name, ns_prefix);
auto node = xmlAddNextSibling(previous_sibling->cobj(), child);
@@ -166,7 +166,7 @@ Element* Element::add_child_element_before(xmlpp::Node* next_sibling,
const Glib::ustring& name, const Glib::ustring& ns_prefix)
{
if (!next_sibling)
- return 0;
+ return nullptr;
auto child = create_new_child_element_node(name, ns_prefix);
auto node = xmlAddPrevSibling(next_sibling->cobj(), child);
@@ -186,7 +186,7 @@ Element* Element::add_child_element_with_new_ns(xmlpp::Node* previous_sibling,
const Glib::ustring& ns_uri, const Glib::ustring& ns_prefix)
{
if (!previous_sibling)
- return 0;
+ return nullptr;
auto child = create_new_child_element_node_with_new_ns(name, ns_uri, ns_prefix);
auto node = xmlAddNextSibling(previous_sibling->cobj(), child);
@@ -198,7 +198,7 @@ Element* Element::add_child_element_before_with_new_ns(xmlpp::Node* next_sibling
const Glib::ustring& ns_uri, const Glib::ustring& ns_prefix)
{
if (!next_sibling)
- return 0;
+ return nullptr;
auto child = create_new_child_element_node_with_new_ns(name, ns_uri, ns_prefix);
auto node = xmlAddPrevSibling(next_sibling->cobj(), child);
@@ -302,13 +302,13 @@ TextNode* Element::add_child_text(const Glib::ustring& content)
Node::create_wrapper(node);
return static_cast<TextNode*>(node->_private);
}
- return 0;
+ return nullptr;
}
TextNode* Element::add_child_text(xmlpp::Node* previous_sibling, const Glib::ustring& content)
{
if(!previous_sibling)
- return 0;
+ return nullptr;
if(cobj()->type == XML_ELEMENT_NODE)
{
@@ -324,13 +324,13 @@ TextNode* Element::add_child_text(xmlpp::Node* previous_sibling, const Glib::ust
Node::create_wrapper(node);
return static_cast<TextNode*>(node->_private);
}
- return 0;
+ return nullptr;
}
TextNode* Element::add_child_text_before(xmlpp::Node* next_sibling, const Glib::ustring& content)
{
if(!next_sibling)
- return 0;
+ return nullptr;
if(cobj()->type == XML_ELEMENT_NODE)
{
@@ -346,7 +346,7 @@ TextNode* Element::add_child_text_before(xmlpp::Node* next_sibling, const Glib::
Node::create_wrapper(node);
return static_cast<TextNode*>(node->_private);
}
- return 0;
+ return nullptr;
}
bool Element::has_child_text() const
diff --git a/libxml++/nodes/node.cc b/libxml++/nodes/node.cc
index 16cb55f..177ca9f 100644
--- a/libxml++/nodes/node.cc
+++ b/libxml++/nodes/node.cc
@@ -238,7 +238,7 @@ const Element* Node::get_parent() const
Element* Node::get_parent()
{
if(!(cobj()->parent && cobj()->parent->type == XML_ELEMENT_NODE))
- return 0;
+ return nullptr;
Node::create_wrapper(cobj()->parent);
return static_cast<Element*>(cobj()->parent->_private);
@@ -252,7 +252,7 @@ const Node* Node::get_next_sibling() const
Node* Node::get_next_sibling()
{
if(!cobj()->next)
- return 0;
+ return nullptr;
Node::create_wrapper(cobj()->next);
return static_cast<Node*>(cobj()->next->_private);
@@ -266,7 +266,7 @@ const Node* Node::get_previous_sibling() const
Node* Node::get_previous_sibling()
{
if(!cobj()->prev)
- return 0;
+ return nullptr;
Node::create_wrapper(cobj()->prev);
return static_cast<Node*>(cobj()->prev->_private);
@@ -276,7 +276,7 @@ Node* Node::get_first_child(const Glib::ustring& name)
{
auto child = impl_->children;
if(!child)
- return 0;
+ return nullptr;
do
{
@@ -285,7 +285,7 @@ Node* Node::get_first_child(const Glib::ustring& name)
}
while((child = child->next));
- return 0;
+ return nullptr;
}
const Node* Node::get_first_child(const Glib::ustring& name) const
@@ -320,7 +320,7 @@ void Node::remove_node(Node* node)
Node* Node::import_node(const Node* node, bool recursive)
{
if (!node)
- return 0;
+ return nullptr;
//Create the node, by copying:
auto imported_node = xmlDocCopyNode(const_cast<xmlNode*>(node->cobj()), impl_->doc, recursive);
diff --git a/libxml++/parsers/textreader.cc b/libxml++/parsers/textreader.cc
index 5eb0414..74804e3 100644
--- a/libxml++/parsers/textreader.cc
+++ b/libxml++/parsers/textreader.cc
@@ -301,7 +301,7 @@ Node* TextReader::get_current_node()
}
check_for_exceptions();
- return 0;
+ return nullptr;
}
const Node* TextReader::get_current_node() const
@@ -329,7 +329,7 @@ Node* TextReader::expand()
}
check_for_exceptions();
- return 0;
+ return nullptr;
}
bool TextReader::next()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]