move declaration to the top of the block; ref #1727

parent e202d4cd
/* this header file is to be removed soon.
added for compatibility purpose (1.0.0) */
#include "mruby/error.h" #include "mruby/error.h"
...@@ -136,6 +136,7 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo) ...@@ -136,6 +136,7 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo)
mrb_bool e = FALSE; mrb_bool e = FALSE;
char s[48]; char s[48];
char *c = &s[0]; char *c = &s[0];
int length = 0;
if (n < 0) { if (n < 0) {
n = -n; n = -n;
...@@ -145,7 +146,6 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo) ...@@ -145,7 +146,6 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo)
exp = (n > 1) ? floor(log10(n)) : -ceil(-log10(n)); exp = (n > 1) ? floor(log10(n)) : -ceil(-log10(n));
/* preserve significands */ /* preserve significands */
int length = 0;
if (exp < 0) { if (exp < 0) {
int i, beg = -1, end = 0; int i, beg = -1, end = 0;
double f = n; double f = n;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment