summaryrefslogtreecommitdiff
path: root/absl/debugging/failure_signal_handler.cc
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2022-08-01 08:29:37 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-08-01 08:30:25 -0700
commit16af2bbcb9dd1770c64483aed8cd7d4ae7061064 (patch)
tree358b0bc9ba9786d4af2f49546d2b06868e80e568 /absl/debugging/failure_signal_handler.cc
parentdc370a82467cb35066475537b797197aee3e5164 (diff)
Fix "unsafe narrowing" warnings in absl, 2/n.
Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on .cc files in dirs a-h.) Bug: chromium:1292951 PiperOrigin-RevId: 464541951 Change-Id: If23b63ccea8e9b730159ff1c7288e9300a40b6bd
Diffstat (limited to 'absl/debugging/failure_signal_handler.cc')
-rw-r--r--absl/debugging/failure_signal_handler.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/absl/debugging/failure_signal_handler.cc b/absl/debugging/failure_signal_handler.cc
index 6672ee60..b127a981 100644
--- a/absl/debugging/failure_signal_handler.cc
+++ b/absl/debugging/failure_signal_handler.cc
@@ -291,7 +291,7 @@ static void WriteFailureInfo(int signo, void* ucontext, int cpu,
// some platforms.
static void PortableSleepForSeconds(int seconds) {
#ifdef _WIN32
- Sleep(seconds * 1000);
+ Sleep(static_cast<DWORD>(seconds * 1000));
#else
struct timespec sleep_time;
sleep_time.tv_sec = seconds;
@@ -325,9 +325,9 @@ static void AbslFailureSignalHandler(int signo, siginfo_t*, void* ucontext) {
const GetTidType this_tid = absl::base_internal::GetTID();
GetTidType previous_failed_tid = 0;
- if (!failed_tid.compare_exchange_strong(
- previous_failed_tid, static_cast<intptr_t>(this_tid),
- std::memory_order_acq_rel, std::memory_order_relaxed)) {
+ if (!failed_tid.compare_exchange_strong(previous_failed_tid, this_tid,
+ std::memory_order_acq_rel,
+ std::memory_order_relaxed)) {
ABSL_RAW_LOG(
ERROR,
"Signal %d raised at PC=%p while already in AbslFailureSignalHandler()",