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
This commit is contained in:
John W. Bruce
2021-11-10 16:10:54 -08:00
parent b6c93683db
commit 0c7db1a836

View File

@@ -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;
}