Skip to content

Commit a00888b

Browse files
authored
Merge pull request #202 from jcsahnwaldt/patch-1
Fix warnings about allocators of T_DATA classes
2 parents 8a8db0b + f80934f commit a00888b

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

ext/libxml/ruby_xml_reader.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,7 @@ void rxml_init_reader(void)
11381138
OPTIONS_SYMBOL = ID2SYM(rb_intern("options"));
11391139

11401140
cXMLReader = rb_define_class_under(mXML, "Reader", rb_cObject);
1141+
rb_undef_alloc_func(cXMLReader);
11411142

11421143
rb_define_singleton_method(cXMLReader, "document", rxml_reader_document, 1);
11431144
rb_define_singleton_method(cXMLReader, "file", rxml_reader_file, -1);
@@ -1239,4 +1240,6 @@ void rxml_init_reader(void)
12391240
rb_define_const(cXMLReader, "MODE_EOF", INT2FIX(XML_TEXTREADER_MODE_EOF));
12401241
rb_define_const(cXMLReader, "MODE_CLOSED", INT2FIX(XML_TEXTREADER_MODE_CLOSED));
12411242
rb_define_const(cXMLReader, "MODE_READING", INT2FIX(XML_TEXTREADER_MODE_READING));
1243+
1244+
rb_undef_method(CLASS_OF(cXMLReader), "new");
12421245
}

ext/libxml/ruby_xml_schema.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ static VALUE rxml_schema_imported_ns_types(VALUE self)
394394
void rxml_init_schema(void)
395395
{
396396
cXMLSchema = rb_define_class_under(mXML, "Schema", rb_cObject);
397+
rb_undef_alloc_func(cXMLSchema);
398+
397399
rb_define_singleton_method(cXMLSchema, "new", rxml_schema_init_from_uri, 1);
398400
rb_define_singleton_method(cXMLSchema, "from_string", rxml_schema_init_from_string, 1);
399401
rb_define_singleton_method(cXMLSchema, "document", rxml_schema_init_from_document, 1);

ext/libxml/ruby_xml_writer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,7 @@ void rxml_init_writer(void)
10651065
sStandalone = ID2SYM(rb_intern("standalone"));
10661066

10671067
cXMLWriter = rb_define_class_under(mXML, "Writer", rb_cObject);
1068+
rb_undef_alloc_func(cXMLWriter);
10681069

10691070
#ifdef LIBXML_WRITER_ENABLED
10701071
rb_define_singleton_method(cXMLWriter, "io", rxml_writer_io, 1);

0 commit comments

Comments
 (0)