summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/numeric.c4
-rw-r--r--src/variable.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/numeric.c b/src/numeric.c
index 4128ea3a6..b6a38dace 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -207,12 +207,14 @@ flo_to_s(mrb_state *mrb, mrb_value flt)
char fmt[] = "%." MRB_STRINGIZE(FLO_TO_STR_PREC) "g";
mrb_value str = mrb_float_to_str(mrb, flt, fmt);
mrb_int len;
+ char *p;
char *begp;
+ char *endp;
insert_dot_zero:
begp = RSTRING_PTR(str);
len = RSTRING_LEN(str);
- for (char *p = begp, *endp = p + len; p < endp; ++p) {
+ for (p = begp, endp = p + len; p < endp; ++p) {
if (*p == '.') {
return str;
}
diff --git a/src/variable.c b/src/variable.c
index 724b153fe..348d1e3e3 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -1115,7 +1115,8 @@ mrb_class_find_path(mrb_state *mrb, struct RClass *c)
mrb_bool
mrb_ident_p(const char *s, mrb_int len)
{
- for (mrb_int i = 0; i < len; i++) {
+ mrb_int i;
+ for (i = 0; i < len; i++) {
if (!identchar(s[i])) return FALSE;
}
return TRUE;