mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-19 07:38:28 +00:00
base: avoid implicit conversions
This patch is a prerequisite for compiling the code with the warnings -Wconversion enabled. Issue #23
This commit is contained in:
@ -178,7 +178,7 @@ namespace {
|
||||
if (!cmsg)
|
||||
return 0;
|
||||
|
||||
return (cmsg->cmsg_len - CMSG_ALIGN(sizeof(cmsghdr)))/sizeof(int);
|
||||
return (unsigned)((cmsg->cmsg_len - CMSG_ALIGN(sizeof(cmsghdr)))/sizeof(int));
|
||||
}
|
||||
};
|
||||
|
||||
@ -352,7 +352,7 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
|
||||
|
||||
extract_sds_from_message(0, rcv_msg, rcv_header, rcv_msgbuf);
|
||||
|
||||
return Rpc_exception_code(rcv_header.protocol_word);
|
||||
return Rpc_exception_code((int)rcv_header.protocol_word);
|
||||
}
|
||||
|
||||
|
||||
|
@ -203,7 +203,7 @@ Native_capability Native_thread::Epoll::alloc_rpc_cap()
|
||||
|
||||
void Native_thread::Epoll::free_rpc_cap(Native_capability cap)
|
||||
{
|
||||
int const local_socket = Capability_space::ipc_cap_data(cap).rpc_obj_key.value();
|
||||
int const local_socket = (int)Capability_space::ipc_cap_data(cap).rpc_obj_key.value();
|
||||
|
||||
_exec_control([&] () { _remove(Lx_sd{local_socket}); });
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ void Genode::binary_ready_hook_for_platform()
|
||||
};
|
||||
|
||||
uint64_t flags = SECCOMP_FILTER_FLAG_TSYNC;
|
||||
auto ret = lx_seccomp(SECCOMP_SET_MODE_FILTER, flags, &program);
|
||||
auto ret = lx_seccomp(SECCOMP_SET_MODE_FILTER, (int)flags, &program);
|
||||
if (ret != 0) {
|
||||
error("SECCOMP_SET_MODE_FILTER failed ", ret);
|
||||
throw Exception();
|
||||
|
@ -33,10 +33,13 @@
|
||||
*/
|
||||
|
||||
/* Linux includes */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wconversion"
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/thread.h>
|
||||
|
Reference in New Issue
Block a user