Skip to content

Commit 2ea9faa

Browse files
committed
Replace nullptr with null
1 parent e54a0e8 commit 2ea9faa

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

ext/libxml/ruby_xml_writer.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static void encodeStrings(rb_encoding* encoding, int count, VALUE* strings, cons
291291

292292
if (NIL_P(string))
293293
{
294-
encoded_strings[i] = nullptr;
294+
encoded_strings[i] = NULL;
295295
}
296296
else
297297
{
@@ -313,7 +313,7 @@ static VALUE invoke_single_arg_function(VALUE self, int (*fn)(xmlTextWriterPtr,
313313
rxml_writer_object* rwo = rxml_textwriter_get(self);
314314

315315
VALUE rubyStrings[] = { value };
316-
const xmlChar* xmlStrings[] = { nullptr };
316+
const xmlChar* xmlStrings[] = { NULL };
317317
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
318318

319319
int result = fn(rwo->writer, xmlStrings[0]);
@@ -411,7 +411,7 @@ static VALUE rxml_writer_write_element(int argc, VALUE* argv, VALUE self)
411411
{
412412
rxml_writer_object* rwo = rxml_textwriter_get(self);
413413
VALUE rubyStrings[] = {name, content};
414-
const xmlChar* xmlStrings[] = {nullptr, nullptr};
414+
const xmlChar* xmlStrings[] = {NULL, NULL};
415415
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
416416

417417
int result = xmlTextWriterWriteElement(rwo->writer, xmlStrings[0], xmlStrings[1]);
@@ -455,7 +455,7 @@ static VALUE rxml_writer_write_element_ns(int argc, VALUE* argv, VALUE self)
455455
{
456456
rxml_writer_object* rwo = rxml_textwriter_get(self);
457457
VALUE rubyStrings[] = {prefix, name, namespaceURI, content};
458-
const xmlChar* xmlStrings[] = {nullptr, nullptr, nullptr, nullptr};
458+
const xmlChar* xmlStrings[] = {NULL, NULL, NULL, NULL};
459459
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
460460
int result = xmlTextWriterWriteElementNS(rwo->writer, xmlStrings[0], xmlStrings[1], xmlStrings[2], xmlStrings[3]);
461461
return (result == -1 ? Qfalse : Qtrue);
@@ -472,7 +472,7 @@ static VALUE rxml_writer_write_attribute(VALUE self, VALUE name, VALUE content)
472472
{
473473
rxml_writer_object* rwo = rxml_textwriter_get(self);
474474
VALUE rubyStrings[] = {name, content};
475-
const xmlChar* xmlStrings[] = {nullptr, nullptr};
475+
const xmlChar* xmlStrings[] = {NULL, NULL};
476476
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
477477
int result = xmlTextWriterWriteAttribute(rwo->writer, xmlStrings[0], xmlStrings[1]);
478478
return (result == -1 ? Qfalse : Qtrue);
@@ -499,7 +499,7 @@ static VALUE rxml_writer_write_attribute_ns(int argc, VALUE* argv, VALUE self)
499499

500500
rxml_writer_object* rwo = rxml_textwriter_get(self);
501501
VALUE rubyStrings[] = {prefix, name, namespaceURI, content};
502-
const xmlChar* xmlStrings[] = {nullptr, nullptr, nullptr, nullptr};
502+
const xmlChar* xmlStrings[] = {NULL, NULL, NULL, NULL};
503503
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
504504
int result = xmlTextWriterWriteAttributeNS(rwo->writer, xmlStrings[0], xmlStrings[1], xmlStrings[2], xmlStrings[3]);
505505
return (result == -1 ? Qfalse : Qtrue);
@@ -515,7 +515,7 @@ static VALUE rxml_writer_write_pi(VALUE self, VALUE target, VALUE content)
515515
{
516516
rxml_writer_object* rwo = rxml_textwriter_get(self);
517517
VALUE rubyStrings[] = {target, content};
518-
const xmlChar* xmlStrings[] = {nullptr, nullptr};
518+
const xmlChar* xmlStrings[] = {NULL, NULL};
519519
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
520520
int result = xmlTextWriterWritePI(rwo->writer, xmlStrings[0], xmlStrings[1]);
521521
return (result == -1 ? Qfalse : Qtrue);
@@ -574,7 +574,7 @@ static VALUE rxml_writer_start_attribute_ns(int argc, VALUE* argv, VALUE self)
574574

575575
rxml_writer_object* rwo = rxml_textwriter_get(self);
576576
VALUE rubyStrings[] = {prefix, name, namespaceURI};
577-
const xmlChar* xmlStrings[] = {nullptr, nullptr, nullptr};
577+
const xmlChar* xmlStrings[] = {NULL, NULL, NULL};
578578
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
579579
int result = xmlTextWriterStartAttributeNS(rwo->writer, xmlStrings[0], xmlStrings[1], xmlStrings[2]);
580580
return (result == -1 ? Qfalse : Qtrue);
@@ -641,7 +641,7 @@ static VALUE rxml_writer_start_element_ns(int argc, VALUE* argv, VALUE self)
641641

642642
rxml_writer_object* rwo = rxml_textwriter_get(self);
643643
VALUE rubyStrings[] = {prefix, name, namespaceURI};
644-
const xmlChar* xmlStrings[] = {nullptr, nullptr, nullptr};
644+
const xmlChar* xmlStrings[] = {NULL, NULL, NULL};
645645
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
646646
int result = xmlTextWriterStartElementNS(rwo->writer, xmlStrings[0], xmlStrings[1], xmlStrings[2]);
647647
return (result == -1 ? Qfalse : Qtrue);
@@ -779,7 +779,7 @@ static VALUE rxml_writer_start_dtd(int argc, VALUE* argv, VALUE self)
779779

780780
rxml_writer_object* rwo = rxml_textwriter_get(self);
781781
VALUE rubyStrings[] = {name, pubid, sysid};
782-
const xmlChar* xmlStrings[] = {nullptr, nullptr, nullptr};
782+
const xmlChar* xmlStrings[] = {NULL, NULL, NULL};
783783
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
784784
int result = xmlTextWriterStartDTD(rwo->writer, xmlStrings[0], xmlStrings[1], xmlStrings[2]);
785785
return (result == -1 ? Qfalse : Qtrue);
@@ -807,7 +807,7 @@ static VALUE rxml_writer_start_dtd_entity(int argc, VALUE* argv, VALUE self)
807807

808808
rxml_writer_object* rwo = rxml_textwriter_get(self);
809809
VALUE rubyStrings[] = {name};
810-
const xmlChar* xmlStrings[] = {nullptr};
810+
const xmlChar* xmlStrings[] = {NULL};
811811
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
812812
int result = xmlTextWriterStartDTDEntity(rwo->writer, RB_TEST(pe), xmlStrings[0]);
813813
return (result == -1 ? Qfalse : Qtrue);
@@ -889,7 +889,7 @@ static VALUE rxml_writer_write_dtd(int argc, VALUE* argv, VALUE self)
889889

890890
rxml_writer_object* rwo = rxml_textwriter_get(self);
891891
VALUE rubyStrings[] = {name, pubid, sysid, subset};
892-
const xmlChar* xmlStrings[] = {nullptr, nullptr, nullptr, nullptr};
892+
const xmlChar* xmlStrings[] = {NULL, NULL, NULL, NULL};
893893
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
894894
int result = xmlTextWriterWriteDTD(rwo->writer, xmlStrings[0], xmlStrings[1], xmlStrings[2], xmlStrings[3]);
895895
return (result == -1 ? Qfalse : Qtrue);
@@ -906,7 +906,7 @@ static VALUE rxml_writer_write_dtd_attlist(VALUE self, VALUE name, VALUE content
906906
{
907907
rxml_writer_object* rwo = rxml_textwriter_get(self);
908908
VALUE rubyStrings[] = {name, content};
909-
const xmlChar* xmlStrings[] = {nullptr, nullptr};
909+
const xmlChar* xmlStrings[] = {NULL, NULL};
910910
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
911911
int result = xmlTextWriterWriteDTDAttlist(rwo->writer, xmlStrings[0], xmlStrings[1]);
912912
return (result == -1 ? Qfalse : Qtrue);
@@ -923,7 +923,7 @@ static VALUE rxml_writer_write_dtd_element(VALUE self, VALUE name, VALUE content
923923
{
924924
rxml_writer_object* rwo = rxml_textwriter_get(self);
925925
VALUE rubyStrings[] = {name, content};
926-
const xmlChar* xmlStrings[] = {nullptr, nullptr};
926+
const xmlChar* xmlStrings[] = {NULL, NULL};
927927
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
928928
int result = xmlTextWriterWriteDTDElement(rwo->writer, xmlStrings[0], xmlStrings[1]);
929929
return (result == -1 ? Qfalse : Qtrue);
@@ -938,7 +938,7 @@ static VALUE rxml_writer_write_dtd_entity(VALUE self, VALUE name, VALUE pubid, V
938938
{
939939
rxml_writer_object* rwo = rxml_textwriter_get(self);
940940
VALUE rubyStrings[] = {name, pubid, sysid, ndataid, content};
941-
const xmlChar* xmlStrings[] = {nullptr, nullptr, nullptr, nullptr, nullptr};
941+
const xmlChar* xmlStrings[] = {NULL, NULL, NULL, NULL, NULL};
942942
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
943943
int result = xmlTextWriterWriteDTDEntity(rwo->writer, RB_TEST(pe), xmlStrings[0], xmlStrings[1], xmlStrings[2], xmlStrings[3], xmlStrings[4]);
944944
return (result == -1 ? Qfalse : Qtrue);
@@ -960,7 +960,7 @@ static VALUE rxml_writer_write_dtd_external_entity(VALUE self, VALUE name, VALUE
960960
{
961961
rxml_writer_object* rwo = rxml_textwriter_get(self);
962962
VALUE rubyStrings[] = {name, pubid, sysid, ndataid};
963-
const xmlChar* xmlStrings[] = {nullptr, nullptr, nullptr, nullptr};
963+
const xmlChar* xmlStrings[] = {NULL, NULL, NULL, NULL};
964964
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
965965
int result = xmlTextWriterWriteDTDExternalEntity(rwo->writer, RB_TEST(pe), xmlStrings[0], xmlStrings[1], xmlStrings[2], xmlStrings[3]);
966966
return (result == -1 ? Qfalse : Qtrue);
@@ -975,7 +975,7 @@ static VALUE rxml_writer_write_dtd_external_entity_contents(VALUE self, VALUE pu
975975
{
976976
rxml_writer_object* rwo = rxml_textwriter_get(self);
977977
VALUE rubyStrings[] = {pubid, sysid, ndataid,};
978-
const xmlChar* xmlStrings[] = {nullptr, nullptr, nullptr};
978+
const xmlChar* xmlStrings[] = {NULL, NULL, NULL};
979979
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
980980
int result = xmlTextWriterWriteDTDExternalEntityContents(rwo->writer, xmlStrings[0], xmlStrings[1], xmlStrings[2]);
981981
return (result == -1 ? Qfalse : Qtrue);
@@ -996,7 +996,7 @@ static VALUE rxml_writer_write_dtd_internal_entity(VALUE self, VALUE name, VALUE
996996
{
997997
rxml_writer_object* rwo = rxml_textwriter_get(self);
998998
VALUE rubyStrings[] = {name, content};
999-
const xmlChar* xmlStrings[] = {nullptr, nullptr};
999+
const xmlChar* xmlStrings[] = {NULL, NULL};
10001000
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
10011001
int result = xmlTextWriterWriteDTDInternalEntity(rwo->writer, RB_TEST(pe), xmlStrings[0], xmlStrings[1]);
10021002
return (result == -1 ? Qfalse : Qtrue);
@@ -1011,7 +1011,7 @@ static VALUE rxml_writer_write_dtd_notation(VALUE self, VALUE name, VALUE pubid,
10111011
{
10121012
rxml_writer_object* rwo = rxml_textwriter_get(self);
10131013
VALUE rubyStrings[] = {name, pubid, sysid};
1014-
const xmlChar* xmlStrings[] = {nullptr, nullptr, nullptr};
1014+
const xmlChar* xmlStrings[] = {NULL, NULL, NULL};
10151015
encodeStrings(rwo->encoding, sizeof(rubyStrings)/sizeof(VALUE), rubyStrings, xmlStrings);
10161016
int result = xmlTextWriterWriteDTDNotation(rwo->writer, xmlStrings[0], xmlStrings[1], xmlStrings[2]);
10171017
return (result == -1 ? Qfalse : Qtrue);

0 commit comments

Comments
 (0)