[libxml++] Still more use of nullptr instead of 0
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml++] Still more use of nullptr instead of 0
- Date: Fri, 9 Oct 2015 13:39:06 +0000 (UTC)
commit 5a611c885680e88a36b7ae6e786348f9662c5aa9
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Fri Oct 9 15:33:47 2015 +0200
Still more use of nullptr instead of 0
libxml++/dtd.cc | 2 +-
libxml++/io/parserinputbuffer.cc | 4 +-
libxml++/parsers/domparser.cc | 12 +++---
libxml++/parsers/domparser.h | 4 +-
libxml++/parsers/saxparser.cc | 68 +++++++++++++++---------------
libxml++/parsers/saxparser.h | 2 +-
libxml++/relaxngschema.cc | 2 +-
libxml++/validators/dtdvalidator.cc | 2 +-
libxml++/validators/dtdvalidator.h | 6 +-
libxml++/validators/relaxngvalidator.cc | 2 +-
libxml++/validators/relaxngvalidator.h | 4 +-
libxml++/validators/xsdvalidator.cc | 2 +-
libxml++/validators/xsdvalidator.h | 4 +-
libxml++/xsdschema.cc | 2 +-
14 files changed, 58 insertions(+), 58 deletions(-)
---
diff --git a/libxml++/dtd.cc b/libxml++/dtd.cc
index 2ec0c15..ff2663e 100644
--- a/libxml++/dtd.cc
+++ b/libxml++/dtd.cc
@@ -93,7 +93,7 @@ void Dtd::parse_stream(std::istream& in)
IStreamParserInputBuffer ibuff(in);
- auto dtd = xmlIOParseDTD(0, ibuff.cobj(), XML_CHAR_ENCODING_UTF8);
+ auto dtd = xmlIOParseDTD(nullptr, ibuff.cobj(), XML_CHAR_ENCODING_UTF8);
if (!dtd)
{
diff --git a/libxml++/io/parserinputbuffer.cc b/libxml++/io/parserinputbuffer.cc
index 891b5ac..b1732b4 100644
--- a/libxml++/io/parserinputbuffer.cc
+++ b/libxml++/io/parserinputbuffer.cc
@@ -1,4 +1,4 @@
-/* document.h
+/* parserinputbuffer.cc
* this file is part of libxml++
*
* copyright (C) 2003 by libxml++ developer's team
@@ -39,7 +39,7 @@ namespace xmlpp
&ParserInputBufferCallback::on_close,
static_cast<void*>(this),
XML_CHAR_ENCODING_NONE);
- if(impl_ == 0)
+ if (!impl_)
{
throw internal_error("Cannot initialise underlying xmlParserInputBuffer");
}
diff --git a/libxml++/parsers/domparser.cc b/libxml++/parsers/domparser.cc
index 6b76ed3..8ca3e7f 100644
--- a/libxml++/parsers/domparser.cc
+++ b/libxml++/parsers/domparser.cc
@@ -138,11 +138,11 @@ void DomParser::parse_stream(std::istream& in)
xmlResetLastError();
context_ = xmlCreatePushParserCtxt(
- 0, // Setting those two parameters to 0 force the parser
- 0, // to create a document while parsing.
- 0, // chunk
- 0, // size
- 0); // no filename for fetching external entities
+ nullptr, // Setting those two parameters to nullptr force the parser
+ nullptr, // to create a document while parsing.
+ nullptr, // chunk
+ 0, // size
+ nullptr); // no filename for fetching external entities
if(!context_)
{
@@ -173,7 +173,7 @@ void DomParser::parse_stream(std::istream& in)
firstParseError = parseError;
}
- const int parseError = xmlParseChunk(context_, 0, 0, 1 /* last chunk */);
+ const int parseError = xmlParseChunk(context_, nullptr, 0, 1 /* last chunk */);
if (parseError != XML_ERR_OK && firstParseError == XML_ERR_OK)
firstParseError = parseError;
diff --git a/libxml++/parsers/domparser.h b/libxml++/parsers/domparser.h
index bcf997c..63010cc 100644
--- a/libxml++/parsers/domparser.h
+++ b/libxml++/parsers/domparser.h
@@ -79,12 +79,12 @@ public:
operator bool() const;
/** Get the parsed document.
- * @returns A pointer to the parsed document, or <tt>0</tt>.
+ * @returns A pointer to the parsed document, or <tt>nullptr</tt>.
*/
Document* get_document();
/** Get the parsed document.
- * @returns A pointer to the parsed document, or <tt>0</tt>.
+ * @returns A pointer to the parsed document, or <tt>nullptr</tt>.
*/
const Document* get_document() const;
diff --git a/libxml++/parsers/saxparser.cc b/libxml++/parsers/saxparser.cc
index 7b16c3c..acbb9a2 100644
--- a/libxml++/parsers/saxparser.cc
+++ b/libxml++/parsers/saxparser.cc
@@ -43,37 +43,37 @@ SaxParser::SaxParser(bool use_get_entity)
{
xmlSAXHandler temp = {
SaxParserCallback::internal_subset,
- 0, // isStandalone
- 0, // hasInternalSubset
- 0, // hasExternalSubset
- 0, // resolveEntity
- use_get_entity ? SaxParserCallback::get_entity : 0, // getEntity
+ nullptr, // isStandalone
+ nullptr, // hasInternalSubset
+ nullptr, // hasExternalSubset
+ nullptr, // resolveEntity
+ use_get_entity ? SaxParserCallback::get_entity : nullptr, // getEntity
SaxParserCallback::entity_decl, // entityDecl
- 0, // notationDecl
- 0, // attributeDecl
- 0, // elementDecl
- 0, // unparsedEntityDecl
- 0, // setDocumentLocator
+ nullptr, // notationDecl
+ nullptr, // attributeDecl
+ nullptr, // elementDecl
+ nullptr, // unparsedEntityDecl
+ nullptr, // setDocumentLocator
SaxParserCallback::start_document, // startDocument
SaxParserCallback::end_document, // endDocument
SaxParserCallback::start_element, // startElement
SaxParserCallback::end_element, // endElement
- 0, // reference
+ nullptr, // reference
SaxParserCallback::characters, // characters
- 0, // ignorableWhitespace
- 0, // processingInstruction
+ nullptr, // ignorableWhitespace
+ nullptr, // processingInstruction
SaxParserCallback::comment, // comment
SaxParserCallback::warning, // warning
SaxParserCallback::error, // error
SaxParserCallback::fatal_error, // fatalError
- 0, // getParameterEntity
+ nullptr, // getParameterEntity
SaxParserCallback::cdata_block, // cdataBlock
- 0, // externalSubset
- 0, // initialized
- 0, // private
- 0, // startElementNs
- 0, // endElementNs
- 0, // serror
+ nullptr, // externalSubset
+ 0, // initialized
+ nullptr, // private
+ nullptr, // startElementNs
+ nullptr, // endElementNs
+ nullptr, // serror
};
*sax_handler_ = temp;
@@ -221,10 +221,10 @@ void SaxParser::parse_stream(std::istream& in)
context_ = xmlCreatePushParserCtxt(
sax_handler_.get(),
- 0, // user_data
- 0, // chunk
- 0, // size
- 0); // no filename for fetching external entities
+ nullptr, // user_data
+ nullptr, // chunk
+ 0, // size
+ nullptr); // no filename for fetching external entities
if(!context_)
{
@@ -259,7 +259,7 @@ void SaxParser::parse_stream(std::istream& in)
if (!exception_ptr_)
{
//This is called just to terminate parsing.
- const int parseError = xmlParseChunk(context_, 0 /* chunk */, 0 /* size */, 1 /* terminate (1 or 0) */);
+ const int parseError = xmlParseChunk(context_, nullptr /* chunk */, 0 /* size */, 1 /* terminate (1 or
0) */);
if (parseError != XML_ERR_OK && firstParseError == XML_ERR_OK)
firstParseError = parseError;
@@ -293,10 +293,10 @@ void SaxParser::parse_chunk_raw(const unsigned char* contents, size_type bytes_c
{
context_ = xmlCreatePushParserCtxt(
sax_handler_.get(),
- 0, // user_data
- 0, // chunk
- 0, // size
- 0); // no filename for fetching external entities
+ nullptr, // user_data
+ nullptr, // chunk
+ 0, // size
+ nullptr); // no filename for fetching external entities
if(!context_)
{
@@ -329,10 +329,10 @@ void SaxParser::finish_chunk_parsing()
{
context_ = xmlCreatePushParserCtxt(
sax_handler_.get(),
- 0, // this, // user_data
- 0, // chunk
- 0, // size
- 0); // no filename for fetching external entities
+ nullptr, // user_data
+ nullptr, // chunk
+ 0, // size
+ nullptr); // no filename for fetching external entities
if(!context_)
{
@@ -346,7 +346,7 @@ void SaxParser::finish_chunk_parsing()
int parseError = XML_ERR_OK;
if (!exception_ptr_)
//This is called just to terminate parsing.
- parseError = xmlParseChunk(context_, 0 /* chunk */, 0 /* size */, 1 /* terminate (1 or 0) */);
+ parseError = xmlParseChunk(context_, nullptr /* chunk */, 0 /* size */, 1 /* terminate (1 or 0) */);
auto error_str = format_xml_parser_error(context_);
if (error_str.empty() && parseError != XML_ERR_OK)
diff --git a/libxml++/parsers/saxparser.h b/libxml++/parsers/saxparser.h
index 83ce3a9..58cab4d 100644
--- a/libxml++/parsers/saxparser.h
+++ b/libxml++/parsers/saxparser.h
@@ -194,7 +194,7 @@ protected:
* Unlike the DomParser, the SaxParser will also tell you about entity references for the 5 predefined
entities.
*
* @param name The entity reference name.
- * @returns The resolved xmlEntity for the entity reference, or <tt>0</tt> if not found.
+ * @returns The resolved xmlEntity for the entity reference, or <tt>nullptr</tt> if not found.
* You must include libxml/parser.h in order to use this C struct.
* This instance will not be freed by the caller.
*/
diff --git a/libxml++/relaxngschema.cc b/libxml++/relaxngschema.cc
index cf35ba8..02a2f16 100644
--- a/libxml++/relaxngschema.cc
+++ b/libxml++/relaxngschema.cc
@@ -91,7 +91,7 @@ void RelaxNGSchema::parse_memory(const Glib::ustring& contents)
void RelaxNGSchema::parse_document(const Document* document)
{
if (!document)
- throw parse_error("RelaxNGSchema::parse_document(): document must not be 0.");
+ throw parse_error("RelaxNGSchema::parse_document(): document must not be nullptr.");
// xmlRelaxNGNewDocParserCtxt() takes a copy of the xmlDoc.
parse_context(xmlRelaxNGNewDocParserCtxt(const_cast<xmlDoc*>(document->cobj())));
diff --git a/libxml++/validators/dtdvalidator.cc b/libxml++/validators/dtdvalidator.cc
index f5b718e..27560de 100644
--- a/libxml++/validators/dtdvalidator.cc
+++ b/libxml++/validators/dtdvalidator.cc
@@ -144,7 +144,7 @@ void DtdValidator::validate(const Document* document)
{
if (!document)
{
- throw internal_error("Document pointer cannot be 0.");
+ throw internal_error("Document pointer cannot be nullptr.");
}
if (!pimpl_->dtd)
diff --git a/libxml++/validators/dtdvalidator.h b/libxml++/validators/dtdvalidator.h
index 4513f8c..e8b841b 100644
--- a/libxml++/validators/dtdvalidator.h
+++ b/libxml++/validators/dtdvalidator.h
@@ -1,4 +1,4 @@
-/* xml++.h
+/* dtdvalidator.h
* libxml++ and this file are copyright (C) 2000 by Ari Johnson,
* (C) 2002-2004 by the libxml dev team and
* are covered by the GNU Lesser General Public License, which should be
@@ -103,12 +103,12 @@ public:
explicit operator bool() const noexcept override;
/** Get the parsed DTD.
- * @returns A pointer to the parsed DTD, or <tt>0</tt>.
+ * @returns A pointer to the parsed DTD, or <tt>nullptr</tt>.
*/
Dtd* get_dtd();
/** Get the parsed DTD.
- * @returns A pointer to the parsed DTD, or <tt>0</tt>.
+ * @returns A pointer to the parsed DTD, or <tt>nullptr</tt>.
*/
const Dtd* get_dtd() const;
diff --git a/libxml++/validators/relaxngvalidator.cc b/libxml++/validators/relaxngvalidator.cc
index 7eb1036..4b7a58f 100644
--- a/libxml++/validators/relaxngvalidator.cc
+++ b/libxml++/validators/relaxngvalidator.cc
@@ -132,7 +132,7 @@ void RelaxNGValidator::initialize_context()
void RelaxNGValidator::validate(const Document* document)
{
if (!document)
- throw internal_error("RelaxNGValidator::validate(): document must not be 0.");
+ throw internal_error("RelaxNGValidator::validate(): document must not be nullptr.");
if (!*this)
throw internal_error("RelaxNGValidator::validate(): Must have a schema to validate document");
diff --git a/libxml++/validators/relaxngvalidator.h b/libxml++/validators/relaxngvalidator.h
index 7d87309..e67b6b5 100644
--- a/libxml++/validators/relaxngvalidator.h
+++ b/libxml++/validators/relaxngvalidator.h
@@ -123,12 +123,12 @@ public:
explicit operator bool() const noexcept override;
/** Get the schema.
- * @returns A pointer to the schema, or <tt>0</tt>.
+ * @returns A pointer to the schema, or <tt>nullptr</tt>.
*/
RelaxNGSchema* get_schema();
/** Get the schema.
- * @returns A pointer to the schema, or <tt>0</tt>.
+ * @returns A pointer to the schema, or <tt>nullptr</tt>.
*/
const RelaxNGSchema* get_schema() const;
diff --git a/libxml++/validators/xsdvalidator.cc b/libxml++/validators/xsdvalidator.cc
index ebe1c91..cc26d07 100644
--- a/libxml++/validators/xsdvalidator.cc
+++ b/libxml++/validators/xsdvalidator.cc
@@ -130,7 +130,7 @@ void XsdValidator::initialize_context()
void XsdValidator::validate(const Document* document)
{
if (!document)
- throw internal_error("XsdValidator::validate(): document must not be 0.");
+ throw internal_error("XsdValidator::validate(): document must not be nullptr.");
if (!*this)
throw internal_error("XsdValidator::validate(): Must have a schema to validate document");
diff --git a/libxml++/validators/xsdvalidator.h b/libxml++/validators/xsdvalidator.h
index ff4840b..c012f41 100644
--- a/libxml++/validators/xsdvalidator.h
+++ b/libxml++/validators/xsdvalidator.h
@@ -114,12 +114,12 @@ public:
explicit operator bool() const noexcept override;
/** Get the schema.
- * @returns A pointer to the schema, or <tt>0</tt>.
+ * @returns A pointer to the schema, or <tt>nullptr</tt>.
*/
XsdSchema* get_schema();
/** Get the schema.
- * @returns A pointer to the schema, or <tt>0</tt>.
+ * @returns A pointer to the schema, or <tt>nullptr</tt>.
*/
const XsdSchema* get_schema() const;
diff --git a/libxml++/xsdschema.cc b/libxml++/xsdschema.cc
index 4ad470e..1bcd943 100644
--- a/libxml++/xsdschema.cc
+++ b/libxml++/xsdschema.cc
@@ -94,7 +94,7 @@ void XsdSchema::parse_memory(const Glib::ustring& contents)
void XsdSchema::parse_document(const Document* document)
{
if (!document)
- throw parse_error("XsdSchema::parse_document(): document must not be 0.");
+ throw parse_error("XsdSchema::parse_document(): document must not be nullptr.");
xmlResetLastError();
release_underlying();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]