PR #1961: Fix Clang warnings on powerpc

Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1961

We maintain the V8 Js Compiler on IBM platforms which uses abseil as a dependency. We have recently switched to using Clang and need to create this patch to fix two warnings:
```
warning: implicit conversion changes signedness: 'uint64_t' (aka 'unsigned long') to 'int64_t' (aka 'long') [-Wsign-conversion]
warning: implicit conversion loses integer precision: 'uintptr_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
```
Merge 2e972b5c72 into d71fcd13f6

Merging this change closes #1961

COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1961 from miladfarca:ppc-fix-clang-warn 2e972b5c72
PiperOrigin-RevId: 823581713
Change-Id: Icff10b99b3808f51866fb97576af405826742088
This commit is contained in:
Milad Fa
2025-10-24 10:29:50 -07:00
committed by Copybara-Service
parent d71fcd13f6
commit 1a259163cc
2 changed files with 4 additions and 3 deletions

View File

@@ -62,7 +62,7 @@ double UnscaledCycleClock::Frequency() {
int64_t UnscaledCycleClock::Now() {
#ifdef __GLIBC__
return __ppc_get_timebase();
return static_cast<int64_t>(__ppc_get_timebase());
#else
#ifdef __powerpc64__
int64_t tbr;