Author: mstorsjo Date: Wed Jul 25 11:24:23 2018 New Revision: 337946 URL: http://llvm.org/viewvc/llvm-project?rev=337946&view=rev Log: [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 Modified: libcxx/trunk/src/support/win32/thread_win32.cpp Modified: libcxx/trunk/src/support/win32/thread_win32.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/support/win32/thread_win32.cpp?rev=337946&r1=337945&r2=337946&view=diff ============================================================================== --- libcxx/trunk/src/support/win32/thread_win32.cpp (original) +++ libcxx/trunk/src/support/win32/thread_win32.cpp Wed Jul 25 11:24:23 2018 @@ -254,9 +254,10 @@ void __libcpp_thread_sleep_for(const chr 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; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits