From 46ee88357490874d22c4767ddf8c1982b02b61a0 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sun, 23 Feb 2014 20:41:15 +0900 Subject: move declaration to the top of the block; ref #1727 --- src/error.h | 2 ++ src/numeric.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/error.h b/src/error.h index 3ff495266..0e0dacf63 100644 --- a/src/error.h +++ b/src/error.h @@ -1 +1,3 @@ +/* this header file is to be removed soon. + added for compatibility purpose (1.0.0) */ #include "mruby/error.h" diff --git a/src/numeric.c b/src/numeric.c index a8c483148..ec7f05b97 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -136,6 +136,7 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo) mrb_bool e = FALSE; char s[48]; char *c = &s[0]; + int length = 0; if (n < 0) { n = -n; @@ -145,7 +146,6 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo) exp = (n > 1) ? floor(log10(n)) : -ceil(-log10(n)); /* preserve significands */ - int length = 0; if (exp < 0) { int i, beg = -1, end = 0; double f = n; -- cgit v1.2.3