From 0455e8ea9a6a8d33840249806b03d75ea25820d8 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 7 Jun 2008 12:38:03 +0000 Subject: [PATCH] * io.c (rb_f_open), re.c (rb_reg_search), transcode.c (str_transcode): suppress warnings. * util.c (quorem, rv_alloc, nrv_alloc): only used in dtoa(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ io.c | 2 +- re.c | 3 +-- transcode.c | 4 ++-- util.c | 4 ++++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b62941cb8..9c485ae292 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sat Jun 7 21:37:58 2008 Nobuyoshi Nakada + + * io.c (rb_f_open), re.c (rb_reg_search), transcode.c (str_transcode): + suppress warnings. + + * util.c (quorem, rv_alloc, nrv_alloc): only used in dtoa(). + Sat Jun 7 16:06:14 2008 Nobuyoshi Nakada * configure.in (CFLAGS, CXXFLAGS): append default flags. diff --git a/io.c b/io.c index 625766be6a..40f9abfd21 100644 --- a/io.c +++ b/io.c @@ -4215,7 +4215,7 @@ rb_io_s_sysopen(int argc, VALUE *argv) static VALUE rb_f_open(int argc, VALUE *argv) { - ID to_open; + ID to_open = 0; int redirect = Qfalse; if (argc >= 1) { diff --git a/re.c b/re.c index 8ce5e89c28..51809f5ee1 100644 --- a/re.c +++ b/re.c @@ -1279,7 +1279,7 @@ rb_reg_search(VALUE re, VALUE str, int pos, int reverse) { int result; VALUE match; - struct re_registers *regs, regi; + struct re_registers regi, *regs = ®i; char *range = RSTRING_PTR(str); regex_t *reg0 = RREGEXP(re)->ptr, *reg; int busy = FL_TEST(re, REG_BUSY); @@ -1301,7 +1301,6 @@ rb_reg_search(VALUE re, VALUE str, int pos, int reverse) } } if (NIL_P(match)) { - regs = ®i; MEMZERO(regs, struct re_registers, 1); } FL_SET(re, REG_BUSY); diff --git a/transcode.c b/transcode.c index f58c683357..02c82c5c3b 100644 --- a/transcode.c +++ b/transcode.c @@ -309,7 +309,7 @@ str_transcode(int argc, VALUE *argv, VALUE *self) return -1; } - while (!final_encoding) { /* loop for multistep transcoding */ + do { /* loop for multistep transcoding */ /* later, maybe use smaller intermediate strings for very long strings */ if (!(my_transcoder = transcode_dispatch(from_e, to_e))) { rb_raise(rb_eArgError, "transcoding not supported (from %s to %s)", from_e, to_e); @@ -372,7 +372,7 @@ str_transcode(int argc, VALUE *argv, VALUE *self) from_e = my_transcoder->to_encoding; str = dest; } - } + } while (!final_encoding); /* set encoding */ if (!to_enc) { to_encidx = rb_define_dummy_encoding(to_e); diff --git a/util.c b/util.c index 6c5f498932..125b99103e 100644 --- a/util.c +++ b/util.c @@ -3067,6 +3067,7 @@ ret: return sign ? -dval(rv) : dval(rv); } +#if 0 /* unused right now */ static int quorem(Bigint *b, Bigint *S) { @@ -3177,11 +3178,13 @@ quorem(Bigint *b, Bigint *S) } return q; } +#endif #ifndef MULTIPLE_THREADS static char *dtoa_result; #endif +#if 0 /* unused right now */ static char * rv_alloc(int i) { @@ -3212,6 +3215,7 @@ nrv_alloc(const char *s, char **rve, int n) *rve = t; return rv; } +#endif /* freedtoa(s) must be used to free values s returned by dtoa * when MULTIPLE_THREADS is #defined. It should be used in all cases,