Skip to content

Commit 1476a2d

Browse files
committed
Fix deprecation warnings in error handling.
1 parent ffc40d2 commit 1476a2d

15 files changed

Lines changed: 2465 additions & 2465 deletions

ext/libxml/ruby_xml_document.c

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

ext/libxml/ruby_xml_dtd.c

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

ext/libxml/ruby_xml_error.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static VALUE rxml_error_get_handler(VALUE self)
5050
return block;
5151
}
5252

53-
VALUE rxml_error_wrap(xmlErrorPtr xerror)
53+
VALUE rxml_error_wrap(const xmlError *xerror)
5454
{
5555
VALUE result = Qnil;
5656

@@ -97,7 +97,7 @@ VALUE rxml_error_wrap(xmlErrorPtr xerror)
9797
}
9898

9999
/* Hook that receives xml error message */
100-
static void structuredErrorFunc(void *userData, xmlErrorPtr xerror)
100+
static void structuredErrorFunc(void *userData, const xmlError *xerror)
101101
{
102102
VALUE error = rxml_error_wrap(xerror);
103103

@@ -158,7 +158,7 @@ static VALUE rxml_error_reset_handler(VALUE self)
158158
return self;
159159
}
160160

161-
NORETURN(void rxml_raise(xmlErrorPtr xerror))
161+
NORETURN(void rxml_raise(const xmlError *xerror))
162162
{
163163
/* Wrap error up as Ruby object and send it off to ruby */
164164
VALUE error = rxml_error_wrap(xerror);

ext/libxml/ruby_xml_error.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
/* Please see the LICENSE file for copyright and distribution information */
2-
3-
#ifndef __RXML_ERROR__
4-
#define __RXML_ERROR__
5-
6-
#include <libxml/xmlerror.h>
7-
8-
extern VALUE eXMLError;
9-
10-
void rxml_init_error(void);
11-
VALUE rxml_error_wrap(xmlErrorPtr xerror);
12-
NORETURN(void rxml_raise(xmlErrorPtr xerror));
13-
14-
#endif
1+
/* Please see the LICENSE file for copyright and distribution information */
2+
3+
#ifndef __RXML_ERROR__
4+
#define __RXML_ERROR__
5+
6+
#include <libxml/xmlerror.h>
7+
8+
extern VALUE eXMLError;
9+
10+
void rxml_init_error(void);
11+
VALUE rxml_error_wrap(const xmlError *xerror);
12+
NORETURN(void rxml_raise(const xmlError *xerror));
13+
14+
#endif

ext/libxml/ruby_xml_html_parser_context.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static VALUE rxml_html_parser_context_file(int argc, VALUE* argv, VALUE klass)
156156

157157
htmlParserCtxtPtr ctxt = htmlCreateFileParserCtxt(StringValuePtr(file), NULL);
158158
if (!ctxt)
159-
rxml_raise(&xmlLastError);
159+
rxml_raise(xmlGetLastError());
160160

161161
/* This is annoying, but xmlInitParserCtxt (called indirectly above) and
162162
xmlCtxtUseOptionsInternal (called below) initialize slightly different
@@ -197,7 +197,7 @@ static VALUE rxml_html_parser_context_io(int argc, VALUE* argv, VALUE klass)
197197
if (!ctxt)
198198
{
199199
xmlFreeParserInputBuffer(input);
200-
rxml_raise(&xmlLastError);
200+
rxml_raise(xmlGetLastError());
201201
}
202202

203203
/* This is annoying, but xmlInitParserCtxt (called indirectly above) and
@@ -212,7 +212,7 @@ static VALUE rxml_html_parser_context_io(int argc, VALUE* argv, VALUE klass)
212212
{
213213
xmlFreeParserInputBuffer(input);
214214
xmlFreeParserCtxt(ctxt);
215-
rxml_raise(&xmlLastError);
215+
rxml_raise(xmlGetLastError());
216216
}
217217
inputPush(ctxt, stream);
218218
result = rxml_html_parser_context_wrap(ctxt);
@@ -247,7 +247,7 @@ static VALUE rxml_html_parser_context_string(int argc, VALUE* argv, VALUE klass)
247247
ctxt = xmlCreateMemoryParserCtxt(StringValuePtr(string),
248248
(int)RSTRING_LEN(string));
249249
if (!ctxt)
250-
rxml_raise(&xmlLastError);
250+
rxml_raise(xmlGetLastError());
251251

252252
/* This is annoying, but xmlInitParserCtxt (called indirectly above) and
253253
xmlCtxtUseOptionsInternal (called below) initialize slightly different

0 commit comments

Comments
 (0)