summaryrefslogtreecommitdiff
path: root/thread_win32.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-27 04:47:10 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-27 04:47:10 (GMT)
commite881056fd63dfa72f31424c67fa0eb35c1f92e0f (patch)
tree9aa1ed58dbf65190c0c67d15520c75bb402c7319 /thread_win32.c
parent6c9fdc616a89a2a99fad1a408d2d5a2fdecef75a (diff)
thread_win32.c: suppress warning
* thread_win32.c (native_sleep): constify local variable to suppress a false positive might-be-clobbered warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_win32.c')
-rw-r--r--thread_win32.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/thread_win32.c b/thread_win32.c
index 49c1436..d573632 100644
--- a/thread_win32.c
+++ b/thread_win32.c
@@ -301,14 +301,8 @@ rb_w32_Sleep(unsigned long msec)
static void
native_sleep(rb_thread_t *th, struct timeval *tv)
{
- DWORD msec;
-
- if (tv) {
- msec = tv->tv_sec * 1000 + tv->tv_usec / 1000;
- }
- else {
- msec = INFINITE;
- }
+ const DWORD msec = (tv) ?
+ (DWORD)(tv->tv_sec * 1000 + tv->tv_usec / 1000) : INFINITE;
GVL_UNLOCK_BEGIN();
{