From 0c7db1a836b8baf92d794d469bb5f99c9bf43744 Mon Sep 17 00:00:00 2001 From: "John W. Bruce" Date: Wed, 10 Nov 2021 16:10:54 -0800 Subject: [PATCH] Fix -Wshorten-64-to-32 errors in Haystack (This is a merge of http://go/wvgerrit/134424.) This patch fixes code that would trigger -Wshorten-64-to-32 by implicitly narrowing a variable from 64 to 32 bits. The membarrier functions have their return type expanded so they can report the full return value of the syscall. Bug: 194971260 Test: x86-64 Change-Id: I5d948162b1f3f1540288df9494cabda39ecf8905 --- libwvdrmengine/level3/include/clear_cache_function.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libwvdrmengine/level3/include/clear_cache_function.h b/libwvdrmengine/level3/include/clear_cache_function.h index 70d38684..2138f2d2 100644 --- a/libwvdrmengine/level3/include/clear_cache_function.h +++ b/libwvdrmengine/level3/include/clear_cache_function.h @@ -42,7 +42,7 @@ bool supports_membarier_syscall() { // Reference: // * membarrier(2) // * art::jit::JitMemoryRegion::CommitCode -int membarrier_function(int command) { +long membarrier_function(int command) { static bool supports_membarier = supports_membarier_syscall(); if (supports_membarier) { return syscall(__NR_membarrier, command, 0); @@ -55,7 +55,7 @@ int membarrier_function(int command) { # pragma message \ "(info): __NR_membarrier unavailable; membarrier_function will be no-op." -int membarrier_function(int) { +long membarrier_function(int) { errno = ENOSYS; return -1; }