From 72950e7c15c1f5b88a85fd35dab37fe058f4605a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Tue, 19 Nov 2013 20:17:08 +0100 Subject: [PATCH] runtime_loader: fixes the 64-bit build. 1/ error: no matching function for call to 'min(long unsigned int, uint32&)'. 2/ error: comparison between signed and unsigned integer expressions. --- src/system/runtime_loader/runtime_loader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/system/runtime_loader/runtime_loader.cpp b/src/system/runtime_loader/runtime_loader.cpp index 2b2251ba37..664cf7215b 100644 --- a/src/system/runtime_loader/runtime_loader.cpp +++ b/src/system/runtime_loader/runtime_loader.cpp @@ -494,7 +494,8 @@ determine_x86_abi(int fd, const Elf32_Ehdr& elfHeader, bool& _isGcc2) if (symbolHash == NULL || symbolTable == NULL || stringTable == NULL) return false; uint32 symbolCount - = std::min(symbolTableSize / sizeof(Elf32_Sym), symbolHashChainSize); + = std::min(symbolTableSize / (uint32)sizeof(Elf32_Sym), + symbolHashChainSize); if (symbolCount < symbolHashSize) return false; @@ -520,7 +521,7 @@ determine_x86_abi(int fd, const Elf32_Ehdr& elfHeader, bool& _isGcc2) <= sectionHeader->sh_addr + sectionHeader->sh_size) { off_t fileOffset = symbol->st_value - sectionHeader->sh_addr + sectionHeader->sh_offset; - if (fileOffset + sizeof(uint32) <= st.st_size) { + if (fileOffset + (off_t)sizeof(uint32) <= st.st_size) { uint32 abi = *(uint32*)((uint8*)fileBaseAddress + fileOffset); _isGcc2 = (abi & B_HAIKU_ABI_MAJOR)