summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-22 14:04:10 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-22 14:04:10 +0000
commitd56885b43df3b4e9e67fc4a39cbaaaea6961d5d8 (patch)
tree7fdb91f7459889e1a4b82b68069aaf1a5cace3cf
parent09a5952737052a7c4f6d3eb5f7b9963ee275da85 (diff)
* ext/syck/rubyext.c, ext/syck/yaml2byte.c, ext/syck/emitter.c,
ext/syck/syck.c, ext/syck/handler.c, ext/syck/syck.h: suppress GCC warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ext/syck/emitter.c4
-rw-r--r--ext/syck/handler.c10
-rw-r--r--ext/syck/rubyext.c10
-rw-r--r--ext/syck/syck.c4
-rw-r--r--ext/syck/syck.h2
-rw-r--r--ext/syck/yaml2byte.c8
7 files changed, 27 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index cd315e4c637..60243df69dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jul 22 23:01:34 2008 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * ext/syck/rubyext.c, ext/syck/yaml2byte.c, ext/syck/emitter.c,
+ ext/syck/syck.c, ext/syck/handler.c, ext/syck/syck.h: suppress GCC
+ warning.
+
Tue Jul 22 20:42:24 2008 Yusuke Endoh <mame@tsg.ne.jp>
* ext/bigdecimal/bigdecimal.c (BigDecimalCmp): BigDecimal#<=> should
diff --git a/ext/syck/emitter.c b/ext/syck/emitter.c
index 277004d7ad8..56a5592cb3c 100644
--- a/ext/syck/emitter.c
+++ b/ext/syck/emitter.c
@@ -391,7 +391,7 @@ syck_emit( SyckEmitter *e, st_data_t n )
/* Look for anchor */
if ( e->anchors != NULL &&
st_lookup( e->markers, n, (st_data_t *)&oid ) &&
- st_lookup( e->anchors, (st_data_t)oid, (st_data_t *)&anchor_name ) )
+ st_lookup( e->anchors, (st_data_t)oid, (void *)&anchor_name ) )
{
if ( e->anchored == NULL )
{
@@ -1217,7 +1217,7 @@ syck_emitter_mark_node( SyckEmitter *e, st_data_t n )
e->anchors = st_init_numtable();
}
- if ( ! st_lookup( e->anchors, (st_data_t)oid, (st_data_t *)&anchor_name ) )
+ if ( ! st_lookup( e->anchors, (st_data_t)oid, (void *)&anchor_name ) )
{
int idx = 0;
const char *anc = ( e->anchor_format == NULL ? DEFAULT_ANCHOR_FORMAT : e->anchor_format );
diff --git a/ext/syck/handler.c b/ext/syck/handler.c
index 60827f1903a..52af92578c9 100644
--- a/ext/syck/handler.c
+++ b/ext/syck/handler.c
@@ -36,7 +36,7 @@ syck_hdlr_add_anchor( SyckParser *p, char *a, SyckNode *n )
if ( p->bad_anchors != NULL )
{
SyckNode *bad;
- if ( st_lookup( p->bad_anchors, (st_data_t)a, (st_data_t *)&bad ) )
+ if ( st_lookup( p->bad_anchors, (st_data_t)a, (void *)&bad ) )
{
if ( n->kind != syck_str_kind )
{
@@ -49,7 +49,7 @@ syck_hdlr_add_anchor( SyckParser *p, char *a, SyckNode *n )
{
p->anchors = st_init_strtable();
}
- if ( st_lookup( p->anchors, (st_data_t)a, (st_data_t *)&ntmp ) )
+ if ( st_lookup( p->anchors, (st_data_t)a, (void *)&ntmp ) )
{
if ( ntmp != (void *)1 )
{
@@ -69,7 +69,7 @@ syck_hdlr_remove_anchor( SyckParser *p, char *a )
{
p->anchors = st_init_strtable();
}
- if ( st_delete( p->anchors, (st_data_t *)&atmp, (st_data_t *)&ntmp ) )
+ if ( st_delete( p->anchors, (void *)&atmp, (void *)&ntmp ) )
{
if ( ntmp != (void *)1 )
{
@@ -86,7 +86,7 @@ syck_hdlr_get_anchor( SyckParser *p, char *a )
if ( p->anchors != NULL )
{
- if ( st_lookup( p->anchors, (st_data_t)a, (st_data_t *)&n ) )
+ if ( st_lookup( p->anchors, (st_data_t)a, (void *)&n ) )
{
if ( n != (void *)1 )
{
@@ -99,7 +99,7 @@ syck_hdlr_get_anchor( SyckParser *p, char *a )
{
p->bad_anchors = st_init_strtable();
}
- if ( ! st_lookup( p->bad_anchors, (st_data_t)a, (st_data_t *)&n ) )
+ if ( ! st_lookup( p->bad_anchors, (st_data_t)a, (void *)&n ) )
{
n = (p->bad_anchor_handler)( p, a );
st_insert( p->bad_anchors, (st_data_t)a, (st_data_t)n );
diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c
index a80e7654985..7c2508f853c 100644
--- a/ext/syck/rubyext.c
+++ b/ext/syck/rubyext.c
@@ -112,7 +112,7 @@ rb_syck_compile(VALUE self, VALUE port)
syck_parser_implicit_typing( parser, 0 );
syck_parser_taguri_expansion( parser, 0 );
oid = syck_parse( parser );
- syck_lookup_sym( parser, oid, (char **)&sav );
+ syck_lookup_sym( parser, oid, &sav );
ret = S_ALLOCA_N( char, strlen( sav->buffer ) + 3 );
ret[0] = '\0';
@@ -927,7 +927,7 @@ VALUE
syck_resolver_node_import(VALUE self, VALUE node)
{
SyckNode *n;
- VALUE obj;
+ VALUE obj = Qnil;
int i = 0;
Data_Get_Struct(node, SyckNode, n);
@@ -1376,6 +1376,10 @@ syck_node_mark(SyckNode *n)
rb_gc_mark( syck_map_read( n, map_value, i ) );
}
break;
+
+ case syck_str_kind:
+ /* nothing */
+ break;
}
#if 0 /* maybe needed */
if ( n->shortcut ) syck_node_mark( n->shortcut ); /* caution: maybe cyclic */
@@ -1729,7 +1733,7 @@ VALUE
syck_node_transform(VALUE self)
{
VALUE t;
- SyckNode *n;
+ SyckNode *n = NULL;
SyckNode *orig_n;
Data_Get_Struct(self, SyckNode, orig_n);
t = Data_Wrap_Struct( cNode, syck_node_mark, syck_free_node, 0 );
diff --git a/ext/syck/syck.c b/ext/syck/syck.c
index 1279b0cc6ef..9c9266dda96 100644
--- a/ext/syck/syck.c
+++ b/ext/syck/syck.c
@@ -190,10 +190,10 @@ syck_add_sym( SyckParser *p, char *data )
}
int
-syck_lookup_sym( SyckParser *p, SYMID id, char **data )
+syck_lookup_sym( SyckParser *p, SYMID id, void *data )
{
if ( p->syms == NULL ) return 0;
- return st_lookup( p->syms, id, (st_data_t *)data );
+ return st_lookup( p->syms, id, data );
}
int
diff --git a/ext/syck/syck.h b/ext/syck/syck.h
index 0ed1e2f3538..5372699016b 100644
--- a/ext/syck/syck.h
+++ b/ext/syck/syck.h
@@ -349,7 +349,7 @@ char *syck_xprivate( char *, int );
char *syck_taguri( const char *, const char *, int );
int syck_tagcmp( const char *, const char * );
int syck_add_sym( SyckParser *, char * );
-int syck_lookup_sym( SyckParser *, SYMID, char ** );
+int syck_lookup_sym( SyckParser *, SYMID, void * );
int syck_try_implicit( SyckNode * );
char *syck_type_id_to_uri( char * );
void try_tag_implicit( SyckNode *, int );
diff --git a/ext/syck/yaml2byte.c b/ext/syck/yaml2byte.c
index 4d84e01284e..7492fd6c84c 100644
--- a/ext/syck/yaml2byte.c
+++ b/ext/syck/yaml2byte.c
@@ -188,7 +188,7 @@ syck_yaml2byte_handler(p, n)
for ( i = 0; i < n->data.list->idx; i++ )
{
oid = syck_seq_read( n, i );
- syck_lookup_sym( p, oid, (char **)&sav );
+ syck_lookup_sym( p, oid, &sav );
bytestring_extend(val, sav);
}
bytestring_append(val,YAMLBYTE_END_BRANCH,NULL,NULL);
@@ -198,10 +198,10 @@ syck_yaml2byte_handler(p, n)
for ( i = 0; i < n->data.pairs->idx; i++ )
{
oid = syck_map_read( n, map_key, i );
- syck_lookup_sym( p, oid, (char **)&sav );
+ syck_lookup_sym( p, oid, &sav );
bytestring_extend(val, sav);
oid = syck_map_read( n, map_value, i );
- syck_lookup_sym( p, oid, (char **)&sav );
+ syck_lookup_sym( p, oid, &sav );
bytestring_extend(val, sav);
}
bytestring_append(val,YAMLBYTE_END_BRANCH,NULL,NULL);
@@ -227,7 +227,7 @@ syck_yaml2byte(char *yamlstr)
syck_parser_taguri_expansion( parser, 1 );
oid = syck_parse( parser );
- if ( syck_lookup_sym( parser, oid, (char **)&sav ) == 1 ) {
+ if ( syck_lookup_sym( parser, oid, &sav ) == 1 ) {
ret = S_ALLOC_N( char, strlen( sav->buffer ) + 3 );
ret[0] = '\0';
strcat( ret, "D\n" );