summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--random.c4
-rw-r--r--re.c5
3 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index b037b27a64..541f7bb2cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Oct 4 09:47:39 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * random.c (rand_init): remove useless assignment.
+
+ * re.c (update_char_offset): remove unused variable.
+
+ * re.c (read_escaped_byte): ditto.
+
Mon Oct 4 09:30:42 2010 NARUSE, Yui <naruse@ruby-lang.org>
* ext/openssl/lib/openssl/bn.rb (Integer#to_bn): OpenSSL::BN.new
diff --git a/random.c b/random.c
index 9044c77432..c630e9b6b5 100644
--- a/random.c
+++ b/random.c
@@ -415,7 +415,7 @@ rand_init(struct MT *mt, VALUE vseed)
}
else {
if (blen > MT_MAX_STATE * SIZEOF_INT32 / SIZEOF_BDIGITS)
- blen = (len = MT_MAX_STATE) * SIZEOF_INT32 / SIZEOF_BDIGITS;
+ blen = MT_MAX_STATE * SIZEOF_INT32 / SIZEOF_BDIGITS;
len = roomof((int)blen * SIZEOF_BDIGITS, SIZEOF_INT32);
}
/* allocate ints for init_by_array */
@@ -1066,7 +1066,7 @@ random_rand(int argc, VALUE *argv, VALUE obj)
v = Qnil;
}
else if (TYPE(vmax) != T_FLOAT && (v = rb_check_to_integer(vmax, "to_int"), !NIL_P(v))) {
- v = rand_int(&rnd->mt, vmax = v, 1);
+ v = rand_int(&rnd->mt, v, 1);
}
else if (v = rb_check_to_float(vmax), !NIL_P(v)) {
double max = float_value(v);
diff --git a/re.c b/re.c
index 298d1d9554..82507cfeff 100644
--- a/re.c
+++ b/re.c
@@ -859,7 +859,7 @@ update_char_offset(VALUE match)
struct re_registers *regs;
int i, num_regs, num_pos;
long c;
- char *s, *p, *q, *e;
+ char *s, *p, *q;
rb_encoding *enc;
pair_t *pairs;
@@ -895,7 +895,6 @@ update_char_offset(VALUE match)
qsort(pairs, num_pos, sizeof(pair_t), pair_byte_cmp);
s = p = RSTRING_PTR(RMATCH(match)->str);
- e = s + RSTRING_LEN(RMATCH(match)->str);
c = 0;
for (i = 0; i < num_pos; i++) {
q = s + pairs[i].byte_pos;
@@ -1899,9 +1898,7 @@ read_escaped_byte(const char **pp, const char *end, onig_errmsg_buffer err)
int code;
int meta_prefix = 0, ctrl_prefix = 0;
size_t len;
- int retbyte;
- retbyte = -1;
if (p == end || *p++ != '\\') {
errcpy(err, "too short escaped multibyte character");
return -1;