Signed-off-by: Kirill A. Shutemov <kir...@shutemov.name>
---
 ext/libxml/libxml.c                |    2 +-
 ext/libxml/ruby_xml_document.c     |    2 +-
 ext/libxml/ruby_xml_reader.c       |    2 +-
 ext/libxml/ruby_xml_sax2_handler.c |   34 +++++++++++++++++-----------------
 4 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index b6cc679..c722642 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -564,7 +564,7 @@ static VALUE rxml_default_tree_indent_string_get(VALUE 
class)
 static VALUE rxml_default_tree_indent_string_set(VALUE class, VALUE string)
 {
   Check_Type(string, T_STRING);
-  xmlTreeIndentString = xmlStrdup((xmlChar *)StringValuePtr(string));
+  xmlTreeIndentString = strdup(StringValuePtr(string));
   return (string);
 }
 
diff --git a/ext/libxml/ruby_xml_document.c b/ext/libxml/ruby_xml_document.c
index cab739d..032c2ab 100644
--- a/ext/libxml/ruby_xml_document.c
+++ b/ext/libxml/ruby_xml_document.c
@@ -541,7 +541,7 @@ static VALUE rxml_document_save(int argc, VALUE *argv, 
VALUE self)
   xfilename = StringValuePtr(filename);
 
   Data_Get_Struct(self, xmlDoc, xdoc);
-  encoding = xdoc->encoding;
+  encoding = (char *)xdoc->encoding;
 
   if (!NIL_P(options))
   {
diff --git a/ext/libxml/ruby_xml_reader.c b/ext/libxml/ruby_xml_reader.c
index f3cdd14..818ebdc 100644
--- a/ext/libxml/ruby_xml_reader.c
+++ b/ext/libxml/ruby_xml_reader.c
@@ -324,7 +324,7 @@ static VALUE rxml_reader_read(VALUE self)
   int result = xmlTextReaderRead(rxml_text_reader_get(self));
   switch(result)
   {
-    case -1:
+    default:
       rxml_raise(&xmlLastError);
       return Qnil;
       break;
diff --git a/ext/libxml/ruby_xml_sax2_handler.c 
b/ext/libxml/ruby_xml_sax2_handler.c
index 739d10c..c9284c9 100644
--- a/ext/libxml/ruby_xml_sax2_handler.c
+++ b/ext/libxml/ruby_xml_sax2_handler.c
@@ -83,21 +83,21 @@ static void end_element_ns_callback(void *ctx,
     VALUE name;
     if (xprefix)
     {
-      name = rb_str_new2(xprefix);
+      name = rb_str_new2((char *)xprefix);
       rb_str_cat2(name, ":"); 
-      rb_str_cat2(name, xlocalname); 
+      rb_str_cat2(name, (char *)xlocalname); 
     }
     else
     {
-      name = rb_str_new2(xlocalname);
+      name = rb_str_new2((char *)xlocalname);
     }
     rb_funcall(handler, cbidOnEndElement, 1, name);
   }
 
   rb_funcall(handler, cbidOnEndElementNs, 3, 
-             rb_str_new2(xlocalname),
-             xprefix ? rb_str_new2(xprefix) : Qnil,
-             xURI ? rb_str_new2(xURI) : Qnil);
+             rb_str_new2((char *)xlocalname),
+             xprefix ? rb_str_new2((char *)xprefix) : Qnil,
+             xURI ? rb_str_new2((char *)xURI) : Qnil);
 }
 
 static void external_subset_callback(void *ctx, const char *name, const char 
*extid, const char *sysid)
@@ -206,8 +206,8 @@ static void start_element_ns_callback(void *ctx,
     int i;
     for (i = 0;i < nb_attributes * 5; i+=5) 
     {
-      VALUE attrName = rb_str_new2(xattributes[i+0]);
-      VALUE attrValue = rb_str_new(xattributes[i+3], xattributes[i+4] - 
xattributes[i+3]);
+      VALUE attrName = rb_str_new2((char *)xattributes[i+0]);
+      VALUE attrValue = rb_str_new((char *)xattributes[i+3], xattributes[i+4] 
- xattributes[i+3]);
       /* VALUE attrPrefix = xattributes[i+1] ? rb_str_new2(xattributes[i+1]) : 
Qnil;
          VALUE attrURI = xattributes[i+2] ? rb_str_new2(xattributes[i+2]) : 
Qnil; */
 
@@ -220,8 +220,8 @@ static void start_element_ns_callback(void *ctx,
     int i;
     for (i = 0;i < nb_namespaces * 2; i+=2) 
     {
-      VALUE nsPrefix = xnamespaces[i+0] ? rb_str_new2(xnamespaces[i+0]) : Qnil;
-      VALUE nsURI = xnamespaces[i+1] ? rb_str_new2(xnamespaces[i+1]) : Qnil;
+      VALUE nsPrefix = xnamespaces[i+0] ? rb_str_new2((char 
*)xnamespaces[i+0]) : Qnil;
+      VALUE nsURI = xnamespaces[i+1] ? rb_str_new2((char *)xnamespaces[i+1]) : 
Qnil;
       rb_hash_aset(attributes, nsPrefix, nsURI);
     }
   }
@@ -232,23 +232,23 @@ static void start_element_ns_callback(void *ctx,
     VALUE name;
     if (xprefix)
     {
-      name = rb_str_new2(xprefix);
+      name = rb_str_new2((char *)xprefix);
       rb_str_cat2(name, ":"); 
-      rb_str_cat2(name, xlocalname); 
+      rb_str_cat2(name, (char *)xlocalname); 
     }
     else
     {
-      name = rb_str_new2(xlocalname);
+      name = rb_str_new2((char *)xlocalname);
     }
     rb_funcall(handler, cbidOnStartElement, 2, name, attributes);
   }
 
   rb_funcall(handler, cbidOnStartElementNs, 5, 
-             rb_str_new2(xlocalname),
+             rb_str_new2((char *)xlocalname),
              attributes,
-             xprefix ? rb_str_new2(xprefix) : Qnil,
-             xURI ? rb_str_new2(xURI) : Qnil,
-             namespaces);
+             xprefix ? rb_str_new2((char *)xprefix) : Qnil,
+             xURI ? rb_str_new2((char *)xURI) : Qnil,
+             (char *)namespaces);
 }
 
 static void structured_error_callback(void *ctx, xmlErrorPtr xerror)
-- 
1.6.0.2.GIT

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to