Skip to content

Commit 2d9ed95

Browse files
committed
Replace NULL with nullptr
1 parent e34d659 commit 2d9ed95

26 files changed

+5483
-5483
lines changed

ext/libxml/ruby_xml.c

Lines changed: 556 additions & 556 deletions
Large diffs are not rendered by default.

ext/libxml/ruby_xml_attr.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ void rxml_attr_mark(xmlAttrPtr xattr)
3636
{
3737
/* This can happen if Ruby does a GC run after creating the
3838
new attribute but before initializing it. */
39-
if (xattr != NULL)
39+
if (xattr != nullptr)
4040
rxml_node_mark((xmlNodePtr) xattr);
4141
}
4242

4343
VALUE rxml_attr_wrap(xmlAttrPtr xattr)
4444
{
45-
return Data_Wrap_Struct(cXMLAttr, rxml_attr_mark, NULL, xattr);
45+
return Data_Wrap_Struct(cXMLAttr, rxml_attr_mark, nullptr, xattr);
4646
}
4747

4848
static VALUE rxml_attr_alloc(VALUE klass)
4949
{
50-
return Data_Wrap_Struct(klass, rxml_attr_mark, NULL, NULL);
50+
return Data_Wrap_Struct(klass, rxml_attr_mark, nullptr, nullptr);
5151
}
5252

