diff options
author | Martin Storsjo <martin@martin.st> | 2018-07-25 18:24:23 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-07-25 18:24:23 +0000 |
commit | c89c9c7b63734e04d010a37dc4c6aa4d2edd81a6 (patch) | |
tree | 6d774998729aa6732deab33481f893bb441f5b2e /libcxx/src/support | |
parent | 733f4ed1bb42d2080fd24dd5c4155e7277abafc4 (diff) | |
download | bcm5719-llvm-c89c9c7b63734e04d010a37dc4c6aa4d2edd81a6.tar.gz bcm5719-llvm-c89c9c7b63734e04d010a37dc4c6aa4d2edd81a6.zip |
[windows] Fix warning about comparing ints of different signs
This fixes a warning like this:
warning: comparison of integers of different signs:
'std::__1::__libcpp_tls_key' (aka 'long') and 'DWORD'
(aka 'unsigned long') [-Wsign-compare]
if (*__key == FLS_OUT_OF_INDEXES)
~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
Differential Revision: https://reviews.llvm.org/D49782
llvm-svn: 337946
Diffstat (limited to 'libcxx/src/support')
-rw-r--r-- | libcxx/src/support/win32/thread_win32.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libcxx/src/support/win32/thread_win32.cpp b/libcxx/src/support/win32/thread_win32.cpp index 47104942990..1567042d8e2 100644 --- a/libcxx/src/support/win32/thread_win32.cpp +++ b/libcxx/src/support/win32/thread_win32.cpp @@ -254,9 +254,10 @@ void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns) int __libcpp_tls_create(__libcpp_tls_key* __key, void(_LIBCPP_TLS_DESTRUCTOR_CC* __at_exit)(void*)) { - *__key = FlsAlloc(__at_exit); - if (*__key == FLS_OUT_OF_INDEXES) + DWORD index = FlsAlloc(__at_exit); + if (index == FLS_OUT_OF_INDEXES) return GetLastError(); + *__key = index; return 0; } |