diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-25 16:08:02 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-25 16:27:12 +0100 |
commit | eb08a0edd5159ee36782496f10736521147b575a (patch) | |
tree | b80927d3afc33525f9647214883476d48d619100 /Userland | |
parent | 8714f389f9d0819f888f990fb1941a258132328d (diff) | |
download | serenity-eb08a0edd5159ee36782496f10736521147b575a.zip |
LibC: Make it compile on 64-bit
It won't actually work on 64-bit yet, but let's do our future selves
a favor and make it compile.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibC/mman.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibC/netdb.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibC/scanf.cpp | 20 | ||||
-rw-r--r-- | Userland/Libraries/LibC/serenity.cpp | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/Userland/Libraries/LibC/mman.cpp b/Userland/Libraries/LibC/mman.cpp index 0f01395ab5..b44c1a6803 100644 --- a/Userland/Libraries/LibC/mman.cpp +++ b/Userland/Libraries/LibC/mman.cpp @@ -35,7 +35,7 @@ extern "C" { void* serenity_mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset, size_t alignment, const char* name) { Syscall::SC_mmap_params params { (uintptr_t)addr, size, alignment, prot, flags, fd, offset, { name, name ? strlen(name) : 0 } }; - ssize_t rc = syscall(SC_mmap, ¶ms); + ptrdiff_t rc = syscall(SC_mmap, ¶ms); if (rc < 0 && -rc < EMAXERRNO) { errno = -rc; return MAP_FAILED; @@ -56,7 +56,7 @@ void* mmap_with_name(void* addr, size_t size, int prot, int flags, int fd, off_t void* mremap(void* old_address, size_t old_size, size_t new_size, int flags) { Syscall::SC_mremap_params params { (uintptr_t)old_address, old_size, new_size, flags }; - ssize_t rc = syscall(SC_mremap, ¶ms); + ptrdiff_t rc = syscall(SC_mremap, ¶ms); if (rc < 0 && -rc < EMAXERRNO) { errno = -rc; return MAP_FAILED; @@ -95,7 +95,7 @@ int madvise(void* address, size_t size, int advice) void* allocate_tls(size_t size) { - int rc = syscall(SC_allocate_tls, size); + ptrdiff_t rc = syscall(SC_allocate_tls, size); if (rc < 0 && -rc < EMAXERRNO) { errno = -rc; return MAP_FAILED; diff --git a/Userland/Libraries/LibC/netdb.cpp b/Userland/Libraries/LibC/netdb.cpp index 881e1beffe..2450d0a0e9 100644 --- a/Userland/Libraries/LibC/netdb.cpp +++ b/Userland/Libraries/LibC/netdb.cpp @@ -132,7 +132,7 @@ hostent* gethostbyname(const char* name) i32 message_id; i32 name_length; } request_header = { - sizeof(request_header) - sizeof(request_header.message_size) + name_length, + (u32)(sizeof(request_header) - sizeof(request_header.message_size) + name_length), lookup_server_endpoint_magic, 1, (i32)name_length, diff --git a/Userland/Libraries/LibC/scanf.cpp b/Userland/Libraries/LibC/scanf.cpp index 7ec13da4ee..13f306d5aa 100644 --- a/Userland/Libraries/LibC/scanf.cpp +++ b/Userland/Libraries/LibC/scanf.cpp @@ -512,61 +512,61 @@ extern "C" int vsscanf(const char* input, const char* format, va_list ap) dbgln("Invalid conversion specifier {} in scanf!", (int)conversion_specifier); VERIFY_NOT_REACHED(); case Decimal: - if (!read_element<int, ReadKind::Normal> {}(length_modifier, input_lexer, &ap)) + if (!read_element<int, ReadKind::Normal> {}(length_modifier, input_lexer, (va_list*)&ap)) format_lexer.consume_all(); else ++elements_matched; break; case Integer: - if (!read_element<int, ReadKind::Infer> {}(length_modifier, input_lexer, &ap)) + if (!read_element<int, ReadKind::Infer> {}(length_modifier, input_lexer, (va_list*)&ap)) format_lexer.consume_all(); else ++elements_matched; break; case Octal: - if (!read_element<unsigned, ReadKind::Octal> {}(length_modifier, input_lexer, &ap)) + if (!read_element<unsigned, ReadKind::Octal> {}(length_modifier, input_lexer, (va_list*)&ap)) format_lexer.consume_all(); else ++elements_matched; break; case Unsigned: - if (!read_element<unsigned, ReadKind::Normal> {}(length_modifier, input_lexer, &ap)) + if (!read_element<unsigned, ReadKind::Normal> {}(length_modifier, input_lexer, (va_list*)&ap)) format_lexer.consume_all(); else ++elements_matched; break; case Hex: - if (!read_element<unsigned, ReadKind::Hex> {}(length_modifier, input_lexer, &ap)) + if (!read_element<unsigned, ReadKind::Hex> {}(length_modifier, input_lexer, (va_list*)&ap)) format_lexer.consume_all(); else ++elements_matched; break; case Floating: - if (!read_element<float, ReadKind::Normal> {}(length_modifier, input_lexer, &ap)) + if (!read_element<float, ReadKind::Normal> {}(length_modifier, input_lexer, (va_list*)&ap)) format_lexer.consume_all(); else ++elements_matched; break; case String: - if (!read_element<char*, ReadKind::Normal> {}(length_modifier, input_lexer, &ap)) + if (!read_element<char*, ReadKind::Normal> {}(length_modifier, input_lexer, (va_list*)&ap)) format_lexer.consume_all(); else ++elements_matched; break; case UseScanList: - if (!read_element<char*, ReadKind::Normal> { scanlist, invert_scanlist }(length_modifier, input_lexer, &ap)) + if (!read_element<char*, ReadKind::Normal> { scanlist, invert_scanlist }(length_modifier, input_lexer, (va_list*)&ap)) format_lexer.consume_all(); else ++elements_matched; break; case Character: - if (!read_element<char, ReadKind::Normal> {}(length_modifier, input_lexer, &ap)) + if (!read_element<char, ReadKind::Normal> {}(length_modifier, input_lexer, (va_list*)&ap)) format_lexer.consume_all(); else ++elements_matched; break; case Pointer: - if (!read_element<void*, ReadKind::Normal> {}(length_modifier, input_lexer, &ap)) + if (!read_element<void*, ReadKind::Normal> {}(length_modifier, input_lexer, (va_list*)&ap)) format_lexer.consume_all(); else ++elements_matched; diff --git a/Userland/Libraries/LibC/serenity.cpp b/Userland/Libraries/LibC/serenity.cpp index 8899a2b7df..1cf5f5f68f 100644 --- a/Userland/Libraries/LibC/serenity.cpp +++ b/Userland/Libraries/LibC/serenity.cpp @@ -73,7 +73,7 @@ int futex(uint32_t* userspace_address, int futex_op, uint32_t value, const struc .userspace_address = userspace_address, .futex_op = futex_op, .val = value, - .val2 = (uint32_t)timeout, + .val2 = (FlatPtr)timeout, .userspace_address2 = userspace_address2, .val3 = value3 }; |