* removed spaces just before tabs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-11-26 05:25:08 +00:00
parent f5202fdbc7
commit 4d786d21e3
15 changed files with 35 additions and 35 deletions

View File

@ -1904,8 +1904,8 @@ bigmul1_karatsuba(VALUE x, VALUE y)
if (!BIGZEROP(xl) && !BIGZEROP(yl)) { if (!BIGZEROP(xl) && !BIGZEROP(yl)) {
/* t2 <- xl * yl */ /* t2 <- xl * yl */
t2 = bigmul0(xl, yl); t2 = bigmul0(xl, yl);
t2n = big_real_len(t2); t2n = big_real_len(t2);
/* copy t2 into low bytes of the result (z0) */ /* copy t2 into low bytes of the result (z0) */
MEMCPY(zds, BDIGITS(t2), BDIGIT, t2n); MEMCPY(zds, BDIGITS(t2), BDIGIT, t2n);
@ -2013,7 +2013,7 @@ dump_bignum(VALUE x)
long i; long i;
printf("0x0"); printf("0x0");
for (i = RBIGNUM_LEN(x); i--; ) { for (i = RBIGNUM_LEN(x); i--; ) {
printf("_%08x", BDIGITS(x)[i]); printf("_%08x", BDIGITS(x)[i]);
} }
puts(""); puts("");
} }
@ -2041,7 +2041,7 @@ bigmul0(VALUE x, VALUE y)
normal: normal:
if (x == y) return bigsqr_fast(x); if (x == y) return bigsqr_fast(x);
if (xn == 1 && yn == 1) return bigmul1_single(x, y); if (xn == 1 && yn == 1) return bigmul1_single(x, y);
return bigmul1_normal(x, y); return bigmul1_normal(x, y);
} }
/* normal multiplication when x or y is a sparse bignum */ /* normal multiplication when x or y is a sparse bignum */

View File

