summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/array.c4
-rw-r--r--src/class.c6
-rw-r--r--src/codegen.c24
-rw-r--r--src/error.c26
-rw-r--r--src/gc.c4
-rw-r--r--src/hash.c8
-rw-r--r--src/kernel.c8
-rw-r--r--src/load.c2
-rw-r--r--src/numeric.c8
-rw-r--r--src/sprintf.c4
-rw-r--r--src/variable.c2
11 files changed, 48 insertions, 48 deletions
diff --git a/src/array.c b/src/array.c
index c767283aa..5a73ef54a 100644
--- a/src/array.c
+++ b/src/array.c
@@ -140,7 +140,7 @@ ary_modify(mrb_state *mrb, struct RArray *a)
len = a->len * sizeof(mrb_value);
ptr = (mrb_value *)mrb_malloc(mrb, len);
if (p) {
- array_copy(ptr, p, a->len);
+ array_copy(ptr, p, a->len);
}
a->ptr = ptr;
a->aux.capa = a->len;
@@ -1125,7 +1125,7 @@ mrb_ary_eql(mrb_state *mrb, mrb_value ary1)
for (i=0; i<RARRAY_LEN(ary1); i++) {
if (!mrb_eql(mrb, ary_elt(ary1, i), ary_elt(ary2, i)))
- return mrb_false_value();
+ return mrb_false_value();
}
return mrb_true_value();
}
diff --git a/src/class.c b/src/class.c
index c0e71dad7..a7fae4f63 100644
--- a/src/class.c
+++ b/src/class.c
@@ -29,7 +29,7 @@ mrb_gc_mark_mt(mrb_state *mrb, struct RClass *c)
if (kh_exist(h, k)){
struct RProc *m = kh_value(h, k);
if (m) {
- mrb_gc_mark(mrb, (struct RBasic*)m);
+ mrb_gc_mark(mrb, (struct RBasic*)m);
}
}
}
@@ -356,7 +356,7 @@ to_hash(mrb_state *mrb, mrb_value val)
retrieve arguments from mrb_state.
mrb_get_args(mrb, format, ...)
-
+
returns number of arguments parsed.
fortmat specifiers:
@@ -774,7 +774,7 @@ mrb_mod_include_p(mrb_state *mrb, mrb_value mod)
}
return mrb_false_value();
}
-
+
static mrb_value
mrb_mod_ancestors(mrb_state *mrb, mrb_value self)
{
diff --git a/src/codegen.c b/src/codegen.c
index ff7e87c28..29fce8fc4 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -330,7 +330,7 @@ genop_peep(codegen_scope *s, mrb_code i, int val)
if (c1 == OP_SUB) c = -c;
if (c > 127 || c < -127) break;
- if (0 <= c)
+ if (0 <= c)
s->iseq[s->pc-1] = MKOP_ABC(OP_ADDI, GETARG_A(i), GETARG_B(i), c);
else
s->iseq[s->pc-1] = MKOP_ABC(OP_SUBI, GETARG_A(i), GETARG_B(i), -c);
@@ -1161,7 +1161,7 @@ codegen(codegen_scope *s, node *tree, int val)
if (e) {
if (val) pop();
pos2 = new_label(s);
- genop(s, MKOP_sBx(OP_JMP, 0));
+ genop(s, MKOP_sBx(OP_JMP, 0));
dispatch(s, pos1);
codegen(s, e, val);
dispatch(s, pos2);
@@ -1951,7 +1951,7 @@ codegen(codegen_scope *s, node *tree, int val)
pop();
sym = new_sym(s, mrb_intern(s->mrb, "compile"));
genop(s, MKOP_ABC(OP_SEND, cursp(), sym, argc));
- mrb_gc_arena_restore(s->mrb, ai);
+ mrb_gc_arena_restore(s->mrb, ai);
push();
}
break;
@@ -1979,16 +1979,16 @@ codegen(codegen_scope *s, node *tree, int val)
}
n = tree->cdr->cdr;
if (n->car) {
- p = (char*)n->car;
- off = new_lit(s, mrb_str_new(s->mrb, p, strlen(p)));
- codegen(s, tree->car, VAL);
- genop(s, MKOP_ABx(OP_STRING, cursp(), off));
- pop();
- genop(s, MKOP_AB(OP_STRCAT, cursp(), cursp()+1));
+ p = (char*)n->car;
+ off = new_lit(s, mrb_str_new(s->mrb, p, strlen(p)));
+ codegen(s, tree->car, VAL);
+ genop(s, MKOP_ABx(OP_STRING, cursp(), off));
+ pop();
+ genop(s, MKOP_AB(OP_STRCAT, cursp(), cursp()+1));
}
if (n->cdr) {
- char *p2 = (char*)n->cdr;
- int off;
+ char *p2 = (char*)n->cdr;
+ int off;
push();
off = new_lit(s, mrb_str_new(s->mrb, p2, strlen(p2)));
@@ -1999,7 +1999,7 @@ codegen(codegen_scope *s, node *tree, int val)
pop();
sym = new_sym(s, mrb_intern(s->mrb, "compile"));
genop(s, MKOP_ABC(OP_SEND, cursp(), sym, argc));
- mrb_gc_arena_restore(s->mrb, ai);
+ mrb_gc_arena_restore(s->mrb, ai);
push();
}
else {
diff --git a/src/error.c b/src/error.c
index 70a84455f..7599bd0a9 100644
--- a/src/error.c
+++ b/src/error.c
@@ -125,7 +125,7 @@ exc_inspect(mrb_state *mrb, mrb_value exc)
mesg = mrb_attr_get(mrb, exc, mrb_intern(mrb, "mesg"));
file = mrb_attr_get(mrb, exc, mrb_intern(mrb, "file"));
line = mrb_attr_get(mrb, exc, mrb_intern(mrb, "line"));
-
+
if (!mrb_nil_p(file) && !mrb_nil_p(line)) {
str = file;
mrb_str_cat2(mrb, str, ":");
@@ -190,12 +190,12 @@ exc_debug_info(mrb_state *mrb, struct RObject *exc)
ci--;
while (ci >= mrb->cibase) {
if (ci->proc && !MRB_PROC_CFUNC_P(ci->proc)) {
- mrb_irep *irep = ci->proc->body.irep;
+ mrb_irep *irep = ci->proc->body.irep;
if (irep->filename && irep->lines && irep->iseq <= pc && pc < irep->iseq + irep->ilen) {
- mrb_obj_iv_set(mrb, exc, mrb_intern(mrb, "file"), mrb_str_new_cstr(mrb, irep->filename));
- mrb_obj_iv_set(mrb, exc, mrb_intern(mrb, "line"), mrb_fixnum_value(irep->lines[pc - irep->iseq - 1]));
- return;
+ mrb_obj_iv_set(mrb, exc, mrb_intern(mrb, "file"), mrb_str_new_cstr(mrb, irep->filename));
+ mrb_obj_iv_set(mrb, exc, mrb_intern(mrb, "line"), mrb_fixnum_value(irep->lines[pc - irep->iseq - 1]));
+ return;
}
}
pc = ci->pc;
@@ -366,14 +366,14 @@ make_exception(mrb_state *mrb, int argc, mrb_value *argv, int isstr)
n = 1;
exception_call:
{
- mrb_sym exc = mrb_intern(mrb, "exception");
- if (mrb_respond_to(mrb, argv[0], exc)) {
- mesg = mrb_funcall_argv(mrb, argv[0], exc, n, argv+1);
- }
- else {
- /* undef */
- mrb_raise(mrb, E_TYPE_ERROR, "exception class/object expected");
- }
+ mrb_sym exc = mrb_intern(mrb, "exception");
+ if (mrb_respond_to(mrb, argv[0], exc)) {
+ mesg = mrb_funcall_argv(mrb, argv[0], exc, n, argv+1);
+ }
+ else {
+ /* undef */
+ mrb_raise(mrb, E_TYPE_ERROR, "exception class/object expected");
+ }
}
break;
diff --git a/src/gc.c b/src/gc.c
index ae47de025..da6844fa5 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -301,7 +301,7 @@ mrb_free_heap(mrb_state *mrb)
page = page->next;
for (p = tmp->objects, e=p+MRB_HEAP_PAGE_SIZE; p<e; p++) {
if (p->as.free.tt != MRB_TT_FREE)
- obj_free(mrb, &p->as.basic);
+ obj_free(mrb, &p->as.basic);
}
mrb_free(mrb, tmp);
}
@@ -586,7 +586,7 @@ root_scan_phase(mrb_state *mrb)
mrb_irep *irep = mrb->irep[i];
if (!irep) continue;
for (j=0; j<irep->plen; j++) {
- mrb_gc_mark_value(mrb, irep->pool[j]);
+ mrb_gc_mark_value(mrb, irep->pool[j]);
}
}
}
diff --git a/src/hash.c b/src/hash.c
index 2439a235d..728fc0f2f 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -559,7 +559,7 @@ mrb_hash_shift(mrb_state *mrb, mrb_value hash)
delVal = mrb_hash_delete_key(mrb, hash, delKey);
mrb_gc_protect(mrb, delVal);
- return mrb_assoc_new(mrb, delKey, delVal);
+ return mrb_assoc_new(mrb, delKey, delVal);
}
}
}
@@ -1119,9 +1119,9 @@ hash_equal(mrb_state *mrb, mrb_value hash1, mrb_value hash2, int eql)
key = kh_key(h1,k1);
k2 = kh_get(ht, h2, key);
if (k2 != kh_end(h2)) {
- if (mrb_equal(mrb, kh_value(h1,k1), kh_value(h2,k2))) {
- continue; /* next key */
- }
+ if (mrb_equal(mrb, kh_value(h1,k1), kh_value(h2,k2))) {
+ continue; /* next key */
+ }
}
return mrb_false_value();
}
diff --git a/src/kernel.c b/src/kernel.c
index e45953fd3..c37b627a1 100644
--- a/src/kernel.c
+++ b/src/kernel.c
@@ -191,7 +191,7 @@ mrb_f_send(mrb_state *mrb, mrb_value self)
mrb_sym name;
mrb_value block, *argv;
int argc;
-
+
mrb_get_args(mrb, "n*&", &name, &argv, &argc, &block);
return mrb_funcall_with_block(mrb,self, name, argc, argv, block);
}
@@ -305,7 +305,7 @@ init_copy(mrb_state *mrb, mrb_value dest, mrb_value obj)
case MRB_TT_SCLASS:
case MRB_TT_HASH:
case MRB_TT_DATA:
- mrb_iv_copy(mrb, dest, obj);
+ mrb_iv_copy(mrb, dest, obj);
break;
default:
@@ -483,7 +483,7 @@ mrb_value mrb_yield_internal(mrb_state *mrb, mrb_value b, int argc, mrb_value *a
* call-seq:
* obj.instance_eval {| | block } -> obj
*
- * Evaluates the given block,within the context of the receiver (_obj_).
+ * Evaluates the given block,within the context of the receiver (_obj_).
* In order to set the context, the variable +self+ is set to _obj_ while
* the code is executing, giving the code access to _obj_'s
* instance variables. In the version of <code>instance_eval</code>
@@ -913,7 +913,7 @@ mrb_f_raise(mrb_state *mrb, mrb_value self)
{
mrb_value a[2], exc;
int argc;
-
+
argc = mrb_get_args(mrb, "|oo", &a[0], &a[1]);
switch (argc) {
diff --git a/src/load.c b/src/load.c
index 850fa6e8d..84c21c186 100644
--- a/src/load.c
+++ b/src/load.c
@@ -536,7 +536,7 @@ mrb_read_irep(mrb_state *mrb, const char *bin)
nirep = read_rite_header(mrb, src, &bin_header);
if (nirep < 0)
return nirep;
-
+
src += sizeof(bin_header) + MRB_DUMP_SIZE_OF_SHORT; //header + crc
//Read Binary Data Section
diff --git a/src/numeric.c b/src/numeric.c
index b5bff652d..5aa577828 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -306,7 +306,7 @@ static mrb_value
num_eql(mrb_state *mrb, mrb_value x)
{
mrb_value y;
-
+
mrb_get_args(mrb, "o", &y);
if (mrb_type(x) != mrb_type(y)) return mrb_false_value();
if (mrb_equal(mrb, x, y)) {
@@ -699,7 +699,7 @@ mrb_value
mrb_fixnum_mul(mrb_state *mrb, mrb_value x, mrb_value y)
{
mrb_int a;
-
+
a = mrb_fixnum(x);
if (a == 0) return x;
if (mrb_fixnum_p(y)) {
@@ -1126,7 +1126,7 @@ mrb_value
mrb_fixnum_plus(mrb_state *mrb, mrb_value x, mrb_value y)
{
mrb_int a;
-
+
a = mrb_fixnum(x);
if (a == 0) return y;
if (mrb_fixnum_p(y)) {
@@ -1165,7 +1165,7 @@ mrb_value
mrb_fixnum_minus(mrb_state *mrb, mrb_value x, mrb_value y)
{
mrb_int a;
-
+
a = mrb_fixnum(x);
if (mrb_fixnum_p(y)) {
mrb_int b, c;
diff --git a/src/sprintf.c b/src/sprintf.c
index 905182147..192d44735 100644
--- a/src/sprintf.c
+++ b/src/sprintf.c
@@ -623,7 +623,7 @@ retry:
p++;
goto retry;
}
-
+
case '*':
CHECK_FOR_WIDTH(flags);
flags |= FWIDTH;
@@ -658,7 +658,7 @@ retry:
case '\n':
case '\0':
p--;
-
+
case '%':
if (flags != FNONE) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "invalid format character - %");
diff --git a/src/variable.c b/src/variable.c
index 5f657e3d7..d5331f844 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -753,7 +753,7 @@ mrb_vm_cv_get(mrb_state *mrb, mrb_sym sym)
struct RClass *c = mrb->ci->proc->target_class;
if (!c) c = mrb->ci->target_class;
-
+
return mrb_mod_cv_get(mrb, c, sym);
}