mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* enumerator.c (enumerator_each, enumerator_with_index): suppress
warnings. * pack.c (pack_unpack): ditto. * process.c (rb_syswait): ditto. * re.c (rb_reg_prepare_enc, rb_reg_prepare_re, rb_reg_adjust_startpos): ditto. * regparse.c (onig_name_to_group_numbers): ditto. * missing/vsnprintf.c (BSD_vfprintf): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f07ca6b1c4
commit
89c408704b
6 changed files with 15 additions and 23 deletions
|
@ -300,7 +300,6 @@ enumerator_each(VALUE obj)
|
|||
struct enumerator *e;
|
||||
int argc = 0;
|
||||
VALUE *argv = 0;
|
||||
VALUE method;
|
||||
|
||||
if (!rb_block_given_p()) return obj;
|
||||
e = enumerator_ptr(obj);
|
||||
|
@ -334,7 +333,6 @@ enumerator_with_index(VALUE obj)
|
|||
VALUE memo = 0;
|
||||
int argc = 0;
|
||||
VALUE *argv = 0;
|
||||
VALUE method;
|
||||
|
||||
RETURN_ENUMERATOR(obj, 0, 0);
|
||||
if (e->args) {
|
||||
|
|
|
@ -550,7 +550,7 @@ BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap)
|
|||
int fieldsz; /* field size expanded by sign, etc */
|
||||
int realsz; /* field size expanded by dprec */
|
||||
int size; /* size of converted field or string */
|
||||
char *xdigs; /* digits for [xX] conversion */
|
||||
char *xdigs = 0; /* digits for [xX] conversion */
|
||||
#define NIOV 8
|
||||
struct __suio uio; /* output information: summary */
|
||||
struct __siov iov[NIOV];/* ... and individual io vectors */
|
||||
|
@ -908,10 +908,11 @@ hex:
|
|||
/* leading 0x/X only if non-zero */
|
||||
if (flags & ALT &&
|
||||
#ifdef _HAVE_SANE_QUAD_
|
||||
(flags & QUADINT ? uqval != 0 : ulval != 0))
|
||||
(flags & QUADINT ? uqval != 0 : ulval != 0)
|
||||
#else /* _HAVE_SANE_QUAD_ */
|
||||
ulval != 0)
|
||||
ulval != 0
|
||||
#endif /* _HAVE_SANE_QUAD_ */
|
||||
)
|
||||
flags |= HEXPREFIX;
|
||||
|
||||
/* unsigned conversions */
|
||||
|
@ -935,10 +936,10 @@ number: if ((dprec = prec) >= 0)
|
|||
if (uqval != 0 || prec != 0)
|
||||
cp = BSD__uqtoa(uqval, cp, base,
|
||||
flags & ALT, xdigs);
|
||||
} else {
|
||||
} else
|
||||
#else /* _HAVE_SANE_QUAD_ */
|
||||
{
|
||||
#endif /* _HAVE_SANE_QUAD_ */
|
||||
{
|
||||
if (ulval != 0 || prec != 0)
|
||||
cp = BSD__ultoa(ulval, cp, base,
|
||||
flags & ALT, xdigs);
|
||||
|
|
10
pack.c
10
pack.c
|
@ -1871,8 +1871,8 @@ pack_unpack(VALUE str, VALUE fmt)
|
|||
|
||||
case 'P':
|
||||
if (sizeof(char *) <= send - s) {
|
||||
VALUE tmp = Qnil;
|
||||
char *t;
|
||||
VALUE tmp;
|
||||
|
||||
memcpy(&t, s, sizeof(char *));
|
||||
s += sizeof(char *);
|
||||
|
@ -1902,9 +1902,6 @@ pack_unpack(VALUE str, VALUE fmt)
|
|||
rb_raise(rb_eArgError, "non associated pointer");
|
||||
}
|
||||
}
|
||||
else {
|
||||
tmp = Qnil;
|
||||
}
|
||||
UNPACK_PUSH(tmp);
|
||||
}
|
||||
break;
|
||||
|
@ -1916,7 +1913,7 @@ pack_unpack(VALUE str, VALUE fmt)
|
|||
if (send - s < sizeof(char *))
|
||||
break;
|
||||
else {
|
||||
VALUE tmp;
|
||||
VALUE tmp = Qnil;
|
||||
char *t;
|
||||
|
||||
memcpy(&t, s, sizeof(char *));
|
||||
|
@ -1941,9 +1938,6 @@ pack_unpack(VALUE str, VALUE fmt)
|
|||
rb_raise(rb_eArgError, "non associated pointer");
|
||||
}
|
||||
}
|
||||
else {
|
||||
tmp = Qnil;
|
||||
}
|
||||
UNPACK_PUSH(tmp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1673,12 +1673,12 @@ rb_syswait(rb_pid_t pid)
|
|||
{
|
||||
static int overriding;
|
||||
#ifdef SIGHUP
|
||||
RETSIGTYPE (*hfunc)(int);
|
||||
RETSIGTYPE (*hfunc)(int) = 0;
|
||||
#endif
|
||||
#ifdef SIGQUIT
|
||||
RETSIGTYPE (*qfunc)(int);
|
||||
RETSIGTYPE (*qfunc)(int) = 0;
|
||||
#endif
|
||||
RETSIGTYPE (*ifunc)(int);
|
||||
RETSIGTYPE (*ifunc)(int) = 0;
|
||||
int status;
|
||||
int i, hooked = Qfalse;
|
||||
|
||||
|
|
8
re.c
8
re.c
|
@ -1150,7 +1150,6 @@ static rb_encoding*
|
|||
rb_reg_prepare_enc(VALUE re, VALUE str, int warn)
|
||||
{
|
||||
rb_encoding *enc = 0;
|
||||
regex_t *reg;
|
||||
|
||||
if (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN) {
|
||||
rb_raise(rb_eArgError,
|
||||
|
@ -1189,7 +1188,7 @@ rb_reg_prepare_re(VALUE re, rb_encoding *enc)
|
|||
onig_errmsg_buffer err = "";
|
||||
int r;
|
||||
OnigErrorInfo einfo;
|
||||
UChar *pattern;
|
||||
const char *pattern;
|
||||
VALUE unescaped;
|
||||
rb_encoding *fixed_enc = 0;
|
||||
|
||||
|
@ -1197,7 +1196,7 @@ rb_reg_prepare_re(VALUE re, rb_encoding *enc)
|
|||
|
||||
rb_reg_check(re);
|
||||
reg = RREGEXP(re)->ptr;
|
||||
pattern = ((UChar*)RREGEXP(re)->str);
|
||||
pattern = RREGEXP(re)->str;
|
||||
|
||||
unescaped = rb_reg_preprocess(
|
||||
pattern, pattern + RREGEXP(re)->len, enc,
|
||||
|
@ -1213,7 +1212,7 @@ rb_reg_prepare_re(VALUE re, rb_encoding *enc)
|
|||
OnigDefaultSyntax, &einfo);
|
||||
if (r) {
|
||||
onig_error_code_to_str((UChar*)err, r, &einfo);
|
||||
rb_reg_raise((char*)pattern, RREGEXP(re)->len, err, re);
|
||||
rb_reg_raise(pattern, RREGEXP(re)->len, err, re);
|
||||
}
|
||||
|
||||
RB_GC_GUARD(unescaped);
|
||||
|
@ -1226,7 +1225,6 @@ rb_reg_adjust_startpos(VALUE re, VALUE str, int pos, int reverse)
|
|||
int range;
|
||||
rb_encoding *enc;
|
||||
UChar *p, *string;
|
||||
regex_t *reg;
|
||||
|
||||
enc = rb_reg_prepare_enc(re, str, 0);
|
||||
|
||||
|
|
|
@ -825,6 +825,7 @@ onig_name_to_group_numbers(regex_t* reg, const UChar* name,
|
|||
|
||||
switch (e->back_num) {
|
||||
case 0:
|
||||
*nums = 0;
|
||||
break;
|
||||
case 1:
|
||||
*nums = &(e->back_ref1);
|
||||
|
|
Loading…
Reference in a new issue