@ -664,7 +664,7 @@ rb_enc_associate_index(VALUE obj, int idx)
{ {
/* enc_check_capable(obj);*/ /* enc_check_capable(obj);*/
if (rb_enc_get_index(obj) == idx) if (rb_enc_get_index(obj) == idx)
return obj; return obj;
if (SPECIAL_CONST_P(obj)) { if (SPECIAL_CONST_P(obj)) {
rb_raise(rb_eArgError, "cannot set encoding"); rb_raise(rb_eArgError, "cannot set encoding");
} }

2
gc.c
View File

@ -1009,7 +1009,7 @@ rb_newobj_from_heap(rb_objspace_t *objspace)
VALUE obj; VALUE obj;
if ((ruby_gc_stress && !ruby_disable_gc_stress) || !freelist) { if ((ruby_gc_stress && !ruby_disable_gc_stress) || !freelist) {
if (!heaps_increment(objspace) && !garbage_collect(objspace)) { if (!heaps_increment(objspace) && !garbage_collect(objspace)) {
during_gc = 0; during_gc = 0;
rb_memerror(); rb_memerror();
} }

2
hash.c
View File

@ -193,7 +193,7 @@ static VALUE
hash_foreach_call(struct hash_foreach_arg *arg) hash_foreach_call(struct hash_foreach_arg *arg)
{ {
if (st_foreach(RHASH(arg->hash)->ntbl, hash_foreach_iter, (st_data_t)arg)) { if (st_foreach(RHASH(arg->hash)->ntbl, hash_foreach_iter, (st_data_t)arg)) {
rb_raise(rb_eRuntimeError, "hash modified during iteration"); rb_raise(rb_eRuntimeError, "hash modified during iteration");
} }
return Qnil; return Qnil;
} }

2
io.c
View File

@ -5648,7 +5648,7 @@ io_reopen(VALUE io, VALUE nfile)
nfile = rb_io_get_io(nfile); nfile = rb_io_get_io(nfile);
if (rb_safe_level() >= 4 && if (rb_safe_level() >= 4 &&
(!OBJ_UNTRUSTED(io) || !OBJ_UNTRUSTED(nfile))) { (!OBJ_UNTRUSTED(io) || !OBJ_UNTRUSTED(nfile))) {
rb_raise(rb_eSecurityError, "Insecure: can't reopen"); rb_raise(rb_eSecurityError, "Insecure: can't reopen");
} }
GetOpenFile(io, fptr); GetOpenFile(io, fptr);

10
re.c
View File

@ -113,7 +113,7 @@ rb_memsearch_ss(const unsigned char *xs, long m, const unsigned char *ys, long n
if (m > SIZEOF_VALUE) if (m > SIZEOF_VALUE)
rb_bug("!!too long pattern string!!"); rb_bug("!!too long pattern string!!");
/* Prepare hash value */ /* Prepare hash value */
for (hx = *x++, hy = *y++; x < xe; ++x, ++y) { for (hx = *x++, hy = *y++; x < xe; ++x, ++y) {
hx <<= CHAR_BIT; hx <<= CHAR_BIT;
hy <<= CHAR_BIT; hy <<= CHAR_BIT;
@ -356,7 +356,7 @@ rb_reg_expr_str(VALUE str, const char *s, long len)
} }
else if (c == -1) { else if (c == -1) {
int l = mbclen(p, pend, enc); int l = mbclen(p, pend, enc);
rb_str_buf_cat(str, p, l); rb_str_buf_cat(str, p, l);
p += l; p += l;
continue; continue;
} }
@ -526,9 +526,9 @@ rb_reg_to_s(VALUE re)
rb_enc_get(re), rb_enc_get(re),
OnigDefaultSyntax); OnigDefaultSyntax);
if (r == 0) { if (r == 0) {
++ptr; ++ptr;
len -= 2; len -= 2;
err = (onig_compile(rp, ptr, ptr + len, NULL, NULL, 0) != 0); err = (onig_compile(rp, ptr, ptr + len, NULL, NULL, 0) != 0);
} }
onig_free(rp); onig_free(rp);
} }

View File

@ -205,17 +205,17 @@ static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,
while (p < end) { while (p < end) {
code = ONIGENC_MBC_TO_CODE(enc, p, end); code = ONIGENC_MBC_TO_CODE(enc, p, end);
if (code >= 0x80) { if (code >= 0x80) {
if (code > 0xffff && len + 10 <= buf_size) { if (code > 0xffff && len + 10 <= buf_size) {
sprint_byte_with_x((char*)(&(buf[len])), (unsigned int)(code >> 24)); sprint_byte_with_x((char*)(&(buf[len])), (unsigned int)(code >> 24));
sprint_byte((char*)(&(buf[len+4])), (unsigned int)(code >> 16)); sprint_byte((char*)(&(buf[len+4])), (unsigned int)(code >> 16));
sprint_byte((char*)(&(buf[len+6])), (unsigned int)(code >> 8)); sprint_byte((char*)(&(buf[len+6])), (unsigned int)(code >> 8));
sprint_byte((char*)(&(buf[len+8])), (unsigned int)code); sprint_byte((char*)(&(buf[len+8])), (unsigned int)code);
len += 10; len += 10;
} }
else if (len + 6 <= buf_size) { else if (len + 6 <= buf_size) {
sprint_byte_with_x((char*)(&(buf[len])), (unsigned int)(code >> 8)); sprint_byte_with_x((char*)(&(buf[len])), (unsigned int)(code >> 8));
sprint_byte((char*)(&(buf[len+4])), (unsigned int)code); sprint_byte((char*)(&(buf[len+4])), (unsigned int)code);
len += 6; len += 6;
} }
else { else {
break; break;

View File

@ -879,7 +879,7 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
}\ }\
k++;\ k++;\
}\ }\
break;\ break;\
}\ }\
}\ }\
}\ }\
@ -920,7 +920,7 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
}\ }\
k++;\ k++;\
}\ }\
break;\ break;\
}\ }\
}\ }\
else {\ else {\

View File

@ -521,7 +521,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct vtm *vtm,
* live without, but it would be a great help to those of * live without, but it would be a great help to those of
* us that muck around with various message processors. * us that muck around with various message processors.
*/ */
case 'z': /* time zone offset east of GMT e.g. -0600 */ case 'z': /* time zone offset east of GMT e.g. -0600 */
if (precision < 4) precision = 4; if (precision < 4) precision = 4;
NEEDS(precision + 1); NEEDS(precision + 1);
if (gmt) { if (gmt) {
@ -949,7 +949,7 @@ iso8601wknum(const struct tm *timeptr)
* and that * and that
* timeptr->tm_wday MOD 7 == timeptr->tm_wday * timeptr->tm_wday MOD 7 == timeptr->tm_wday
* from which it follows that. . . * from which it follows that. . .
*/ */
jan1day = timeptr->tm_wday - (timeptr->tm_yday % 7); jan1day = timeptr->tm_wday - (timeptr->tm_yday % 7);
if (jan1day < 0) if (jan1day < 0)
jan1day += 7; jan1day += 7;

View File

@ -3902,7 +3902,7 @@ rb_str_reverse_bang(VALUE str)
while (s < e) { while (s < e) {
c = *s; c = *s;
*s++ = *e; *s++ = *e;
*e-- = c; *e-- = c;
} }
} }
else { else {

2
time.c
View File

@ -3554,7 +3554,7 @@ time_strftime(VALUE time, VALUE format)
} }
else { else {
len = rb_strftime_alloc(&buf, RSTRING_PTR(format), len = rb_strftime_alloc(&buf, RSTRING_PTR(format),
&tobj->vtm, rb_time_unmagnify(tobj->timexv), TIME_UTC_P(tobj)); &tobj->vtm, rb_time_unmagnify(tobj->timexv), TIME_UTC_P(tobj));
} }
str = rb_str_new(buf, len); str = rb_str_new(buf, len);
if (buf != buffer) xfree(buf); if (buf != buffer) xfree(buf);

View File

@ -675,7 +675,7 @@ transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos,
case UNDEF: case UNDEF:
goto undef; goto undef;
default: default:
rb_raise(rb_eRuntimeError, "unknown transcoding instruction"); rb_raise(rb_eRuntimeError, "unknown transcoding instruction");
} }
continue; continue;

