Fix compilation on gcc 4.9.x

This commit is contained in:
Tomas Pollak
2019-04-16 12:34:09 -04:00
parent 7c91efc1ff
commit bcb8e297fc
3 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -50,10 +50,10 @@ static mrb_value
t_print(mrb_state *mrb, mrb_value self)
{
mrb_value *argv;
mrb_int argc;
mrb_int argc, i;
mrb_get_args(mrb, "*!", &argv, &argc);
for (mrb_int i = 0; i < argc; ++i) {
for (i = 0; i < argc; ++i) {
mrb_value s = mrb_obj_as_string(mrb, argv[i]);
fwrite(RSTRING_PTR(s), RSTRING_LEN(s), 1, stdout);
}
+2 -1
View File
@@ -212,7 +212,8 @@ flo_to_s(mrb_state *mrb, mrb_value flt)
insert_dot_zero:
begp = RSTRING_PTR(str);
len = RSTRING_LEN(str);
for (char *p = begp, *endp = p + len; p < endp; ++p) {
char *p, *endp;
for (p = begp, endp = p + len; p < endp; ++p) {
if (*p == '.') {
return str;
}
+2 -1
View File
@@ -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;