5353
/*
@@ -111,7 +111,7 @@ static VALUE rxml_attr_child_get(VALUE self)
111111
{
112112
xmlAttrPtr xattr;
113113
Data_Get_Struct(self, xmlAttr, xattr);
114-
if (xattr->children == NULL)
114+
if (xattr->children == nullptr)
115115
return Qnil;
116116
else
117117
return rxml_node_wrap((xmlNodePtr) xattr->children);
@@ -130,7 +130,7 @@ static VALUE rxml_attr_doc_get(VALUE self)
130130
{
131131
xmlAttrPtr xattr;
132132
Data_Get_Struct(self, xmlAttr, xattr);
133-
if (xattr->doc == NULL)
133+
if (xattr->doc == nullptr)
134134
return Qnil;
135135
else
136136
return rxml_document_wrap(xattr->doc);
@@ -146,7 +146,7 @@ static VALUE rxml_attr_last_get(VALUE self)
146146
{
147147
xmlAttrPtr xattr;
148148
Data_Get_Struct(self, xmlAttr, xattr);
149-
if (xattr->last == NULL)
149+
if (xattr->last == nullptr)
150150
return Qnil;
151151
else
152152
return rxml_node_wrap(xattr->last);
@@ -163,10 +163,10 @@ static VALUE rxml_attr_name_get(VALUE self)
163163
xmlAttrPtr xattr;
164164
Data_Get_Struct(self, xmlAttr, xattr);
165165

166-
if (xattr->name == NULL)
166+
if (xattr->name == nullptr)
167167
return Qnil;
168168
else
169-
return rxml_new_cstr( xattr->name, NULL);
169+
return rxml_new_cstr( xattr->name, nullptr);
170170
}
171171

172172
/*
@@ -179,7 +179,7 @@ static VALUE rxml_attr_next_get(VALUE self)
179179
{
180180
xmlAttrPtr xattr;
181181
Data_Get_Struct(self, xmlAttr, xattr);
182-
if (xattr->next == NULL)
182+
if (xattr->next == nullptr)
183183
return Qnil;
184184
else
185185
return rxml_attr_wrap(xattr->next);
@@ -208,7 +208,7 @@ static VALUE rxml_attr_ns_get(VALUE self)
208208
{
209209
xmlAttrPtr xattr;
210210
Data_Get_Struct(self, xmlAttr, xattr);
211-
if (xattr->ns == NULL)
211+
if (xattr->ns == nullptr)
212212
return Qnil;
213213
else
214214
return rxml_namespace_wrap(xattr->ns);
@@ -224,7 +224,7 @@ static VALUE rxml_attr_parent_get(VALUE self)
224224
{
225225
xmlAttrPtr xattr;
226226
Data_Get_Struct(self, xmlAttr, xattr);
227-
if (xattr->parent == NULL)
227+
if (xattr->parent == nullptr)
228228
return Qnil;
229229
else
230230
return rxml_node_wrap(xattr->parent);
@@ -240,7 +240,7 @@ static VALUE rxml_attr_prev_get(VALUE self)
240240
{
241241
xmlAttrPtr xattr;
242242
Data_Get_Struct(self, xmlAttr, xattr);
243-
if (xattr->prev == NULL)
243+
if (xattr->prev == nullptr)
244244
return Qnil;
245245
else
246246
return rxml_attr_wrap(xattr->prev);
@@ -261,9 +261,9 @@ static VALUE rxml_attr_remove_ex(VALUE self)
261261
Data_Get_Struct(self, xmlAttr, xattr);
262262
xmlRemoveProp(xattr);
263263

264-
RDATA(self)->data = NULL;
265-
RDATA(self)->dfree = NULL;
266-
RDATA(self)->dmark = NULL;
264+
RDATA(self)->data = nullptr;
265+
RDATA(self)->dfree = nullptr;
266+
RDATA(self)->dmark = nullptr;
267267

268268
return Qnil;
269269
}
@@ -283,9 +283,9 @@ VALUE rxml_attr_value_get(VALUE self)
283283
Data_Get_Struct(self, xmlAttr, xattr);
284284
value = xmlNodeGetContent((xmlNodePtr)xattr);
285285

286-
if (value != NULL)
286+
if (value != nullptr)
287287
{
288-
result = rxml_new_cstr( value, NULL);
288+
result = rxml_new_cstr( value, nullptr);
289289
xmlFree(value);
290290
}
291291
return result;

ext/libxml/ruby_xml_attr_decl.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void rxml_attr_decl_mark(xmlAttributePtr xattr)
2020

2121
VALUE rxml_attr_decl_wrap(xmlAttributePtr xattr)
2222
{
23-
return Data_Wrap_Struct(cXMLAttrDecl, rxml_attr_decl_mark, NULL, xattr);
23+
return Data_Wrap_Struct(cXMLAttrDecl, rxml_attr_decl_mark, nullptr, xattr);
2424
}
2525

2626
/*
@@ -33,7 +33,7 @@ static VALUE rxml_attr_decl_doc_get(VALUE self)
3333
{
3434
xmlAttributePtr xattr;
3535
Data_Get_Struct(self, xmlAttribute, xattr);
36-
if (xattr->doc == NULL)
36+
if (xattr->doc == nullptr)
3737
return Qnil;
3838
else
3939
return rxml_document_wrap(xattr->doc);
@@ -51,7 +51,7 @@ static VALUE rxml_attr_decl_name_get(VALUE self)
5151
xmlAttributePtr xattr;
5252
Data_Get_Struct(self, xmlAttribute, xattr);
5353

54-
if (xattr->name == NULL)
54+
if (xattr->name == nullptr)
5555
return Qnil;
5656
else
5757
return rxml_new_cstr( xattr->name, xattr->doc->encoding);
@@ -67,7 +67,7 @@ static VALUE rxml_attr_decl_next_get(VALUE self)
6767
{
6868
xmlAttributePtr xattr;
6969
Data_Get_Struct(self, xmlAttribute, xattr);
70-
if (xattr->next == NULL)
70+
if (xattr->next == nullptr)
7171
return Qnil;
7272
else
7373
return rxml_attr_decl_wrap((xmlAttributePtr)xattr->next);
@@ -98,7 +98,7 @@ static VALUE rxml_attr_decl_parent_get(VALUE self)
9898
xmlAttributePtr xattr;
9999
Data_Get_Struct(self, xmlAttribute, xattr);
100100

101-
if (xattr->parent == NULL)
101+
if (xattr->parent == nullptr)
102102
return Qnil;
103103
else
104104
return rxml_dtd_wrap(xattr->parent);
@@ -116,7 +116,7 @@ static VALUE rxml_attr_decl_prev_get(VALUE self)
116116
xmlAttributePtr xattr;
117117
Data_Get_Struct(self, xmlAttribute, xattr);
118118

119-
if (xattr->prev == NULL)
119+
if (xattr->prev == nullptr)
120120
return Qnil;
121121
else
122122
return rxml_attr_decl_wrap((xmlAttributePtr)xattr->prev);
@@ -135,7 +135,7 @@ VALUE rxml_attr_decl_value_get(VALUE self)
135135
Data_Get_Struct(self, xmlAttribute, xattr);
136136

137137
if (xattr->defaultValue)
138-
return rxml_new_cstr(xattr->defaultValue, NULL);
138+
return rxml_new_cstr(xattr->defaultValue, nullptr);
139139
else
140140
return Qnil;
141141
}

ext/libxml/ruby_xml_attributes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void rxml_attributes_mark(xmlNodePtr xnode)
4242
*/
4343
VALUE rxml_attributes_new(xmlNodePtr xnode)
4444
{
45-
return Data_Wrap_Struct(cXMLAttributes, rxml_attributes_mark, NULL, xnode);
45+
return Data_Wrap_Struct(cXMLAttributes, rxml_attributes_mark, nullptr, xnode);
4646
}
4747

4848
/*

0 commit comments

Comments
 (0)