From 6b1cf264a80f2efe6a4b42553b8bf2e16f51690a Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 25 Mar 2011 06:46:57 +0000 Subject: * ext/sdbm/_sdbm.c (sdbm_open): use size_t. * ext/syck/bytecode.c: ditto. * ext/sdbm/_sdbm.c (delpair): use ptrdiff_t. * ext/sdbm/init.c: use RSTRING_LENINT. * ext/dl/handle.c: suppress warning: shorten-64-to-32. * ext/strscan/strscan.c: ditto. * ext/syck/emitter.c: ditto. * ext/syck/implicit.c: ditto. * ext/syck/syck.c: ditto. * ext/syck/token.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/syck/bytecode.c | 2 +- ext/syck/emitter.c | 6 +++--- ext/syck/implicit.c | 12 ++++++------ ext/syck/syck.c | 2 +- ext/syck/token.c | 12 ++++++------ 5 files changed, 17 insertions(+), 17 deletions(-) (limited to 'ext/syck') diff --git a/ext/syck/bytecode.c b/ext/syck/bytecode.c index 5cddb22831..3310713e5c 100644 --- a/ext/syck/bytecode.c +++ b/ext/syck/bytecode.c @@ -325,7 +325,7 @@ yy24: CHK_NL(YYCURSOR); if ( qstr[0] == '!' ) { - int qidx = strlen( qstr ); + size_t qidx = strlen( qstr ); if ( qstr[1] == '\0' ) { free( qstr ); diff --git a/ext/syck/emitter.c b/ext/syck/emitter.c index 985bfb2500..af0d7891f8 100644 --- a/ext/syck/emitter.c +++ b/ext/syck/emitter.c @@ -450,7 +450,7 @@ void syck_emit_tag( SyckEmitter *e, const char *tag, const char *ignore ) /* global types */ } else if ( strncmp( tag, "tag:", 4 ) == 0 ) { - int taglen = strlen( tag ); + int taglen = (int)strlen( tag ); syck_emitter_write( e, "!", 1 ); if ( strncmp( tag + 4, YAML_DOMAIN, strlen( YAML_DOMAIN ) ) == 0 ) { int skip = 4 + strlen( YAML_DOMAIN ) + 1; @@ -662,7 +662,7 @@ void syck_emit_scalar( SyckEmitter *e, const char *tag, enum scalar_style force_ match_implicit = syck_match_implicit( str, len ); /* quote strings which default to implicits */ - implicit = syck_taguri( YAML_DOMAIN, match_implicit, strlen( match_implicit ) ); + implicit = syck_taguri( YAML_DOMAIN, match_implicit, (int)strlen( match_implicit ) ); if ( syck_tagcmp( tag, implicit ) != 0 && syck_tagcmp( tag, "tag:yaml.org,2002:str" ) == 0 ) { force_style = scalar_2quote; } else { @@ -1231,7 +1231,7 @@ syck_emitter_mark_node( SyckEmitter *e, st_data_t n ) /* * Second time hitting this object, let's give it an anchor */ - idx = e->anchors->num_entries + 1; + idx = (int)(e->anchors->num_entries + 1); anchor_name = S_ALLOC_N( char, strlen( anc ) + 10 ); S_MEMZERO( anchor_name, char, strlen( anc ) + 10 ); sprintf( anchor_name, anc, idx ); diff --git a/ext/syck/implicit.c b/ext/syck/implicit.c index 7d40747756..6911e6175d 100644 --- a/ext/syck/implicit.c +++ b/ext/syck/implicit.c @@ -38,9 +38,9 @@ try_tag_implicit( SyckNode *n, int taguri ) if ( n->type_id != NULL ) S_FREE( n->type_id ); if ( taguri == 1 ) { - n->type_id = syck_taguri( YAML_DOMAIN, tid, strlen( tid ) ); + n->type_id = syck_taguri( YAML_DOMAIN, tid, (int)strlen( tid ) ); } else { - n->type_id = syck_strndup( tid, strlen( tid ) ); + n->type_id = syck_strndup( tid, (int)strlen( tid ) ); } } @@ -1764,7 +1764,7 @@ yy205: yyaccept = 0; } yy206: #line 202 "implicit.re" -{ return syck_taguri( YAML_DOMAIN, type_id, strlen( type_id ) ); } +{ return syck_taguri( YAML_DOMAIN, type_id, (int)strlen( type_id ) ); } #line 1768 "" yy207: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -1838,7 +1838,7 @@ yy208: ++YYCURSOR; goto yy209; yy209: #line 176 "implicit.re" -{ return syck_xprivate( type_id + 1, strlen( type_id ) - 1 ); } +{ return syck_xprivate( type_id + 1, (int)strlen( type_id ) - 1 ); } #line 1842 "" yy210: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -2141,7 +2141,7 @@ yy219: strncat( domain, type_id, ( YYCURSOR - type_id ) - 1 ); strcat( domain, "." ); strcat( domain, YAML_DOMAIN ); - uri = syck_taguri( domain, YYCURSOR, YYLIMIT - YYCURSOR ); + uri = syck_taguri( domain, YYCURSOR, (int)(YYLIMIT - YYCURSOR) ); S_FREE( domain ); return uri; @@ -2357,7 +2357,7 @@ yy230: domain[0] = '\0'; strncat( domain, type_id, ( YYCURSOR - type_id ) - 1 ); - uri = syck_taguri( domain, YYCURSOR, YYLIMIT - YYCURSOR ); + uri = syck_taguri( domain, YYCURSOR, (int)(YYLIMIT - YYCURSOR) ); S_FREE( domain ); return uri; diff --git a/ext/syck/syck.c b/ext/syck/syck.c index 6ae48a75be..94e3992d3f 100644 --- a/ext/syck/syck.c +++ b/ext/syck/syck.c @@ -186,7 +186,7 @@ syck_add_sym( SyckParser *p, void *data ) } id = p->syms->num_entries + 1; st_insert( p->syms, id, (st_data_t)data ); - return id; + return (int)id; } int diff --git a/ext/syck/token.c b/ext/syck/token.c index 1521c5489d..bea79c158a 100644 --- a/ext/syck/token.c +++ b/ext/syck/token.c @@ -207,7 +207,7 @@ } \ else if ( *YYLINEPTR == ' ' ) \ { \ - ict = YYCURSOR - YYLINEPTR; \ + ict = (int)(YYCURSOR - YYLINEPTR); \ } /* @@ -377,7 +377,7 @@ yy12: ++YYCURSOR; goto yy16; yy13: #line 370 "token.re" -{ doc_level = YYCURSOR - YYLINEPTR; +{ doc_level = (int)(YYCURSOR - YYLINEPTR); goto Header; } #line 384 "" @@ -1037,16 +1037,16 @@ yy81: ++YYCURSOR; goto yy82; yy82: #line 441 "token.re" -{ ENSURE_YAML_IOPEN(lvl, YYTOKEN - YYLINEPTR, 1); +{ ENSURE_YAML_IOPEN(lvl, (int)(YYTOKEN - YYLINEPTR), 1); FORCE_NEXT_TOKEN(YAML_IOPEN); if ( *YYCURSOR == '#' || is_newline( YYCURSOR ) || is_newline( YYCURSOR - 1 ) ) { YYCURSOR--; - ADD_LEVEL((YYTOKEN + 1) - YYLINEPTR, syck_lvl_seq); + ADD_LEVEL((int)((YYTOKEN + 1) - YYLINEPTR), syck_lvl_seq); } else /* spaces followed by content uses the space as indentation */ { - ADD_LEVEL(YYCURSOR - YYLINEPTR, syck_lvl_seq); + ADD_LEVEL((int)(YYCURSOR - YYLINEPTR), syck_lvl_seq); } return YYTOKEN[0]; } @@ -2363,7 +2363,7 @@ ScalarBlock: } else if ( isdigit( *yyt ) ) { - forceIndent = strtol( yyt, NULL, 10 ); + forceIndent = rb_long2int(strtol( yyt, NULL, 10 )); } } -- cgit v1.2.3