1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* class.c (rb_obj_methods), compile.c (iseq_compile_each),

iseq.c(iseq_load, rb_iseq_parameters), pack.c (pack_pack),
  regcomp.c (is_not_included, update_string_node_case_fold),
  transcode.c (rb_econv_open0, make_replacement),
  vm_eval.c (raise_method_missing): remove unused variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-12-05 09:50:12 +00:00
parent 0e4b86b5b9
commit 8baffe6ef6
8 changed files with 24 additions and 35 deletions

View file

@ -1,4 +1,18 @@
Mon Dec 5 14:33:41 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
Mon Dec 5 18:50:08 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* class.c (rb_obj_methods), compile.c (iseq_compile_each),
iseq.c(iseq_load, rb_iseq_parameters), pack.c (pack_pack),
regcomp.c (is_not_included, update_string_node_case_fold),
transcode.c (rb_econv_open0, make_replacement),
vm_eval.c (raise_method_missing): remove unused variable.
Mon Dec 5 18:49:52 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* class.c (rb_obj_methods), compile.c (iseq_compile_each),
iseq.c(iseq_load, rb_iseq_parameters), pack.c (pack_pack),
regcomp.c (is_not_included, update_string_node_case_fold),
transcode.c (rb_econv_open0, make_replacement),
vm_eval.c (raise_method_missing): remove unused variable.
* signal.c (reserved_signal_p): static.

View file

@ -1135,9 +1135,6 @@ rb_obj_methods(int argc, VALUE *argv, VALUE obj)
{
retry:
if (argc == 0) {
VALUE args[1];
args[0] = Qtrue;
return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_i);
}
else {

View file

@ -3293,7 +3293,6 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
VALUE prevblock = iseq->compile_data->current_block;
LABEL *retry_label = NEW_LABEL(nd_line(node));
LABEL *retry_end_l = NEW_LABEL(nd_line(node));
ID mid = 0;
ADD_LABEL(ret, retry_label);
if (nd_type(node) == NODE_FOR) {
@ -3303,7 +3302,6 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
ISEQ_TYPE_BLOCK, nd_line(node));
mid = idEach;
ADD_SEND_R(ret, nd_line(node), ID2SYM(idEach), INT2FIX(0),
iseq->compile_data->current_block, INT2FIX(0));
}

5
iseq.c
View file

