summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-22 21:12:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-22 21:12:00 +0000
commit9049de7875eedcba33fa909fbf6f6de08129039d (patch)
treeb0eaeff5330735aa6e8af7eb63d1f127f1d63da5
parente35550c3e7784921734dc3a8128cf7c0f94879c9 (diff)
* ext/syck: suppress warnings more.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--ext/syck/bytecode.c4
-rw-r--r--ext/syck/emitter.c2
-rw-r--r--ext/syck/handler.c2
-rw-r--r--ext/syck/implicit.c8
-rw-r--r--ext/syck/rubyext.c6
-rw-r--r--ext/syck/syck.c6
-rw-r--r--ext/syck/syck.h13
-rw-r--r--ext/syck/token.c2
9 files changed, 23 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 21cf3624324..ae9a34a241d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Jul 23 06:11:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/syck: suppress warnings more.
+
Wed Jul 23 03:19:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/nkf/nkf-utf8/nkf.c (struct input_code.name, input_codename):
diff --git a/ext/syck/bytecode.c b/ext/syck/bytecode.c
index 13bfc3859c0..25ba678300e 100644
--- a/ext/syck/bytecode.c
+++ b/ext/syck/bytecode.c
@@ -164,7 +164,7 @@ sycklex_bytecode_utf8( YYSTYPE *sycklval, SyckParser *parser )
#line 165 "<stdout>"
{
YYCTYPE yych;
- unsigned int yyaccept;
+ unsigned int yyaccept = 0;
goto yy0;
++YYCURSOR;
yy0:
@@ -542,7 +542,7 @@ Directive:
#line 543 "<stdout>"
{
YYCTYPE yych;
- unsigned int yyaccept;
+ unsigned int yyaccept = 0;
goto yy45;
++YYCURSOR;
yy45:
diff --git a/ext/syck/emitter.c b/ext/syck/emitter.c
index c9106c5bc60..73ff5d7a0b4 100644
--- a/ext/syck/emitter.c
+++ b/ext/syck/emitter.c
@@ -284,7 +284,7 @@ void
syck_emitter_write( SyckEmitter *e, const char *str, long len )
{
long at;
- ASSERT( str != NULL )
+ ASSERT( str != NULL );
if ( e->buffer == NULL )
{
syck_emitter_clear( e );
diff --git a/ext/syck/handler.c b/ext/syck/handler.c
index 52af92578c9..d76a72e5cc2 100644
--- a/ext/syck/handler.c
+++ b/ext/syck/handler.c
@@ -144,7 +144,7 @@ syck_add_transfer( char *uri, SyckNode *n, int taguri )
}
char *
-syck_xprivate( char *type_id, int type_len )
+syck_xprivate( const char *type_id, int type_len )
{
char *uri = S_ALLOC_N( char, type_len + 14 );
uri[0] = '\0';
diff --git a/ext/syck/implicit.c b/ext/syck/implicit.c
index 58abfc97691..878165b715a 100644
--- a/ext/syck/implicit.c
+++ b/ext/syck/implicit.c
@@ -47,7 +47,7 @@ try_tag_implicit( SyckNode *n, int taguri )
const char *
syck_match_implicit( const char *str, size_t len )
{
- const char *cursor, *limit, *marker;
+ const char *cursor, *limit, *marker = 0;
cursor = str;
limit = str + len;
@@ -1609,9 +1609,9 @@ syck_tagcmp( const char *tag1, const char *tag2 )
}
char *
-syck_type_id_to_uri( char *type_id )
+syck_type_id_to_uri( const char *type_id )
{
- char *cursor, *limit, *marker;
+ const char *cursor, *limit, *marker;
cursor = type_id;
limit = type_id + strlen( type_id );
@@ -1620,7 +1620,7 @@ syck_type_id_to_uri( char *type_id )
#line 1620 "<stdout>"
{
YYCTYPE yych;
- unsigned int yyaccept;
+ unsigned int yyaccept = 0;
goto yy202;
++YYCURSOR;
yy202:
diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c
index 96994d564b4..57b7012cd56 100644
--- a/ext/syck/rubyext.c
+++ b/ext/syck/rubyext.c
@@ -103,7 +103,7 @@ rb_syck_compile(VALUE self, VALUE port)
int taint;
char *ret;
VALUE bc;
- bytestring_t *sav;
+ bytestring_t *sav = NULL;
void *data;
SyckParser *parser = syck_new_parser();
@@ -2055,9 +2055,7 @@ VALUE
syck_out_scalar(int argc, VALUE *argv, VALUE self)
{
VALUE type_id, str, style, scalar;
- if (rb_scan_args(argc, argv, "21", &type_id, &str, &style) == 2) {
- style = Qnil;
- }
+ rb_scan_args(argc, argv, "21", &type_id, &str, &style);
scalar = rb_funcall( cScalar, s_new, 3, type_id, str, style );
syck_out_mark( rb_ivar_get( self, s_emitter ), scalar );
return scalar;
diff --git a/ext/syck/syck.c b/ext/syck/syck.c
index 9ac62688fa4..ccbce4822cd 100644
--- a/ext/syck/syck.c
+++ b/ext/syck/syck.c
@@ -18,11 +18,11 @@ void syck_parser_pop_level( SyckParser * );
* Custom assert
*/
void
-syck_assert( char *file_name, unsigned line_num )
+syck_assert( const char *file_name, unsigned line_num, const char *expr )
{
fflush( NULL );
- fprintf( stderr, "\nAssertion failed: %s, line %u\n",
- file_name, line_num );
+ fprintf( stderr, "\nAssertion failed: %s, line %u: %s\n",
+ file_name, line_num, expr );
fflush( stderr );
abort();
}
diff --git a/ext/syck/syck.h b/ext/syck/syck.h
index afcf1daae83..3df3fab3f0a 100644
--- a/ext/syck/syck.h
+++ b/ext/syck/syck.h
@@ -32,14 +32,11 @@ extern "C" {
#endif
#if DEBUG
- void syck_assert( char *, unsigned );
+void syck_assert( const char *, unsigned, const char * );
# define ASSERT(f) \
- if ( f ) \
- {} \
- else \
- syck_assert( __FILE__, __LINE__ )
+ (( f ) ? (void)0 syck_assert( __FILE__, __LINE__, #f )
#else
-# define ASSERT(f)
+# define ASSERT(f) ((void)0)
#endif
#ifndef NULL
@@ -345,13 +342,13 @@ SyckNode *syck_hdlr_add_anchor( SyckParser *, char *, SyckNode * );
void syck_hdlr_remove_anchor( SyckParser *, char * );
SyckNode *syck_hdlr_get_anchor( SyckParser *, char * );
void syck_add_transfer( char *, SyckNode *, int );
-char *syck_xprivate( char *, int );
+char *syck_xprivate( const char *, int );
char *syck_taguri( const char *, const char *, int );
int syck_tagcmp( const char *, const char * );
int syck_add_sym( SyckParser *, void * );
int syck_lookup_sym( SyckParser *, SYMID, void ** );
int syck_try_implicit( SyckNode * );
-char *syck_type_id_to_uri( char * );
+char *syck_type_id_to_uri( const char * );
void try_tag_implicit( SyckNode *, int );
const char *syck_match_implicit( const char *, size_t );
diff --git a/ext/syck/token.c b/ext/syck/token.c
index 045f81774fc..1b26e66bdb0 100644
--- a/ext/syck/token.c
+++ b/ext/syck/token.c
@@ -1116,7 +1116,7 @@ Directive:
#line 1117 "<stdout>"
{
YYCTYPE yych;
- unsigned int yyaccept;
+ unsigned int yyaccept = 0;
goto yy94;
++YYCURSOR;
yy94: