summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-01 09:04:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-01 09:04:10 +0000
commitcec97f40f65bd5b7d775f6e1ec4ec425e6ae6095 (patch)
treecd4b3e8398ccf0a58d79968a692bfc8a6c36d45c
parent34004844cd9cf1476f5f2de78d373fc00032d041 (diff)
process.c: suppress warning
* process.c (rb_clock_getres): move conditionally used variable to the proper block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--process.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/process.c b/process.c
index bd3542a1f2..32b7237d34 100644
--- a/process.c
+++ b/process.c
@@ -7149,7 +7149,6 @@ VALUE
rb_clock_getres(int argc, VALUE *argv)
{
VALUE clk_id, unit;
- int ret;
struct timetick tt;
timetick_int_t numerators[2];
@@ -7212,9 +7211,8 @@ rb_clock_getres(int argc, VALUE *argv)
else {
#if defined(HAVE_CLOCK_GETRES)
struct timespec ts;
- clockid_t c;
- c = NUM2CLOCKID(clk_id);
- ret = clock_getres(c, &ts);
+ clockid_t c = NUM2CLOCKID(clk_id);
+ int ret = clock_getres(c, &ts);
if (ret == -1)
rb_sys_fail("clock_getres");
tt.count = (int32_t)ts.tv_nsec;