ruby-changes:30678
From: nobu <ko1@a...>
Date: Sun, 1 Sep 2013 18:04:18 +0900 (JST)
Subject: [ruby-changes:30678] nobu:r42757 (trunk): process.c: suppress warning
nobu 2013-09-01 18:04:10 +0900 (Sun, 01 Sep 2013) New Revision: 42757 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42757 Log: process.c: suppress warning * process.c (rb_clock_getres): move conditionally used variable to the proper block. Modified files: trunk/process.c Index: process.c =================================================================== --- process.c (revision 42756) +++ process.c (revision 42757) @@ -7149,7 +7149,6 @@ VALUE https://github.com/ruby/ruby/blob/trunk/process.c#L7149 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) https://github.com/ruby/ruby/blob/trunk/process.c#L7211 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/