diff --git a/base-foc/include/base/native_types.h b/base-foc/include/base/native_types.h index 2b0f522f0..f8d49da5a 100644 --- a/base-foc/include/base/native_types.h +++ b/base-foc/include/base/native_types.h @@ -138,7 +138,7 @@ namespace Genode { ** Interface provided by all platforms ** *******************************************/ - int local_name() const { return _idx ? _idx->id() : 0; } + long local_name() const { return _idx ? _idx->id() : 0; } Dst dst() const { return _idx ? Dst(_idx->kcap()) : Dst(); } bool valid() const { return (_idx != 0) && _idx->valid(); } void *local() const { return _ptr; } diff --git a/base-foc/src/core/platform.cc b/base-foc/src/core/platform.cc index 9d6fc80a1..b8120ffeb 100644 --- a/base-foc/src/core/platform.cc +++ b/base-foc/src/core/platform.cc @@ -295,7 +295,7 @@ void Platform::_setup_mem_alloc() for (unsigned i = 0; i < sizeof(log2_sizes)/sizeof(*log2_sizes); ++i) { size_t log2_size = log2_sizes[i]; - size_t size = 1 << log2_size; + size_t size = 1UL << log2_size; int err = 0; addr_t addr = 0; Region region; diff --git a/base/include/util/misc_math.h b/base/include/util/misc_math.h index 932535416..8c686dfa5 100644 --- a/base/include/util/misc_math.h +++ b/base/include/util/misc_math.h @@ -39,7 +39,7 @@ namespace Genode { template static inline T align_addr(T addr, int align) { - return (addr + _align_offset(align)) & _align_mask((T)align); } + return (addr + _align_offset((T)align)) & _align_mask((T)align); } /** diff --git a/base/src/core/rm_session_component.cc b/base/src/core/rm_session_component.cc index 828aaeb9f..256fd19b9 100644 --- a/base/src/core/rm_session_component.cc +++ b/base/src/core/rm_session_component.cc @@ -75,7 +75,7 @@ namespace Genode { addr_t base = 0; for (size_t try_size_log2 = get_page_size_log2(); try_size_log2 < sizeof(addr_t)*8 ; try_size_log2++) { - addr_t fpage_mask = ~((1 << try_size_log2) - 1); + addr_t fpage_mask = ~((1UL << try_size_log2) - 1); addr_t try_base = _fault_addr & fpage_mask; /* check lower bound of existing fault area */ @@ -401,7 +401,7 @@ Rm_session_component::attach(Dataspace_capability ds_cap, size_t size, * store. The backing store would constrain the mapping size * anyway such that a higher alignment of the region is of no use. */ - if (((dsc->map_src_addr() + offset) & ((1 << align_log2) - 1)) != 0) + if (((dsc->map_src_addr() + offset) & ((1UL << align_log2) - 1)) != 0) continue; /* try allocating the align region */