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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user