Skip to content

Commit

Permalink
* enumerator.c (enumerator_each, enumerator_with_index): suppress
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
nobu committed Apr 22, 2008
1 parent f07ca6b commit 89c4087
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 23 deletions.
2 changes: 0 additions & 2 deletions enumerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
11 changes: 6 additions & 5 deletions missing/vsnprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -908,10 +908,11 @@ fp_begin: _double = va_arg(ap, double);
/* 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 */
Expand All @@ -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);
Expand Down
10 changes: 2 additions & 8 deletions pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down Expand Up @@ -1902,9 +1902,6 @@ pack_unpack(VALUE str, VALUE fmt)
rb_raise(rb_eArgError, "non associated pointer");
}
}
else {
tmp = Qnil;
}
UNPACK_PUSH(tmp);
}
break;
Expand All @@ -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 *));
Expand All @@ -1941,9 +1938,6 @@ pack_unpack(VALUE str, VALUE fmt)
rb_raise(rb_eArgError, "non associated pointer");
}
}
else {
tmp = Qnil;
}
UNPACK_PUSH(tmp);
}
}
Expand Down
6 changes: 3 additions & 3 deletions process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 3 additions & 5 deletions re.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1189,15 +1188,15 @@ 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;

if (reg->enc == enc) return reg;

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,
Expand All @@ -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);
Expand All @@ -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);

Expand Down
1 change: 1 addition & 0 deletions regparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 89c4087

Please sign in to comment.