From fd76e1c22a0c4a639d10c458733dea7a46390492 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sat, 26 Sep 2009 23:36:13 -0700 Subject: eliminating warnings --- ext/psych/parser.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/psych/parser.c b/ext/psych/parser.c index 4ae3625..698eb37 100644 --- a/ext/psych/parser.c +++ b/ext/psych/parser.c @@ -9,8 +9,8 @@ static VALUE parse_string(VALUE self, VALUE string) yaml_parser_set_input_string( &parser, - StringValuePtr(string), - RSTRING_LEN(string) + (const unsigned char *)StringValuePtr(string), + (size_t)RSTRING_LEN(string) ); int done = 0; @@ -48,8 +48,8 @@ static VALUE parse_string(VALUE self, VALUE string) event.data.document_start.tag_directives.end; for(; start != end; start++) { VALUE pair = rb_ary_new3((long)2, - start->handle ? rb_str_new2(start->handle) : Qnil, - start->prefix ? rb_str_new2(start->prefix) : Qnil + start->handle ? rb_str_new2((const char *)start->handle) : Qnil, + start->prefix ? rb_str_new2((const char *)start->prefix) : Qnil ); rb_ary_push(tag_directives, pair); } @@ -68,15 +68,15 @@ static VALUE parse_string(VALUE self, VALUE string) case YAML_ALIAS_EVENT: rb_funcall(handler, rb_intern("alias"), 1, event.data.alias.anchor ? - rb_str_new2(event.data.alias.anchor) : + rb_str_new2((const char *)event.data.alias.anchor) : Qnil ); break; case YAML_SCALAR_EVENT: { VALUE val = rb_str_new( - event.data.scalar.value, - event.data.scalar.length + (const char *)event.data.scalar.value, + (long)event.data.scalar.length ); rb_funcall(handler, rb_intern("scalar"), 1, val); } -- cgit v1.2.3