@ -463,6 +463,7 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt)
version2 = CHECK_INTEGER(rb_ary_entry(data, i++));
format_type = CHECK_INTEGER(rb_ary_entry(data, i++));
misc = rb_ary_entry(data, i++); /* TODO */
((void)magic, (void)version1, (void)version2, (void)format_type, (void)misc);
name = CHECK_STRING(rb_ary_entry(data, i++));
filename = CHECK_STRING(rb_ary_entry(data, i++));
@ -1381,7 +1382,7 @@ rb_iseq_clone(VALUE iseqval, VALUE newcbase)
VALUE
rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
{
int i, r, s;
int i, r;
VALUE a, args = rb_ary_new2(iseq->arg_size);
ID req, opt, rest, block;
#define PARAM_TYPE(type) rb_ary_push(a = rb_ary_new2(2), ID2SYM(type))
@ -1410,7 +1411,7 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
iseq->arg_post_len > 0 ? iseq->arg_post_start :
iseq->arg_block != -1 ? iseq->arg_block :
iseq->arg_size;
for (s = i; i < r; i++) {
for (; i < r; i++) {
PARAM_TYPE(opt);
if (rb_id2name(PARAM_ID(i))) {
rb_ary_push(a, ID2SYM(PARAM_ID(i)));

14
pack.c
View file

@ -378,7 +378,7 @@ pack_pack(VALUE ary, VALUE fmt)
#ifdef NATINT_PACK
int natint; /* native integer */
#endif
int signed_p, integer_size, bigendian_p;
int integer_size, bigendian_p;
StringValue(fmt);
p = RSTRING_PTR(fmt);
@ -648,73 +648,61 @@ pack_pack(VALUE ary, VALUE fmt)
break;
case 's': /* signed short */
signed_p = 1;
integer_size = NATINT_LEN(short, 2);
bigendian_p = BIGENDIAN_P();
goto pack_integer;
case 'S': /* unsigned short */
signed_p = 0;
integer_size = NATINT_LEN(short, 2);
bigendian_p = BIGENDIAN_P();
goto pack_integer;
case 'i': /* signed int */
signed_p = 1;
integer_size = (int)sizeof(int);
bigendian_p = BIGENDIAN_P();
goto pack_integer;
case 'I': /* unsigned int */
signed_p = 0;
integer_size = (int)sizeof(int);
bigendian_p = BIGENDIAN_P();
goto pack_integer;
case 'l': /* signed long */
signed_p = 1;
integer_size = NATINT_LEN(long, 4);
bigendian_p = BIGENDIAN_P();
goto pack_integer;
case 'L': /* unsigned long */
signed_p = 0;
integer_size = NATINT_LEN(long, 4);
bigendian_p = BIGENDIAN_P();
goto pack_integer;
case 'q': /* signed quad (64bit) int */
signed_p = 1;
integer_size = 8;
bigendian_p = BIGENDIAN_P();
goto pack_integer;
case 'Q': /* unsigned quad (64bit) int */
signed_p = 0;
integer_size = 8;
bigendian_p = BIGENDIAN_P();
goto pack_integer;
case 'n': /* unsigned short (network byte-order) */
signed_p = 0;
integer_size = 2;
bigendian_p = 1;
goto pack_integer;
case 'N': /* unsigned long (network byte-order) */
signed_p = 0;
integer_size = 4;
bigendian_p = 1;
goto pack_integer;
case 'v': /* unsigned short (VAX byte-order) */
signed_p = 0;
integer_size = 2;
bigendian_p = 0;
goto pack_integer;
case 'V': /* unsigned long (VAX byte-order) */
signed_p = 0;
integer_size = 4;
bigendian_p = 0;
goto pack_integer;

View file

@ -2433,7 +2433,7 @@ is_not_included(Node* x, Node* y, regex_t* reg)
int i;
OnigDistance len;
OnigCodePoint code;
UChar *p, c;
UChar *p;
int ytype;
retry:
@ -2547,7 +2547,6 @@ is_not_included(Node* x, Node* y, regex_t* reg)
if (NSTRING_LEN(x) == 0)
break;
c = *(xs->s);
switch (ytype) {
case NT_CTYPE:
switch (NCTYPE(y)->ctype) {
@ -3223,7 +3222,7 @@ next_setup(Node* node, Node* next_node, regex_t* reg)
static int
update_string_node_case_fold(regex_t* reg, Node *node)
{
UChar *p, *q, *end, buf[ONIGENC_MBC_CASE_FOLD_MAXLEN];
UChar *p, *end, buf[ONIGENC_MBC_CASE_FOLD_MAXLEN];
UChar *sbuf, *ebuf, *sp;
int r, i, len;
OnigDistance sbuf_size;
@ -3239,7 +3238,6 @@ update_string_node_case_fold(regex_t* reg, Node *node)
p = sn->s;
while (p < end) {
len = ONIGENC_MBC_CASE_FOLD(reg->enc, reg->case_fold_flag, &p, end, buf);
q = buf;
for (i = 0; i < len; i++) {
if (sp >= ebuf) {
sbuf = (UChar* )xrealloc(sbuf, sbuf_size * 2);

View file

@ -979,22 +979,19 @@ rb_econv_open0(const char *sname, const char *dname, int ecflags)
int num_trans;
rb_econv_t *ec;
rb_encoding *senc, *denc;
int sidx, didx;
senc = NULL;
if (*sname) {
sidx = rb_enc_find_index(sname);
if (0 <= sidx) {
senc = rb_enc_from_index(sidx);
rb_enc_from_index(sidx);
}
}
denc = NULL;
if (*dname) {
didx = rb_enc_find_index(dname);
if (0 <= didx) {
denc = rb_enc_from_index(didx);
rb_enc_from_index(didx);
}
}
@ -2160,7 +2157,6 @@ make_replacement(rb_econv_t *ec)
{
rb_transcoding *tc;
const rb_transcoder *tr;
rb_encoding *enc;
const unsigned char *replacement;
const char *repl_enc;
const char *ins_enc;
@ -2174,7 +2170,7 @@ make_replacement(rb_econv_t *ec)
tc = ec->last_tc;
if (*ins_enc) {
tr = tc->transcoder;
enc = rb_enc_find(tr->dst_encoding);
rb_enc_find(tr->dst_encoding);
replacement = (const unsigned char *)get_replacement_character(ins_enc, &len, &repl_enc);
}
else {

View file

@ -526,7 +526,6 @@ static void
raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv, VALUE obj,
int last_call_status)
{
ID id;
VALUE exc = rb_eNoMethodError;
const char *format = 0;
@ -536,8 +535,6 @@ raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv, VALUE obj,
stack_check();
id = SYM2ID(argv[0]);
if (last_call_status & NOEX_PRIVATE) {
format = "private method `%s' called for %s";
}