diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-04-17 08:03:15 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-04-17 08:03:15 +0900 |
| commit | 8ee516436b8d174a50764939bee23a442aa00b3f (patch) | |
| tree | fbd95697b4a77102966b2f4f787ed08cfd6a14cb /src | |
| parent | 7c91efc1ffda769a5f1a872c646c82b00698f1b8 (diff) | |
| parent | ef3b539125049b7c16bae883bdc5cee03ee378a4 (diff) | |
| download | mruby-8ee516436b8d174a50764939bee23a442aa00b3f.tar.gz mruby-8ee516436b8d174a50764939bee23a442aa00b3f.zip | |
Merge pull request #4386 from tomas/stable
Fix compilation on gcc 4.9.x
Diffstat (limited to 'src')
| -rw-r--r-- | src/numeric.c | 4 | ||||
| -rw-r--r-- | src/variable.c | 3 |
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; |
