Skip to content

Commit

Permalink
* class.c (rb_obj_methods), compile.c (iseq_compile_each),
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
nobu committed Dec 5, 2011
1 parent 0e4b86b commit 8baffe6
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 35 deletions.
16 changes: 15 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
Mon Dec 5 14:33:41 2011 Nobuyoshi Nakada <[email protected]>
Mon Dec 5 18:50:08 2011 Nobuyoshi Nakada <[email protected]>

* 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 <[email protected]>

* 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.

Expand Down
3 changes: 0 additions & 3 deletions class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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));
}
Expand Down
5 changes: 3 additions & 2 deletions iseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++));
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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)));
Expand Down
14 changes: 1 addition & 13 deletions pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down
10 changes: 3 additions & 7 deletions transcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions vm_eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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";
}
Expand Down

0 comments on commit 8baffe6

Please sign in to comment.