4
util.c
View File

@ -291,7 +291,7 @@ ruby_add_suffix(VALUE str, const char *suffix)
while ((*t = *s) && *s != '.') { while ((*t = *s) && *s != '.') {
baselen++; baselen++;
if (*s == '\\' || *s == '/') baselen = 0; if (*s == '\\' || *s == '/') baselen = 0;
s++; t++; s++; t++;
} }
p = t; p = t;
@ -309,7 +309,7 @@ ruby_add_suffix(VALUE str, const char *suffix)
ext[++extlen] = '\0'; ext[++extlen] = '\0';
} }
else if (baselen < 8) { else if (baselen < 8) {
*p++ = *suffix; *p++ = *suffix;
} }
else if (ext[3] != *suffix) { else if (ext[3] != *suffix) {
ext[3] = *suffix; ext[3] = *suffix;

View File

@ -784,7 +784,7 @@ rb_alias_variable(ID name1, ID name2)
entry2 = rb_global_entry(name2); entry2 = rb_global_entry(name2);
if (!st_lookup(rb_global_tbl, (st_data_t)name1, &data1)) { if (!st_lookup(rb_global_tbl, (st_data_t)name1, &data1)) {
entry1 = ALLOC(struct global_entry); entry1 = ALLOC(struct global_entry);
entry1->id = name1; entry1->id = name1;
st_add_direct(rb_global_tbl, name1, (st_data_t)entry1); st_add_direct(rb_global_tbl, name1, (st_data_t)entry1);
} }

View File

@ -154,7 +154,7 @@ rb_add_method_def(VALUE klass, ID mid, rb_method_type_t type, rb_method_definiti
klass = rb_cObject; klass = rb_cObject;
} }
if (rb_safe_level() >= 4 && if (rb_safe_level() >= 4 &&
(klass == rb_cObject || !OBJ_UNTRUSTED(klass))) { (klass == rb_cObject || !OBJ_UNTRUSTED(klass))) {
rb_raise(rb_eSecurityError, "Insecure: can't define method"); rb_raise(rb_eSecurityError, "Insecure: can't define method");
} }
if (!FL_TEST(klass, FL_SINGLETON) && if (!FL_TEST(klass, FL_SINGLETON) &&