diff options
author | Abseil Team <absl-team@google.com> | 2022-09-12 16:04:42 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-09-12 16:05:39 -0700 |
commit | 5a547f8bbd310850bb8123446110730abafdad56 (patch) | |
tree | 3407227cb7ea1bac60e341c42cf5da32a3ed6ff1 /absl/base/internal/direct_mmap.h | |
parent | 0a066f31d981d69f7bde961055691906dabd4a3c (diff) |
Fix "unsafe narrowing" warnings in absl, 8/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 */internal/.)
Bug: chromium:1292951
PiperOrigin-RevId: 473868797
Change-Id: Ibe0b76e33f9e001d59862beaac54fb47bacd39b2
Diffstat (limited to 'absl/base/internal/direct_mmap.h')
-rw-r--r-- | absl/base/internal/direct_mmap.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h index e492bb00..815b8d23 100644 --- a/absl/base/internal/direct_mmap.h +++ b/absl/base/internal/direct_mmap.h @@ -97,7 +97,8 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, #ifdef __BIONIC__ // SYS_mmap2 has problems on Android API level <= 16. // Workaround by invoking __mmap2() instead. - return __mmap2(start, length, prot, flags, fd, offset / pagesize); + return __mmap2(start, length, prot, flags, fd, + static_cast<size_t>(offset / pagesize)); #else return reinterpret_cast<void*>( syscall(SYS_mmap2, start, length, prot, flags, fd, |