diff --git a/doc/coding_style.txt b/doc/coding_style.txt index f78685b53..6a79674c3 100644 --- a/doc/coding_style.txt +++ b/doc/coding_style.txt @@ -55,7 +55,7 @@ Identifiers * 'Multi_word_identifiers' use underline to separate words. * 'CONSTANTS' and template arguments are upper case. * Private and protected members of a class begin with an '_'-character. -* Accessor functions are named after their corresponding attributes: +* Accessor methods are named after their corresponding attributes: ! /** ! * Request private member variable @@ -67,6 +67,10 @@ Identifiers ! */ ! void value(int value) { _value = value; } +* Accessors that return a boolean value do not carry an 'is_' prefix. E.g., + a method for requesting the validity of an object should be named + 'valid()', not 'is_valid()'. + Indentation =========== @@ -136,13 +140,13 @@ Braces ! { ! public: ! - ! void function(void) + ! void method(void) ! { ! ... ! } ! }; - except for single-line functions. + except for one-line functions. * All other occurrences of open braces (for 'if', 'while', 'do', 'for', 'namespace', 'enum' etc.) are at the end of a line: @@ -153,7 +157,8 @@ Braces ! .. ! } -* Surprisingly, one-line functions should be written on one line. +* One-line functions should be written on a single line as long as the line + length does not exceed approximately 80 characters. Typically, this applies for accessor functions. If slightly more space than one line is needed, indent as follows: @@ -164,10 +169,10 @@ Braces Comments ======== -Function header -~~~~~~~~~~~~~~~ +Function/method header +~~~~~~~~~~~~~~~~~~~~~~ -Each public or protected (but no private) function in a header-file should be +Each public or protected (but no private) method in a header-file should be prepended by a header as follows: ! /** diff --git a/repos/base-fiasco/src/core/include/ipc_pager.h b/repos/base-fiasco/src/core/include/ipc_pager.h index 4a454cbea..3a2a68638 100644 --- a/repos/base-fiasco/src/core/include/ipc_pager.h +++ b/repos/base-fiasco/src/core/include/ipc_pager.h @@ -161,12 +161,12 @@ namespace Genode { unsigned long badge() const { return convert_native_thread_id_to_badge(_last); } - bool is_write_fault() const { return (_pf_addr & 2); } + bool write_fault() const { return (_pf_addr & 2); } /** * Return true if last fault was an exception */ - bool is_exception() const + bool exception() const { /* * Reflection of exceptions is not supported on this platform. diff --git a/repos/base-fiasco/src/core/io_mem_session_support.cc b/repos/base-fiasco/src/core/io_mem_session_support.cc index ef3828332..8f247a829 100644 --- a/repos/base-fiasco/src/core/io_mem_session_support.cc +++ b/repos/base-fiasco/src/core/io_mem_session_support.cc @@ -46,7 +46,7 @@ addr_t Io_mem_session_component::_map_local(addr_t base, size_t size) /* find appropriate region for mapping */ void *local_base = 0; - if (platform()->region_alloc()->alloc_aligned(size, &local_base, alignment).is_error()) + if (platform()->region_alloc()->alloc_aligned(size, &local_base, alignment).error()) return 0; /* call sigma0 for I/O region */ diff --git a/repos/base-fiasco/src/core/irq_session_component.cc b/repos/base-fiasco/src/core/irq_session_component.cc index 5bb3c2e6e..89202e51d 100644 --- a/repos/base-fiasco/src/core/irq_session_component.cc +++ b/repos/base-fiasco/src/core/irq_session_component.cc @@ -132,7 +132,7 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc, if (msi) throw Root::Unavailable(); - if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).is_error()) { + if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).error()) { PERR("Unavailable IRQ 0x%x requested", _irq_number); throw Root::Unavailable(); } diff --git a/repos/base-foc/src/core/include/ipc_pager.h b/repos/base-foc/src/core/include/ipc_pager.h index 17ecc1fd1..700fe2bbc 100644 --- a/repos/base-foc/src/core/include/ipc_pager.h +++ b/repos/base-foc/src/core/include/ipc_pager.h @@ -172,12 +172,12 @@ namespace Genode { */ unsigned long badge() { return _badge; } - bool is_write_fault() const { return (_pf_addr & 2); } + bool write_fault() const { return (_pf_addr & 2); } /** * Return true if last fault was an exception */ - bool is_exception() const + bool exception() const { return _type == Ipc_pager::EXCEPTION; } diff --git a/repos/base-foc/src/core/io_mem_session_support.cc b/repos/base-foc/src/core/io_mem_session_support.cc index 949ad6764..cc82bbf83 100644 --- a/repos/base-foc/src/core/io_mem_session_support.cc +++ b/repos/base-foc/src/core/io_mem_session_support.cc @@ -35,7 +35,7 @@ addr_t Io_mem_session_component::_map_local(addr_t base, size_t size) /* find appropriate region for mapping */ void *local_base = 0; - if (platform()->region_alloc()->alloc_aligned(size, &local_base, alignment).is_error()) + if (platform()->region_alloc()->alloc_aligned(size, &local_base, alignment).error()) return 0; if (!map_local_io(base, (addr_t)local_base, size >> get_page_size_log2())) { diff --git a/repos/base-foc/src/core/irq_session_component.cc b/repos/base-foc/src/core/irq_session_component.cc index 090b39a5e..dfb54cf32 100644 --- a/repos/base-foc/src/core/irq_session_component.cc +++ b/repos/base-foc/src/core/irq_session_component.cc @@ -194,7 +194,7 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc, } msi_alloc.set(irq_number, 1); } else { - if (!irq_alloc || irq_alloc->alloc_addr(1, irq_number).is_error()) { + if (!irq_alloc || irq_alloc->alloc_addr(1, irq_number).error()) { PERR("Unavailable IRQ %ld requested.", irq_number); throw Root::Unavailable(); } diff --git a/repos/base-foc/src/core/pager.cc b/repos/base-foc/src/core/pager.cc index c95ca9bb0..eb6f521e5 100644 --- a/repos/base-foc/src/core/pager.cc +++ b/repos/base-foc/src/core/pager.cc @@ -57,7 +57,7 @@ void Pager_entrypoint::entry() case Ipc_pager::PAGEFAULT: case Ipc_pager::EXCEPTION: { - if (_pager.is_exception()) { + if (_pager.exception()) { Lock::Guard guard(obj->state.lock); _pager.get_regs(&obj->state); obj->state.exceptions++; diff --git a/repos/base-foc/src/core/signal_source_component.cc b/repos/base-foc/src/core/signal_source_component.cc index fec106e41..a4f9656f1 100644 --- a/repos/base-foc/src/core/signal_source_component.cc +++ b/repos/base-foc/src/core/signal_source_component.cc @@ -34,7 +34,7 @@ using namespace Genode; void Signal_source_component::release(Signal_context_component *context) { - if (context && context->is_enqueued()) + if (context && context->enqueued()) _signal_queue.remove(context); } @@ -44,7 +44,7 @@ void Signal_source_component::submit(Signal_context_component *context, /* enqueue signal to context */ context->increment_signal_cnt(cnt); - if (!context->is_enqueued()) { + if (!context->enqueued()) { _signal_queue.enqueue(context); /* wake up client */ diff --git a/repos/base-hw/src/core/core_region_map.cc b/repos/base-hw/src/core/core_region_map.cc index f84c74588..62e8bdac8 100644 --- a/repos/base-hw/src/core/core_region_map.cc +++ b/repos/base-hw/src/core/core_region_map.cc @@ -51,7 +51,7 @@ Core_region_map::attach(Dataspace_capability ds_cap, size_t size, void *virt_addr; if (!platform()->region_alloc()->alloc_aligned(page_rounded_size, &virt_addr, - get_page_size_log2()).is_ok()) { + get_page_size_log2()).ok()) { PERR("Could not allocate virtual address range in core of size %zd\n", page_rounded_size); return nullptr; @@ -61,7 +61,7 @@ Core_region_map::attach(Dataspace_capability ds_cap, size_t size, unsigned num_pages = page_rounded_size >> get_page_size_log2(); Page_flags const flags = Page_flags::apply_mapping(ds->writable(), ds->cacheability(), - ds->is_io_mem()); + ds->io_mem()); if (!map_local(ds->phys_addr(), (addr_t)virt_addr, num_pages, flags)) return nullptr; diff --git a/repos/base-hw/src/core/include/pager.h b/repos/base-hw/src/core/include/pager.h index 6654c98cb..117ddef9e 100644 --- a/repos/base-hw/src/core/include/pager.h +++ b/repos/base-hw/src/core/include/pager.h @@ -113,7 +113,7 @@ class Genode::Ipc_pager /** * Access direction of current page fault */ - bool is_write_fault() const; + bool write_fault() const; /** * Input mapping data as reply to current page fault diff --git a/repos/base-hw/src/core/irq_session_component.cc b/repos/base-hw/src/core/irq_session_component.cc index 2aec0d4c3..670859492 100644 --- a/repos/base-hw/src/core/irq_session_component.cc +++ b/repos/base-hw/src/core/irq_session_component.cc @@ -80,7 +80,7 @@ Irq_session_component::Irq_session_component(Range_allocator * const irq_alloc, } /* allocate interrupt */ - if (_irq_alloc->alloc_addr(1, _irq_number).is_error()) { + if (_irq_alloc->alloc_addr(1, _irq_number).error()) { PERR("unavailable interrupt %d requested", _irq_number); throw Root::Invalid_args(); } diff --git a/repos/base-hw/src/core/kernel/signal_receiver.cc b/repos/base-hw/src/core/kernel/signal_receiver.cc index 21cb2b0ca..906e56a6c 100644 --- a/repos/base-hw/src/core/kernel/signal_receiver.cc +++ b/repos/base-hw/src/core/kernel/signal_receiver.cc @@ -166,7 +166,7 @@ Signal_context::Signal_context(Signal_receiver * const r, unsigned const imprint void Signal_receiver::_add_deliverable(Signal_context * const c) { - if (!c->_deliver_fe.is_enqueued()) { + if (!c->_deliver_fe.enqueued()) { _deliver.enqueue(&c->_deliver_fe); } _listen(); @@ -199,7 +199,7 @@ void Signal_receiver::_listen() void Signal_receiver::_context_destructed(Signal_context * const c) { _contexts.remove(&c->_contexts_fe); - if (!c->_deliver_fe.is_enqueued()) { return; } + if (!c->_deliver_fe.enqueued()) { return; } _deliver.remove(&c->_deliver_fe); } diff --git a/repos/base-hw/src/core/pager.cc b/repos/base-hw/src/core/pager.cc index a68859048..837563a47 100644 --- a/repos/base-hw/src/core/pager.cc +++ b/repos/base-hw/src/core/pager.cc @@ -53,7 +53,7 @@ addr_t Ipc_pager::fault_ip() const { return _fault.ip; } addr_t Ipc_pager::fault_addr() const { return _fault.addr; } -bool Ipc_pager::is_write_fault() const { return _fault.writes; } +bool Ipc_pager::write_fault() const { return _fault.writes; } void Ipc_pager::set_reply_mapping(Mapping m) { _mapping = m; } diff --git a/repos/base-hw/src/core/platform_pd.cc b/repos/base-hw/src/core/platform_pd.cc index 0012dffad..bd6c2b9f9 100644 --- a/repos/base-hw/src/core/platform_pd.cc +++ b/repos/base-hw/src/core/platform_pd.cc @@ -38,7 +38,7 @@ void * Hw::Address_space::_table_alloc() { void * ret; if (!_cma()->alloc_aligned(sizeof(Translation_table), (void**)&ret, - Translation_table::ALIGNM_LOG2).is_ok()) + Translation_table::ALIGNM_LOG2).ok()) throw Root::Quota_exceeded(); return ret; } diff --git a/repos/base-hw/src/core/platform_thread.cc b/repos/base-hw/src/core/platform_thread.cc index 57fd10455..3e1af2bd3 100644 --- a/repos/base-hw/src/core/platform_thread.cc +++ b/repos/base-hw/src/core/platform_thread.cc @@ -41,7 +41,7 @@ Platform_thread::~Platform_thread() /* detach UTCB of main threads */ if (_main_thread) { Locked_ptr locked_ptr(_address_space); - if (locked_ptr.is_valid()) + if (locked_ptr.valid()) locked_ptr->flush((addr_t)_utcb_pd_addr, sizeof(Native_utcb)); } @@ -137,7 +137,7 @@ int Platform_thread::start(void * const ip, void * const sp) /* lock the address space */ Locked_ptr locked_ptr(_address_space); - if (!locked_ptr.is_valid()) { + if (!locked_ptr.valid()) { PERR("invalid RM client"); return -1; }; diff --git a/repos/base-hw/src/core/region_map_support.cc b/repos/base-hw/src/core/region_map_support.cc index 8acca72d9..29997b5f8 100644 --- a/repos/base-hw/src/core/region_map_support.cc +++ b/repos/base-hw/src/core/region_map_support.cc @@ -31,7 +31,7 @@ void Rm_client::unmap(addr_t, addr_t virt_base, size_t size) { Locked_ptr locked_address_space(_address_space); - if (locked_address_space.is_valid()) + if (locked_address_space.valid()) locked_address_space->flush(virt_base, size); } @@ -76,7 +76,7 @@ void Pager_entrypoint::entry() /* apply mapping that was determined by the local region managers */ { Locked_ptr locked_ptr(pt->address_space()); - if (!locked_ptr.is_valid()) return; + if (!locked_ptr.valid()) return; Hw::Address_space * as = static_cast(&*locked_ptr); Page_flags const flags = diff --git a/repos/base-hw/src/core/spec/arm_v7/virtualization/vm_session_component.cc b/repos/base-hw/src/core/spec/arm_v7/virtualization/vm_session_component.cc index 7032ffb16..4dcbf5b5a 100644 --- a/repos/base-hw/src/core/spec/arm_v7/virtualization/vm_session_component.cc +++ b/repos/base-hw/src/core/spec/arm_v7/virtualization/vm_session_component.cc @@ -85,7 +85,7 @@ Vm_session_component::Vm_session_component(Rpc_entrypoint *ds_ep, /* get some aligned space for the translation table */ if (!cma->alloc_aligned(sizeof(Translation_table), (void**)&tt, - Translation_table::ALIGNM_LOG2).is_ok()) { + Translation_table::ALIGNM_LOG2).ok()) { PERR("failed to allocate kernel object"); throw Root::Quota_exceeded(); } diff --git a/repos/base-hw/src/core/spec/arm_v7/vm_session_component.cc b/repos/base-hw/src/core/spec/arm_v7/vm_session_component.cc index 625eeaa2a..ee12f84f5 100644 --- a/repos/base-hw/src/core/spec/arm_v7/vm_session_component.cc +++ b/repos/base-hw/src/core/spec/arm_v7/vm_session_component.cc @@ -23,7 +23,7 @@ addr_t Vm_session_component::_alloc_ds(size_t &ram_quota) addr_t addr; if (_ds_size() > ram_quota || platform()->ram_alloc()->alloc_aligned(_ds_size(), (void**)&addr, - get_page_size_log2()).is_error()) + get_page_size_log2()).error()) throw Root::Quota_exceeded(); ram_quota -= _ds_size(); return addr; diff --git a/repos/base-linux/src/lib/base/child_process.cc b/repos/base-linux/src/lib/base/child_process.cc index 8df9bba02..e3d374d60 100644 --- a/repos/base-linux/src/lib/base/child_process.cc +++ b/repos/base-linux/src/lib/base/child_process.cc @@ -86,7 +86,7 @@ Child::Process::Process(Dataspace_capability elf_ds, if (!elf.valid()) throw Invalid_executable(); - bool const dynamically_linked = elf.is_dynamically_linked(); + bool const dynamically_linked = elf.dynamically_linked(); local_rm.detach(elf_addr); diff --git a/repos/base-linux/src/lib/lx_hybrid/lx_hybrid.cc b/repos/base-linux/src/lib/lx_hybrid/lx_hybrid.cc index deb6015a4..b3082b070 100644 --- a/repos/base-linux/src/lib/lx_hybrid/lx_hybrid.cc +++ b/repos/base-linux/src/lib/lx_hybrid/lx_hybrid.cc @@ -397,8 +397,8 @@ Thread *Thread::myself() if (tls != 0) return ((Native_thread::Meta_data *)tls)->thread_base; - bool const is_main_thread = (lx_getpid() == lx_gettid()); - if (is_main_thread) + bool const called_by_main_thread = (lx_getpid() == lx_gettid()); + if (called_by_main_thread) return 0; /* diff --git a/repos/base-nova/include/base/thread_state.h b/repos/base-nova/include/base/thread_state.h index 822819922..2dde3f60c 100644 --- a/repos/base-nova/include/base/thread_state.h +++ b/repos/base-nova/include/base/thread_state.h @@ -18,18 +18,18 @@ #include -namespace Genode { +namespace Genode { struct Thread_state; } - struct Thread_state : Thread_state_base - { - bool is_vcpu; - addr_t sel_exc_base; - Thread_state() : is_vcpu(false), sel_exc_base(~0UL) { } +struct Genode::Thread_state : Thread_state_base +{ + bool vcpu; + addr_t sel_exc_base; - Thread_state(bool is_vcpu, addr_t sel_exc_base) - : is_vcpu(is_vcpu), sel_exc_base(sel_exc_base) { } - }; -} + Thread_state() : vcpu(false), sel_exc_base(~0UL) { } + + Thread_state(bool vcpu, addr_t sel_exc_base) + : vcpu(vcpu), sel_exc_base(sel_exc_base) { } +}; #endif /* _INCLUDE__BASE__THREAD_STATE_H_ */ diff --git a/repos/base-nova/include/nova/native_thread.h b/repos/base-nova/include/nova/native_thread.h index aa8d34a69..3517a7619 100644 --- a/repos/base-nova/include/nova/native_thread.h +++ b/repos/base-nova/include/nova/native_thread.h @@ -30,7 +30,7 @@ struct Genode::Native_thread addr_t ec_sel; /* selector for execution context */ addr_t exc_pt_sel; /* base of event portal window */ - bool is_vcpu; + bool vcpu; /* true if thread is a virtual CPU */ /* receive window for capability selectors received at the server side */ Receive_window rcv_window; @@ -38,7 +38,7 @@ struct Genode::Native_thread Native_capability pager_cap; Native_thread() : ec_sel(INVALID_INDEX), - exc_pt_sel(INVALID_INDEX), is_vcpu(false) { } + exc_pt_sel(INVALID_INDEX), vcpu(false) { } }; #endif /* _INCLUDE__NOVA__NATIVE_THREAD_H_ */ diff --git a/repos/base-nova/src/core/core_region_map.cc b/repos/base-nova/src/core/core_region_map.cc index c7407aa01..8cbc8f99d 100644 --- a/repos/base-nova/src/core/core_region_map.cc +++ b/repos/base-nova/src/core/core_region_map.cc @@ -40,7 +40,7 @@ static inline void * alloc_region(Dataspace_component *ds, const size_t size) size_t align_log2 = log2(ds->size()); for (; align_log2 >= get_page_size_log2(); align_log2--) { if (platform()->region_alloc()->alloc_aligned(size, - &virt_addr, align_log2).is_ok()) + &virt_addr, align_log2).ok()) break; } diff --git a/repos/base-nova/src/core/include/ipc_pager.h b/repos/base-nova/src/core/include/ipc_pager.h index 2a71a8cb3..7f8a3c703 100644 --- a/repos/base-nova/src/core/include/ipc_pager.h +++ b/repos/base-nova/src/core/include/ipc_pager.h @@ -126,12 +126,12 @@ namespace Genode { /** * Return true if fault was a write fault */ - bool is_write_fault() const { return _fault_type & ERR_W; } + bool write_fault() const { return _fault_type & ERR_W; } /** * Return true if last fault was an exception */ - bool is_exception() const + bool exception() const { /* * Reflection of exceptions is not supported on this platform. diff --git a/repos/base-nova/src/core/include/platform_thread.h b/repos/base-nova/src/core/include/platform_thread.h index 56d5a6e28..a47034239 100644 --- a/repos/base-nova/src/core/include/platform_thread.h +++ b/repos/base-nova/src/core/include/platform_thread.h @@ -56,9 +56,9 @@ namespace Genode { addr_t _sel_sc() const { return _id_base + 2; } /* convenience function to access _feature variable */ - inline bool is_main_thread() const { return _features & MAIN_THREAD; } - inline bool is_vcpu() const { return _features & VCPU; } - inline bool is_worker() const { return _features & WORKER; } + inline bool main_thread() const { return _features & MAIN_THREAD; } + inline bool vcpu() const { return _features & VCPU; } + inline bool worker() const { return _features & WORKER; } public: diff --git a/repos/base-nova/src/core/irq_session_component.cc b/repos/base-nova/src/core/irq_session_component.cc index 2a24c863a..992ac2876 100644 --- a/repos/base-nova/src/core/irq_session_component.cc +++ b/repos/base-nova/src/core/irq_session_component.cc @@ -70,7 +70,7 @@ static bool msi(Genode::addr_t irq_sel, Genode::addr_t phys_mem, Genode::Signal_context_capability sig_cap) { void * virt = 0; - if (platform()->region_alloc()->alloc_aligned(4096, &virt, 12).is_error()) + if (platform()->region_alloc()->alloc_aligned(4096, &virt, 12).error()) return false; Genode::addr_t virt_addr = reinterpret_cast(virt); @@ -216,7 +216,7 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc, throw Root::Unavailable(); } - if (!irq_alloc || irq_alloc->alloc_addr(1, irq_number).is_error()) { + if (!irq_alloc || irq_alloc->alloc_addr(1, irq_number).error()) { PERR("Unavailable IRQ 0x%lx requested", irq_number); throw Root::Unavailable(); } diff --git a/repos/base-nova/src/core/platform.cc b/repos/base-nova/src/core/platform.cc index efecf3b37..ff7f8ef11 100644 --- a/repos/base-nova/src/core/platform.cc +++ b/repos/base-nova/src/core/platform.cc @@ -611,7 +611,7 @@ Platform::Platform() : addr_t const virt = mapped_cmd_line + get_page_size() * 2; addr_t const phys = round_page(mem_desc->aux); - if (region_alloc()->alloc_addr(get_page_size(), virt).is_ok()) { + if (region_alloc()->alloc_addr(get_page_size(), virt).ok()) { /* we got the virtual region */ err = map_local(__main_thread_utcb, phys, virt, 1, Nova::Rights(true, false, false), true); diff --git a/repos/base-nova/src/core/platform_thread.cc b/repos/base-nova/src/core/platform_thread.cc index d68fce1f3..df24a2184 100644 --- a/repos/base-nova/src/core/platform_thread.cc +++ b/repos/base-nova/src/core/platform_thread.cc @@ -55,7 +55,7 @@ int Platform_thread::start(void *ip, void *sp) return -1; } - if (!_pd || (is_main_thread() && !is_vcpu() && + if (!_pd || (main_thread() && !vcpu() && _pd->parent_pt_sel() == Native_thread::INVALID_INDEX)) { PERR("protection domain undefined"); return -2; @@ -68,9 +68,9 @@ int Platform_thread::start(void *ip, void *sp) return -8; } - if (!is_main_thread()) { + if (!main_thread()) { addr_t const initial_sp = reinterpret_cast(sp); - addr_t const utcb = is_vcpu() ? 0 : round_page(initial_sp); + addr_t const utcb = vcpu() ? 0 : round_page(initial_sp); if (_sel_exc_base == Native_thread::INVALID_INDEX) { PERR("exception base not specified"); @@ -114,9 +114,9 @@ int Platform_thread::start(void *ip, void *sp) addr_t pd_core_sel = Platform_pd::pd_core_sel(); addr_t pd_utcb = 0; - _sel_exc_base = is_vcpu() ? _pager->exc_pt_vcpu() : _pager->exc_pt_sel_client(); + _sel_exc_base = vcpu() ? _pager->exc_pt_vcpu() : _pager->exc_pt_sel_client(); - if (!is_vcpu()) { + if (!vcpu()) { pd_utcb = stack_area_virtual_base() + stack_virtual_size() - get_page_size(); addr_t remap_src[] = { _pd->parent_pt_sel(), _pager->Object_pool::Entry::cap().local_name() }; @@ -136,7 +136,7 @@ int Platform_thread::start(void *ip, void *sp) addr_t const rights = Obj_crd::RIGHT_EC_RECALL | Obj_crd::RIGHT_PT_CTRL | Obj_crd::RIGHT_PT_CALL | Obj_crd::RIGHT_SM_UP | Obj_crd::RIGHT_SM_DOWN; - unsigned pts = is_vcpu() ? NUM_INITIAL_VCPU_PT_LOG2 : NUM_INITIAL_PT_LOG2; + unsigned pts = vcpu() ? NUM_INITIAL_VCPU_PT_LOG2 : NUM_INITIAL_PT_LOG2; enum { KEEP_FREE_PAGES_NOT_AVAILABLE_FOR_UPGRADE = 2, UPPER_LIMIT_PAGES = 32 }; Obj_crd initial_pts(_sel_exc_base, pts, rights); @@ -215,7 +215,7 @@ Native_capability Platform_thread::pause() cancel_blocking(); /* local thread may never get be canceled if it doesn't receive an IPC */ - if (is_worker()) return Native_capability(); + if (worker()) return Native_capability(); return notify_sm; } @@ -225,7 +225,7 @@ void Platform_thread::resume() { using namespace Nova; - if (!is_worker()) { + if (!worker()) { uint8_t res; do { if (!_pd) { @@ -256,7 +256,7 @@ Thread_state Platform_thread::state() if (_pager->copy_thread_state(&s)) return s; - if (is_worker()) { + if (worker()) { s.sp = _pager->initial_esp(); return s; } @@ -274,18 +274,18 @@ void Platform_thread::state(Thread_state s) /* * s.sel_exc_base exception base of thread in caller * protection domain - not in Core ! - * s.is_vcpu If true it will run as vCPU, + * s.vcpu If true it will run as vCPU, * otherwise it will be a thread. */ - if (!is_main_thread()) + if (!main_thread()) _sel_exc_base = s.sel_exc_base; - if (!s.is_vcpu) + if (!s.vcpu) return; _features |= VCPU; - if (is_main_thread() && _pager) + if (main_thread() && _pager) _pager->prepare_vCPU_portals(); } @@ -304,7 +304,7 @@ Native_capability Platform_thread::single_step_sync(bool on) Native_capability cap = _pager->single_step(on); - if (is_worker()) return Native_capability(); + if (worker()) return Native_capability(); return cap; } @@ -334,7 +334,7 @@ unsigned long long Platform_thread::execution_time() const * For local ECs, we simply return 0 as local ECs are executed with the * time of their callers. */ - if (is_worker()) + if (worker()) return time; uint8_t res = Nova::sc_ctrl(_sel_sc(), time); diff --git a/repos/base-nova/src/core/ram_session_support.cc b/repos/base-nova/src/core/ram_session_support.cc index 6ec234dde..b77d0ebf2 100644 --- a/repos/base-nova/src/core/ram_session_support.cc +++ b/repos/base-nova/src/core/ram_session_support.cc @@ -42,7 +42,7 @@ static inline void * alloc_region(Dataspace_component *ds, const size_t size) size_t align_log2 = log2(ds->size()); for (; align_log2 >= get_page_size_log2(); align_log2--) { if (platform()->region_alloc()->alloc_aligned(size, - &virt_addr, align_log2).is_ok()) + &virt_addr, align_log2).ok()) break; } diff --git a/repos/base-nova/src/core/region_map_support.cc b/repos/base-nova/src/core/region_map_support.cc index 5cfa91bc8..da840fb94 100644 --- a/repos/base-nova/src/core/region_map_support.cc +++ b/repos/base-nova/src/core/region_map_support.cc @@ -26,6 +26,6 @@ void Rm_client::unmap(addr_t, addr_t virt_base, size_t size) { Locked_ptr locked_address_space(_address_space); - if (locked_address_space.is_valid()) + if (locked_address_space.valid()) locked_address_space->flush(virt_base, size); } diff --git a/repos/base-nova/src/lib/base/thread_start.cc b/repos/base-nova/src/lib/base/thread_start.cc index 7a0ee4a80..31c070356 100644 --- a/repos/base-nova/src/lib/base/thread_start.cc +++ b/repos/base-nova/src/lib/base/thread_start.cc @@ -160,7 +160,7 @@ void Thread::start() /* create EC at core */ Thread_state state; state.sel_exc_base = native_thread().exc_pt_sel; - state.is_vcpu = native_thread().is_vcpu; + state.vcpu = native_thread().vcpu; /* local thread have no start instruction pointer - set via portal entry */ addr_t thread_ip = global ? reinterpret_cast(_thread_start) : 0; @@ -183,7 +183,7 @@ void Thread::start() using namespace Nova; /* request exception portals for normal threads */ - if (!native_thread().is_vcpu) { + if (!native_thread().vcpu) { request_event_portal(pager_cap, native_thread().exc_pt_sel, 0, NUM_INITIAL_PT_LOG2); /* default: we don't accept any mappings or translations */ diff --git a/repos/base-okl4/src/core/include/ipc_pager.h b/repos/base-okl4/src/core/include/ipc_pager.h index 0a55bd7fd..c9f6dc7b4 100644 --- a/repos/base-okl4/src/core/include/ipc_pager.h +++ b/repos/base-okl4/src/core/include/ipc_pager.h @@ -161,12 +161,12 @@ namespace Genode { /** * Return true if last fault was a write fault */ - bool is_write_fault() const { return L4_Label(_faulter_tag) & 2; } + bool write_fault() const { return L4_Label(_faulter_tag) & 2; } /** * Return true if last fault was an exception */ - bool is_exception() const + bool exception() const { /* * A page-fault message has one of the op bits (lower 3 bits of the diff --git a/repos/base-okl4/src/core/irq_session_component.cc b/repos/base-okl4/src/core/irq_session_component.cc index db8d5934c..2db1e8470 100644 --- a/repos/base-okl4/src/core/irq_session_component.cc +++ b/repos/base-okl4/src/core/irq_session_component.cc @@ -144,7 +144,7 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc, if (msi) throw Root::Unavailable(); - if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).is_error()) { + if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).error()) { PERR("Unavailable IRQ 0x%x requested", _irq_number); throw Root::Unavailable(); } diff --git a/repos/base-okl4/src/core/pager.cc b/repos/base-okl4/src/core/pager.cc index f740bbce2..2603ee30e 100644 --- a/repos/base-okl4/src/core/pager.cc +++ b/repos/base-okl4/src/core/pager.cc @@ -100,7 +100,7 @@ void Ipc_pager::wait_for_fault() */ /* exception */ - if (is_exception()) { + if (exception()) { L4_StoreMR(1, &_fault_ip); if (verbose_exception) diff --git a/repos/base-okl4/src/core/region_map_support.cc b/repos/base-okl4/src/core/region_map_support.cc index 94710d37e..948dfd80a 100644 --- a/repos/base-okl4/src/core/region_map_support.cc +++ b/repos/base-okl4/src/core/region_map_support.cc @@ -24,6 +24,6 @@ void Rm_client::unmap(addr_t, addr_t virt_base, size_t size) { Locked_ptr locked_address_space(_address_space); - if (locked_address_space.is_valid()) + if (locked_address_space.valid()) locked_address_space->flush(virt_base, size); } diff --git a/repos/base-pistachio/src/core/include/ipc_pager.h b/repos/base-pistachio/src/core/include/ipc_pager.h index 599dbaa71..9bccf6dfb 100644 --- a/repos/base-pistachio/src/core/include/ipc_pager.h +++ b/repos/base-pistachio/src/core/include/ipc_pager.h @@ -168,12 +168,12 @@ namespace Genode { /** * Return true if last fault was a write fault */ - bool is_write_fault() const { return (_flags & 2); } + bool write_fault() const { return (_flags & 2); } /** * Return true if last fault was an exception */ - bool is_exception() const + bool exception() const { /* * Reflection of exceptions is not supported on this platform. diff --git a/repos/base-pistachio/src/core/io_mem_session_support.cc b/repos/base-pistachio/src/core/io_mem_session_support.cc index 9ed3ee689..3361cbd6d 100644 --- a/repos/base-pistachio/src/core/io_mem_session_support.cc +++ b/repos/base-pistachio/src/core/io_mem_session_support.cc @@ -83,7 +83,7 @@ addr_t Io_mem_session_component::_map_local(addr_t base, size_t size) /* find appropriate region for mapping */ void *result = 0; - if (platform()->region_alloc()->alloc_aligned(size, &result, alignment).is_error()) + if (platform()->region_alloc()->alloc_aligned(size, &result, alignment).error()) PERR("alloc_aligned failed!"); local_base = (addr_t)result; diff --git a/repos/base-pistachio/src/core/irq_session_component.cc b/repos/base-pistachio/src/core/irq_session_component.cc index 68bc15834..7ff23c4ef 100644 --- a/repos/base-pistachio/src/core/irq_session_component.cc +++ b/repos/base-pistachio/src/core/irq_session_component.cc @@ -137,7 +137,7 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc, if (msi) throw Root::Unavailable(); - if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).is_error()) { + if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).error()) { PERR("Unavailable IRQ 0x%x requested", _irq_number); throw Root::Unavailable(); } diff --git a/repos/base-pistachio/src/core/platform.cc b/repos/base-pistachio/src/core/platform.cc index 73cbeb3ef..b5ec20ea5 100644 --- a/repos/base-pistachio/src/core/platform.cc +++ b/repos/base-pistachio/src/core/platform.cc @@ -63,7 +63,7 @@ enum { PAGER_STACK_ELEMENTS = 512 }; static unsigned long _core_pager_stack[PAGER_STACK_ELEMENTS]; -static inline bool is_write_fault(Pistachio::L4_Word_t flags) { +static inline bool write_fault(Pistachio::L4_Word_t flags) { return (flags & 2) == 1; } @@ -169,7 +169,7 @@ static void _core_pager_loop() /* check for NULL pointer */ if (pf_addr < page_size) { PERR("possible null pointer %s at address %lx at EIP %lx in", - is_write_fault(flags) ? "WRITE" : "READ/EXEC", pf_addr, pf_ip); + write_fault(flags) ? "WRITE" : "READ/EXEC", pf_addr, pf_ip); print_l4_thread_id(t); /* do not unblock faulter */ break; @@ -177,7 +177,7 @@ static void _core_pager_loop() /* page-fault address is not in RAM */ PERR("%s access outside of RAM at %lx IP %lx", - is_write_fault(flags) ? "WRITE" : "READ", pf_addr, pf_ip); + write_fault(flags) ? "WRITE" : "READ", pf_addr, pf_ip); print_l4_thread_id(t); /* do not unblock faulter */ break; diff --git a/repos/base-sel4/src/core/include/ipc_pager.h b/repos/base-sel4/src/core/include/ipc_pager.h index b90475279..9082f8f0c 100644 --- a/repos/base-sel4/src/core/include/ipc_pager.h +++ b/repos/base-sel4/src/core/include/ipc_pager.h @@ -141,12 +141,12 @@ namespace Genode { /** * Return true if page fault was a write fault */ - bool is_write_fault() const { return _pf_write; } + bool write_fault() const { return _pf_write; } /** * Return true if last fault was an exception */ - bool is_exception() const + bool exception() const { /* * Reflection of exceptions is not supported on this platform. diff --git a/repos/base-sel4/src/core/include/untyped_memory.h b/repos/base-sel4/src/core/include/untyped_memory.h index 21d150ac9..50825dc3c 100644 --- a/repos/base-sel4/src/core/include/untyped_memory.h +++ b/repos/base-sel4/src/core/include/untyped_memory.h @@ -38,7 +38,7 @@ struct Genode::Untyped_memory phys_alloc.alloc_aligned(num_pages*get_page_size(), &out_ptr, get_page_size_log2()); - if (alloc_ret.is_error()) { + if (alloc_ret.error()) { PERR("%s: allocation of untyped memory failed", __FUNCTION__); throw Phys_alloc_failed(); } diff --git a/repos/base-sel4/src/core/irq_session_component.cc b/repos/base-sel4/src/core/irq_session_component.cc index 2e5b8e339..dafbd337e 100644 --- a/repos/base-sel4/src/core/irq_session_component.cc +++ b/repos/base-sel4/src/core/irq_session_component.cc @@ -61,7 +61,7 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc, if (msi) throw Root::Unavailable(); - if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).is_error()) { + if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).error()) { PERR("Unavailable IRQ 0x%x requested", _irq_number); throw Root::Unavailable(); } diff --git a/repos/base-sel4/src/core/platform.cc b/repos/base-sel4/src/core/platform.cc index ff3524173..21a4f3f77 100644 --- a/repos/base-sel4/src/core/platform.cc +++ b/repos/base-sel4/src/core/platform.cc @@ -302,7 +302,7 @@ void Platform::_init_rom_modules() Range_allocator::Alloc_return const alloc_ret = _unused_phys_alloc.alloc_aligned(modules_size, &out_ptr, get_page_size_log2()); - if (alloc_ret.is_error()) { + if (alloc_ret.error()) { PERR("could not reserve phys CNode space for boot modules"); struct Init_rom_modules_failed { }; throw Init_rom_modules_failed(); diff --git a/repos/base-sel4/src/core/region_map_support.cc b/repos/base-sel4/src/core/region_map_support.cc index ae88da3a5..0ee0f29f7 100644 --- a/repos/base-sel4/src/core/region_map_support.cc +++ b/repos/base-sel4/src/core/region_map_support.cc @@ -21,6 +21,6 @@ void Rm_client::unmap(addr_t core_local_base, addr_t virt_base, size_t size) { Locked_ptr locked_address_space(_address_space); - if (locked_address_space.is_valid()) + if (locked_address_space.valid()) locked_address_space->flush(virt_base, size); } diff --git a/repos/base/include/base/allocator.h b/repos/base/include/base/allocator.h index 8e30fae25..41070cfa0 100644 --- a/repos/base/include/base/allocator.h +++ b/repos/base/include/base/allocator.h @@ -150,8 +150,14 @@ struct Genode::Range_allocator : Allocator Value const value; Alloc_return(Value value) : value(value) { } - bool is_ok() const { return value == OK; } - bool is_error() const { return !is_ok(); } + bool ok() const { return value == OK; } + bool error() const { return !ok(); } + + /* + * \deprecated use 'ok' and 'error' instead + */ + bool is_ok() const { return ok(); } + bool is_error() const { return error(); } }; /** diff --git a/repos/base/include/base/allocator_avl.h b/repos/base/include/base/allocator_avl.h index b871002de..c31644ac3 100644 --- a/repos/base/include/base/allocator_avl.h +++ b/repos/base/include/base/allocator_avl.h @@ -282,7 +282,7 @@ class Genode::Allocator_avl_base : public Range_allocator bool alloc(size_t size, void **out_addr) override { return (Allocator_avl_base::alloc_aligned( - size, out_addr, log2(sizeof(addr_t))).is_ok()); + size, out_addr, log2(sizeof(addr_t))).ok()); } void free(void *addr, size_t) override { free(addr); } diff --git a/repos/base/include/base/attached_rom_dataspace.h b/repos/base/include/base/attached_rom_dataspace.h index 430cce8bb..96f2cf7ce 100644 --- a/repos/base/include/base/attached_rom_dataspace.h +++ b/repos/base/include/base/attached_rom_dataspace.h @@ -109,7 +109,7 @@ class Genode::Attached_rom_dataspace * the existing dataspace, we can keep everything in place. The * dataspace content gets updated by the call of '_rom.update'. */ - if (_ds.is_constructed() && _rom.update() == true) + if (_ds.constructed() && _rom.update() == true) return; /* @@ -123,7 +123,15 @@ class Genode::Attached_rom_dataspace /** * Return true of content is present */ - bool is_valid() const { return _ds.is_constructed(); } + bool valid() const { return _ds.constructed(); } + + /** + * Return true of content is present + * + * \noapi + * \deprecated use 'valid' instead + */ + bool is_valid() const { return valid(); } /** * Return dataspace content as XML node @@ -135,7 +143,7 @@ class Genode::Attached_rom_dataspace Xml_node xml() const { try { - if (is_valid() && local_addr()) + if (valid() && local_addr()) return Xml_node(local_addr(), size()); } catch (Xml_node::Invalid_syntax) { } diff --git a/repos/base/include/base/object_pool.h b/repos/base/include/base/object_pool.h index d2627dc6a..9d90447d8 100644 --- a/repos/base/include/base/object_pool.h +++ b/repos/base/include/base/object_pool.h @@ -140,7 +140,7 @@ class Genode::Object_pool { Locked_ptr lock_ptr(ptr); - Object_pointer op = lock_ptr.is_valid() + Object_pointer op = lock_ptr.valid() ? dynamic_cast(&lock_ptr->obj) : nullptr; return func(op); } @@ -170,7 +170,7 @@ class Genode::Object_pool Weak_ptr ptr = obj->_lock.weak_ptr(); { Locked_ptr lock_ptr(ptr); - if (!lock_ptr.is_valid()) return; + if (!lock_ptr.valid()) return; _tree.remove(obj); } diff --git a/repos/base/include/base/rpc_args.h b/repos/base/include/base/rpc_args.h index 9935172e7..28635ebd2 100644 --- a/repos/base/include/base/rpc_args.h +++ b/repos/base/include/base/rpc_args.h @@ -106,9 +106,17 @@ class Genode::Rpc_in_buffer : public Rpc_in_buffer_base /** * Return true if buffer contains a valid null-terminated string */ - bool is_valid_string() const { + bool valid_string() const { return (_size <= MAX_SIZE) && (_size > 0) && (_base[_size - 1] == '\0'); } + /** + * Return true if buffer contains a valid null-terminated string + * + * \noapi + * \deprecated use valid_string instead + */ + bool is_valid_string() const { return valid_string(); } + /** * Return buffer content as null-terminated string * @@ -117,9 +125,9 @@ class Genode::Rpc_in_buffer : public Rpc_in_buffer_base * The method returns an empty string if the buffer does not hold * a valid null-terminated string. To distinguish a buffer holding * an invalid string from a buffer holding a valid empty string, - * the function 'is_valid_string' can be used. + * the function 'valid_string' can be used. */ - char const *string() const { return is_valid_string() ? base() : ""; } + char const *string() const { return valid_string() ? base() : ""; } }; #endif /* _INCLUDE__BASE__RPC_ARGS_H_ */ diff --git a/repos/base/include/base/trace/buffer.h b/repos/base/include/base/trace/buffer.h index 2e91c6ea2..936ccf98d 100644 --- a/repos/base/include/base/trace/buffer.h +++ b/repos/base/include/base/trace/buffer.h @@ -118,9 +118,14 @@ class Genode::Trace::Buffer public: - size_t length() const { return _entry->len; } - char const *data() const { return _entry->data; } - bool is_last() const { return _entry == 0; } + size_t length() const { return _entry->len; } + char const *data() const { return _entry->data; } + bool last() const { return _entry == 0; } + + /* + * \deprecated use 'last' instead + */ + bool is_last() const { return last(); } }; Entry first() const @@ -130,7 +135,7 @@ class Genode::Trace::Buffer Entry next(Entry entry) const { - if (entry.is_last()) + if (entry.last()) return Entry(0); if (entry.length() == 0) diff --git a/repos/base/include/base/trace/logger.h b/repos/base/include/base/trace/logger.h index c2ffab2a9..aca7e1af0 100644 --- a/repos/base/include/base/trace/logger.h +++ b/repos/base/include/base/trace/logger.h @@ -49,9 +49,9 @@ struct Genode::Trace::Logger Logger(); - bool is_initialized() { return control != 0; } + bool initialized() { return control != 0; } - bool is_init_pending() { return pending_init; } + bool init_pending() { return pending_init; } void init_pending(bool val) { pending_init = val; } diff --git a/repos/base/include/base/weak_ptr.h b/repos/base/include/base/weak_ptr.h index 0290cf48e..fd09df361 100644 --- a/repos/base/include/base/weak_ptr.h +++ b/repos/base/include/base/weak_ptr.h @@ -313,7 +313,7 @@ struct Genode::Weak_object : Genode::Weak_object_base * Locked pointer * * A locked pointer is constructed from a weak pointer. After construction, - * its validity can (and should) be checked by calling the 'is_valid' + * its validity can (and should) be checked by calling the 'valid' * method. If the locked pointer is valid, the pointed-to object is known to * be locked until the locked pointer is destroyed. During this time, the * locked pointer can safely be de-referenced. @@ -338,7 +338,15 @@ struct Genode::Locked_ptr : Genode::Locked_ptr_base * Only if valid, the locked pointer can be de-referenced. Otherwise, * the attempt will result in a null-pointer access. */ - bool is_valid() const { return curr != nullptr; } + bool valid() const { return curr != nullptr; } + + /** + * Returns true if the locked pointer is valid + * + * \noapi + * \deprecated use 'valid' instead + */ + bool is_valid() const { return valid(); } }; diff --git a/repos/base/include/root/component.h b/repos/base/include/root/component.h index 12ab6b91f..5d486a375 100644 --- a/repos/base/include/root/component.h +++ b/repos/base/include/root/component.h @@ -202,7 +202,7 @@ class Genode::Root_component : public Rpc_object >, Session_capability session(Root::Session_args const &args, Affinity const &affinity) override { - if (!args.is_valid_string()) throw Root::Invalid_args(); + if (!args.valid_string()) throw Root::Invalid_args(); POLICY::aquire(args.string()); @@ -246,7 +246,7 @@ class Genode::Root_component : public Rpc_object >, void upgrade(Session_capability session, Root::Upgrade_args const &args) override { - if (!args.is_valid_string()) throw Root::Invalid_args(); + if (!args.valid_string()) throw Root::Invalid_args(); _ep->apply(session, [&] (SESSION_TYPE *s) { if (!s) return; diff --git a/repos/base/include/util/fifo.h b/repos/base/include/util/fifo.h index 08e5256a7..7cd227a61 100644 --- a/repos/base/include/util/fifo.h +++ b/repos/base/include/util/fifo.h @@ -39,17 +39,25 @@ class Genode::Fifo friend class Fifo; - QT *_next; - bool _is_enqueued; + QT *_next; + bool _enqueued; public: - Element(): _next(0), _is_enqueued(false) { } + Element(): _next(0), _enqueued(false) { } /** * Return true is fifo element is enqueued in a fifo */ - bool is_enqueued() { return _is_enqueued; } + bool enqueued() { return _enqueued; } + + /** + * Return true is fifo element is enqueued in a fifo + * + * \noapi + * \deprecated use 'enqueued' instead + */ + bool is_enqueued() { return enqueued(); } /** * Return next element in queue @@ -107,7 +115,7 @@ class Genode::Fifo } qe->Element::_next = 0; - qe->Element::_is_enqueued = 0; + qe->Element::_enqueued = 0; } /** @@ -116,7 +124,7 @@ class Genode::Fifo void enqueue(QT *e) { e->Fifo::Element::_next = 0; - e->Fifo::Element::_is_enqueued = true; + e->Fifo::Element::_enqueued = true; if (empty()) { _tail = _head = e; @@ -146,7 +154,7 @@ class Genode::Fifo /* mark fifo queue element as free */ if (result) { result->Fifo::Element::_next = 0; - result->Fifo::Element::_is_enqueued = false; + result->Fifo::Element::_enqueued = false; } return result; diff --git a/repos/base/include/util/volatile_object.h b/repos/base/include/util/volatile_object.h index 92d7b9633..e0018fd8f 100644 --- a/repos/base/include/util/volatile_object.h +++ b/repos/base/include/util/volatile_object.h @@ -130,7 +130,14 @@ class Genode::Volatile_object /** * Return true of volatile object contains a constructed object */ - bool is_constructed() const { return _constructed; } + bool constructed() const { return _constructed; } + + /** + * Return true of volatile object contains a constructed object + * + * \deprecated use 'constructed' instead + */ + bool is_constructed() const { return constructed(); } /** * Access contained object diff --git a/repos/base/include/util/xml_node.h b/repos/base/include/util/xml_node.h index 9b4952bfc..537869e77 100644 --- a/repos/base/include/util/xml_node.h +++ b/repos/base/include/util/xml_node.h @@ -304,7 +304,7 @@ class Genode::Xml_node /** * Return true if tag is the start of a valid XML node */ - bool is_node() const { return _type == START || _type == EMPTY; } + bool node() const { return _type == START || _type == EMPTY; } /** * Return first token of tag @@ -507,7 +507,7 @@ class Genode::Xml_node } /* count sub nodes at depth 1 */ - if (depth == 1 && curr_tag.is_node()) + if (depth == 1 && curr_tag.node()) _num_sub_nodes++; /* keep track of the current depth */ @@ -758,12 +758,20 @@ class Genode::Xml_node /** * Return true if node is the last of a node sequence */ - bool is_last(const char *type = 0) const + bool last(const char *type = 0) const { try { next(type); return false; } catch (Nonexistent_sub_node) { return true; } } + /** + * Return true if node is the last of a node sequence + * + * \noapi + * \deprecated use 'last' instead + */ + bool is_last(const char *type = 0) const { return last(); } + /** * Return sub node with specified index * diff --git a/repos/base/src/core/core_mem_alloc.cc b/repos/base/src/core/core_mem_alloc.cc index 4dc82ddb1..41308344f 100644 --- a/repos/base/src/core/core_mem_alloc.cc +++ b/repos/base/src/core/core_mem_alloc.cc @@ -45,7 +45,7 @@ Mapped_mem_allocator::alloc_aligned(size_t size, void **out_addr, int align, add /* allocate physical pages */ Alloc_return ret1 = _phys_alloc->alloc_aligned(page_rounded_size, &phys_addr, align, from, to); - if (!ret1.is_ok()) { + if (!ret1.ok()) { PERR("Could not allocate physical memory region of size %zu\n", page_rounded_size); return ret1; @@ -54,7 +54,7 @@ Mapped_mem_allocator::alloc_aligned(size_t size, void **out_addr, int align, add /* allocate range in core's virtual address space */ Alloc_return ret2 = _virt_alloc->alloc_aligned(page_rounded_size, out_addr, align); - if (!ret2.is_ok()) { + if (!ret2.ok()) { PERR("Could not allocate virtual address range in core of size %zu\n", page_rounded_size); diff --git a/repos/base/src/core/include/core_mem_alloc.h b/repos/base/src/core/include/core_mem_alloc.h index 25d5eda82..6d78c8b62 100644 --- a/repos/base/src/core/include/core_mem_alloc.h +++ b/repos/base/src/core/include/core_mem_alloc.h @@ -174,7 +174,7 @@ class Genode::Mapped_mem_allocator : public Genode::Core_mem_translator *************************/ bool alloc(size_t size, void **out_addr) override { - return alloc_aligned(size, out_addr, log2(sizeof(addr_t))).is_ok(); } + return alloc_aligned(size, out_addr, log2(sizeof(addr_t))).ok(); } void free(void *addr, size_t) override; size_t consumed() const override { return _phys_alloc->consumed(); } size_t overhead(size_t size) const override { @@ -300,7 +300,7 @@ class Genode::Core_mem_allocator : public Genode::Core_mem_translator *************************/ bool alloc(size_t size, void **out_addr) override { - return alloc_aligned(size, out_addr, log2(sizeof(addr_t))).is_ok(); } + return alloc_aligned(size, out_addr, log2(sizeof(addr_t))).ok(); } void free(void *addr, size_t size) override { diff --git a/repos/base/src/core/include/dataspace_component.h b/repos/base/src/core/include/dataspace_component.h index e112da4f9..1027a7ec1 100644 --- a/repos/base/src/core/include/dataspace_component.h +++ b/repos/base/src/core/include/dataspace_component.h @@ -40,7 +40,7 @@ namespace Genode { addr_t const _phys_addr; /* address of dataspace in physical memory */ addr_t _core_local_addr; /* address of core-local mapping */ size_t const _size; /* size of dataspace in bytes */ - bool const _is_io_mem; /* dataspace is I/O mem, not to be touched */ + bool const _io_mem; /* dataspace is I/O mem, not to be touched */ Cache_attribute const _cache; /* access memory cached, write-combined, or uncached respectively */ bool const _writable; /* false if dataspace is read-only */ @@ -73,7 +73,7 @@ namespace Genode { Dataspace_component() : _phys_addr(0), _core_local_addr(0), _size(0), - _is_io_mem(false), _cache(CACHED), _writable(false), + _io_mem(false), _cache(CACHED), _writable(false), _owner(0), _managed(false) { } /** @@ -86,7 +86,7 @@ namespace Genode { Dataspace_owner *owner) : _phys_addr(core_local_addr), _core_local_addr(core_local_addr), - _size(round_page(size)), _is_io_mem(false), + _size(round_page(size)), _io_mem(false), _cache(cache), _writable(writable), _owner(owner), _managed(false) { } @@ -105,7 +105,7 @@ namespace Genode { bool writable, Dataspace_owner *owner) : _phys_addr(phys_addr), _core_local_addr(core_local_addr), - _size(size), _is_io_mem(true), _cache(cache), + _size(size), _io_mem(true), _cache(cache), _writable(writable), _owner(owner), _managed(false) { } /** @@ -121,7 +121,7 @@ namespace Genode { virtual Native_capability sub_rm() { return Dataspace_capability(); } addr_t core_local_addr() const { return _core_local_addr; } - bool is_io_mem() const { return _is_io_mem; } + bool io_mem() const { return _io_mem; } Cache_attribute cacheability() const { return _cache; } /** @@ -156,10 +156,11 @@ namespace Genode { ** Dataspace interface ** *************************/ - size_t size() { return _size; } - addr_t phys_addr() { return _phys_addr; } - bool writable() { return _writable; } - bool is_managed() { return _managed; } + size_t size() override { return _size; } + addr_t phys_addr() override { return _phys_addr; } + bool writable() override { return _writable; } + + bool managed() { return _managed; } }; } diff --git a/repos/base/src/core/include/log_session_component.h b/repos/base/src/core/include/log_session_component.h index 149ac922a..f339df016 100644 --- a/repos/base/src/core/include/log_session_component.h +++ b/repos/base/src/core/include/log_session_component.h @@ -46,7 +46,7 @@ namespace Genode { size_t write(String const &string_buf) { - if (!(string_buf.is_valid_string())) { + if (!(string_buf.valid_string())) { PERR("corrupted string"); return 0; } diff --git a/repos/base/src/core/include/signal_source_component.h b/repos/base/src/core/include/signal_source_component.h index 758957764..1343ba234 100644 --- a/repos/base/src/core/include/signal_source_component.h +++ b/repos/base/src/core/include/signal_source_component.h @@ -136,7 +136,7 @@ class Genode::Signal_source_component : public Signal_source_rpc_object Genode::Signal_context_component::~Signal_context_component() { - if (is_enqueued() && _source) + if (enqueued() && _source) _source->release(this); } diff --git a/repos/base/src/core/include/trace/policy_registry.h b/repos/base/src/core/include/trace/policy_registry.h index b3d9cb19f..87e27a645 100644 --- a/repos/base/src/core/include/trace/policy_registry.h +++ b/repos/base/src/core/include/trace/policy_registry.h @@ -53,7 +53,7 @@ class Genode::Trace::Policy : public Genode::List::Elemen Allocator &md_alloc() { return _md_alloc; } - bool is_owned_by(Policy_owner const &owner) const + bool owned_by(Policy_owner const &owner) const { return &_owner == &owner; } @@ -81,7 +81,7 @@ class Genode::Trace::Policy_registry Policy *_unsynchronized_lookup(Policy_owner const &owner, Policy_id id) { for (Policy *p = _policies.first(); p; p = p->next()) - if (p->is_owned_by(owner) && p->has_id(id)) + if (p->owned_by(owner) && p->has_id(id)) return p; throw Nonexistent_policy(); @@ -90,7 +90,7 @@ class Genode::Trace::Policy_registry Policy *_any_policy_owned_by(Policy_owner const &owner) { for (Policy *p = _policies.first(); p; p = p->next()) - if (p->is_owned_by(owner)) + if (p->owned_by(owner)) return p; return 0; @@ -123,7 +123,7 @@ class Genode::Trace::Policy_registry Policy *tmp = p; p = p->next(); - if (tmp->is_owned_by(owner) && tmp->has_id(id)) { + if (tmp->owned_by(owner) && tmp->has_id(id)) { _policies.remove(tmp); destroy(&tmp->md_alloc(), tmp); } diff --git a/repos/base/src/core/include/trace/source_registry.h b/repos/base/src/core/include/trace/source_registry.h index 49e219ae8..3a182ffd2 100644 --- a/repos/base/src/core/include/trace/source_registry.h +++ b/repos/base/src/core/include/trace/source_registry.h @@ -115,16 +115,16 @@ class Genode::Trace::Source return true; } - bool is_owned_by(Source_owner const *owner) { return owner == _owner; } + bool owned_by(Source_owner const *owner) { return owner == _owner; } void release_ownership(Source_owner const *owner) { - if (is_owned_by(owner)) + if (owned_by(owner)) _owner = 0; } bool error() const { return _control.has_error(); } - bool enabled() const { return _control.is_enabled(); } + bool enabled() const { return _control.enabled(); } /*********************************** diff --git a/repos/base/src/core/include/trace/subject_registry.h b/repos/base/src/core/include/trace/subject_registry.h index ad063690a..cdb920e04 100644 --- a/repos/base/src/core/include/trace/subject_registry.h +++ b/repos/base/src/core/include/trace/subject_registry.h @@ -144,12 +144,12 @@ class Genode::Trace::Subject Locked_ptr source(_source); /* source vanished */ - if (!source.is_valid()) + if (!source.valid()) return Subject_info::DEAD; if (source->enabled()) - return source->is_owned_by(this) ? Subject_info::TRACED - : Subject_info::FOREIGN; + return source->owned_by(this) ? Subject_info::TRACED + : Subject_info::FOREIGN; if (source->error()) return Subject_info::ERROR; @@ -200,7 +200,7 @@ class Genode::Trace::Subject /* inform trace source about the new buffer */ Locked_ptr source(_source); - if (!source.is_valid()) + if (!source.valid()) throw Source_is_dead(); if (!source->try_acquire(this)) @@ -214,7 +214,7 @@ class Genode::Trace::Subject /* inform trace source about the new buffer */ Locked_ptr source(_source); - if (source.is_valid()) + if (source.valid()) source->disable(); } @@ -228,7 +228,7 @@ class Genode::Trace::Subject /* inform trace source about the new buffer */ Locked_ptr source(_source); - if (!source.is_valid()) + if (!source.valid()) throw Source_is_dead(); source->enable(); @@ -242,7 +242,7 @@ class Genode::Trace::Subject { Locked_ptr source(_source); - if (source.is_valid()) { + if (source.valid()) { Trace::Source::Info const info = source->info(); execution_time = info.execution_time; affinity = info.affinity; @@ -261,7 +261,7 @@ class Genode::Trace::Subject Locked_ptr source(_source); /* source vanished */ - if (!source.is_valid()) + if (!source.valid()) return 0; return _buffer.flush() + _policy.flush(); diff --git a/repos/base/src/core/pager_ep.cc b/repos/base/src/core/pager_ep.cc index 00bab1462..3d5ab14bb 100644 --- a/repos/base/src/core/pager_ep.cc +++ b/repos/base/src/core/pager_ep.cc @@ -35,7 +35,7 @@ void Pager_entrypoint::entry() Pool::apply(_pager.badge(), [&] (Pager_object *obj) { if (obj) { - if (_pager.is_exception()) + if (_pager.exception()) obj->submit_exception_signal(); else /* send reply if page-fault handling succeeded */ diff --git a/repos/base/src/core/ram_session_component.cc b/repos/base/src/core/ram_session_component.cc index 2ef658fb0..884c5bbff 100644 --- a/repos/base/src/core/ram_session_component.cc +++ b/repos/base/src/core/ram_session_component.cc @@ -157,7 +157,7 @@ Ram_dataspace_capability Ram_session_component::alloc(size_t ds_size, Cache_attr bool alloc_succeeded = false; for (size_t align_log2 = log2(ds_size); align_log2 >= 12; align_log2--) { if (_ram_alloc->alloc_aligned(ds_size, &ds_addr, align_log2, - _phys_start, _phys_end).is_ok()) { + _phys_start, _phys_end).ok()) { alloc_succeeded = true; break; } diff --git a/repos/base/src/core/region_map_component.cc b/repos/base/src/core/region_map_component.cc index 485f0cc1e..593320f14 100644 --- a/repos/base/src/core/region_map_component.cc +++ b/repos/base/src/core/region_map_component.cc @@ -162,8 +162,8 @@ int Rm_client::pager(Ipc_pager &pager) { using Fault_area = Region_map_component::Fault_area; - Region_map::State::Fault_type pf_type = pager.is_write_fault() ? Region_map::State::WRITE_FAULT - : Region_map::State::READ_FAULT; + Region_map::State::Fault_type pf_type = pager.write_fault() ? Region_map::State::WRITE_FAULT + : Region_map::State::READ_FAULT; addr_t pf_addr = pager.fault_addr(); addr_t pf_ip = pager.fault_ip(); @@ -231,7 +231,7 @@ int Rm_client::pager(Ipc_pager &pager) } Mapping mapping(dst_fault_area.base(), src_fault_area.base(), - dsc->cacheability(), dsc->is_io_mem(), + dsc->cacheability(), dsc->io_mem(), map_size_log2, dsc->writable()); /* @@ -242,7 +242,7 @@ int Rm_client::pager(Ipc_pager &pager) * pages that are not locally mapped, the 'map_core_local' function may be * empty. */ - if (!dsc->is_io_mem()) + if (!dsc->io_mem()) mapping.prepare_map_operation(); /* answer page fault with a flex-page mapping */ @@ -359,7 +359,7 @@ Region_map_component::attach(Dataspace_capability ds_cap, size_t size, Range_allocator::Alloc_return alloc_return = _map.alloc_aligned(size, &r, align_log2); - if (alloc_return.is_ok()) + if (alloc_return.ok()) break; else if (alloc_return.value == Range_allocator::Alloc_return::OUT_OF_METADATA) { _map.free(r); @@ -499,7 +499,7 @@ void Region_map_component::detach(Local_addr local_addr) * base-class's function. Hence, we cannot check the return value of this * function to determine if the dataspace is a managed dataspace. Instead, * we introduced a dataspace member '_managed' with the non-virtual accessor - * function 'is_managed'. + * function 'managed'. */ /* @@ -521,7 +521,7 @@ void Region_map_component::detach(Local_addr local_addr) * client. */ if (!platform()->supports_direct_unmap() - && dsc->is_managed() && dsc->core_local_addr() == 0) { + && dsc->managed() && dsc->core_local_addr() == 0) { PWRN("unmapping of managed dataspaces not yet supported"); break; } diff --git a/repos/base/src/core/signal_source_component.cc b/repos/base/src/core/signal_source_component.cc index 2c0d4d9fe..fe7530ec8 100644 --- a/repos/base/src/core/signal_source_component.cc +++ b/repos/base/src/core/signal_source_component.cc @@ -27,7 +27,7 @@ using namespace Genode; void Signal_source_component::release(Signal_context_component *context) { - if (context && context->is_enqueued()) + if (context && context->enqueued()) _signal_queue.remove(context); } @@ -59,7 +59,7 @@ void Signal_source_component::submit(Signal_context_component *context, } else { - if (!context->is_enqueued()) + if (!context->enqueued()) _signal_queue.enqueue(context); } } diff --git a/repos/base/src/core/stack_area.cc b/repos/base/src/core/stack_area.cc index cba9553ab..fac1c840c 100644 --- a/repos/base/src/core/stack_area.cc +++ b/repos/base/src/core/stack_area.cc @@ -78,7 +78,7 @@ class Stack_area_region_map : public Region_map void *phys_base; Range_allocator *ra = platform_specific()->ram_alloc(); if (ra->alloc_aligned(size, &phys_base, - get_page_size_log2()).is_error()) { + get_page_size_log2()).error()) { PERR("could not allocate backing store for new stack"); return (addr_t)0; } diff --git a/repos/base/src/include/base/internal/elf.h b/repos/base/src/include/base/internal/elf.h index e7585000e..d21409551 100644 --- a/repos/base/src/include/base/internal/elf.h +++ b/repos/base/src/include/base/internal/elf.h @@ -63,7 +63,7 @@ class Genode::Elf_binary /** * Check for dynamic elf */ - bool is_dynamically_linked() { return (_dynamic && _interp); } + bool dynamically_linked() { return (_dynamic && _interp); } /************************ diff --git a/repos/base/src/include/base/internal/trace_control.h b/repos/base/src/include/base/internal/trace_control.h index 973a3a5ac..0c88e9425 100644 --- a/repos/base/src/include/base/internal/trace_control.h +++ b/repos/base/src/include/base/internal/trace_control.h @@ -161,7 +161,18 @@ class Genode::Trace::Control bool has_error() const { return _acknowledged_state == ERROR; } - bool is_enabled() const { return _acknowledged_state == ENABLED; } + /** + * Return true if tracing is enabled + */ + bool enabled() const { return _acknowledged_state == ENABLED; } + + /** + * Return true if tracing is enabled + * + * \noapi + * \deprecated use 'enabled' instead + */ + bool is_enabled() const { return enabled(); } }; #endif /* _INCLUDE__BASE__INTERNAL__TRACE_CONTROL_H_ */ diff --git a/repos/base/src/lib/base/child.cc b/repos/base/src/lib/base/child.cc index fb248939e..5d98acb41 100644 --- a/repos/base/src/lib/base/child.cc +++ b/repos/base/src/lib/base/child.cc @@ -301,7 +301,7 @@ void Child::notify_resource_avail() const void Child::announce(Parent::Service_name const &name, Root_capability root) { - if (!name.is_valid_string()) return; + if (!name.valid_string()) return; _policy.announce_service(name.string(), root, heap(), &_server); } @@ -311,7 +311,7 @@ Session_capability Child::session(Parent::Service_name const &name, Parent::Session_args const &args, Affinity const &affinity) { - if (!name.is_valid_string() || !args.is_valid_string()) throw Unavailable(); + if (!name.valid_string() || !args.valid_string()) throw Unavailable(); /* return sessions that we created for the child */ if (!strcmp("Env::ram_session", name.string())) return _ram; @@ -382,7 +382,7 @@ void Child::upgrade(Session_capability to_session, Parent::Upgrade_args const &a return; } - if (!args.is_valid_string()) { + if (!args.valid_string()) { PWRN("no valid session-upgrade arguments"); return; } diff --git a/repos/base/src/lib/base/child_process.cc b/repos/base/src/lib/base/child_process.cc index 7d0d46d8d..dbe3b9b11 100644 --- a/repos/base/src/lib/base/child_process.cc +++ b/repos/base/src/lib/base/child_process.cc @@ -49,7 +49,7 @@ Child::Process::Loaded_executable::Loaded_executable(Dataspace_capability elf_ds * If the specified executable is a dynamically linked program, we load * the dynamic linker instead. */ - if (elf.is_dynamically_linked()) { + if (elf.dynamically_linked()) { local_rm.detach(elf_addr); diff --git a/repos/base/src/lib/base/heap.cc b/repos/base/src/lib/base/heap.cc index 1f4ce2e50..18005c129 100644 --- a/repos/base/src/lib/base/heap.cc +++ b/repos/base/src/lib/base/heap.cc @@ -108,7 +108,7 @@ Heap::Dataspace *Heap::_allocate_dataspace(size_t size, bool enforce_separate_me _alloc->add_range((addr_t)ds_addr, size); /* allocate the Dataspace structure */ - if (_alloc->alloc_aligned(sizeof(Heap::Dataspace), &ds_meta_data_addr, log2(sizeof(addr_t))).is_error()) { + if (_alloc->alloc_aligned(sizeof(Heap::Dataspace), &ds_meta_data_addr, log2(sizeof(addr_t))).error()) { PWRN("could not allocate dataspace meta data - this should never happen"); return 0; } @@ -125,7 +125,7 @@ Heap::Dataspace *Heap::_allocate_dataspace(size_t size, bool enforce_separate_me bool Heap::_try_local_alloc(size_t size, void **out_addr) { - if (_alloc->alloc_aligned(size, out_addr, log2(sizeof(addr_t))).is_error()) + if (_alloc->alloc_aligned(size, out_addr, log2(sizeof(addr_t))).error()) return false; _quota_used += size; diff --git a/repos/base/src/lib/base/trace.cc b/repos/base/src/lib/base/trace.cc index ddaf8473e..bd21debbd 100644 --- a/repos/base/src/lib/base/trace.cc +++ b/repos/base/src/lib/base/trace.cc @@ -192,11 +192,11 @@ Trace::Logger *Thread::_logger() : main_trace_logger(); /* logger is already being initialized */ - if (logger->is_init_pending()) + if (logger->init_pending()) return logger; /* lazily initialize trace object */ - if (!logger->is_initialized()) { + if (!logger->initialized()) { logger->init_pending(true); Thread_capability thread_cap = myself ? myself->_thread_cap diff --git a/repos/base/src/lib/ldso/file.cc b/repos/base/src/lib/ldso/file.cc index 6df2c54c2..bb89af6d0 100644 --- a/repos/base/src/lib/ldso/file.cc +++ b/repos/base/src/lib/ldso/file.cc @@ -87,11 +87,11 @@ class Linker::Rm_area { addr_t addr = vaddr; - if (addr && (_range.alloc_addr(size, addr).is_error())) + if (addr && (_range.alloc_addr(size, addr).error())) throw Region_conflict(); else if (!addr && _range.alloc_aligned(size, (void **)&addr, - get_page_size_log2()).is_error()) + get_page_size_log2()).error()) { throw Region_conflict(); } diff --git a/repos/base/src/test/weak_ptr/main.cc b/repos/base/src/test/weak_ptr/main.cc index a913df80f..4d5821e77 100644 --- a/repos/base/src/test/weak_ptr/main.cc +++ b/repos/base/src/test/weak_ptr/main.cc @@ -35,12 +35,12 @@ void Genode::Weak_object_base::debug_info() const } -static int weak_ptr_is_valid; +static int weak_ptr_valid; void Genode::Weak_ptr_base::debug_info() const { - weak_ptr_is_valid = (_obj != nullptr); + weak_ptr_valid = (_obj != nullptr); } @@ -64,7 +64,7 @@ static void assert_weak_ptr_valid(Genode::Weak_ptr_base const &ptr, bool valid) { ptr.debug_info(); - if (weak_ptr_is_valid == valid) + if (weak_ptr_valid == valid) return; PERR("weak pointer unexpectedly %s", valid ? "valid" : "invalid"); @@ -76,17 +76,17 @@ static void assert_weak_ptr_valid(Genode::Weak_ptr_base const &ptr, bool valid) ** Test for the tracking of weak pointers ** ********************************************/ -static bool object_is_constructed; +static bool object_constructed; struct Object : Genode::Weak_object { - Object() { object_is_constructed = true; } + Object() { object_constructed = true; } ~Object() { Weak_object::lock_for_destruction(); - object_is_constructed = false; + object_constructed = false; } }; @@ -161,11 +161,11 @@ struct Destruct_thread : Genode::Thread_deprecated<4096> static void assert_constructed(bool expect_constructed) { - if (object_is_constructed == expect_constructed) + if (object_constructed == expect_constructed) return; PERR("object unexpectedly %sconstructed", - !object_is_constructed ? "not" : ""); + !object_constructed ? "not" : ""); throw Fatal_error(); } @@ -230,7 +230,7 @@ static void test_acquisition_failure() { Locked_ptr locked_ptr(ptr); - if (!locked_ptr.is_valid()) { + if (!locked_ptr.valid()) { PERR("locked pointer unexpectedly invalid"); throw Fatal_error(); } @@ -245,7 +245,7 @@ static void test_acquisition_failure() { Locked_ptr locked_ptr(ptr); - if (locked_ptr.is_valid()) { + if (locked_ptr.valid()) { PERR("locked pointer unexpectedly valid"); throw Fatal_error(); } @@ -262,13 +262,13 @@ struct Object_with_delayed_destruction { Timer::Connection timer; - Object_with_delayed_destruction() { object_is_constructed = true; } + Object_with_delayed_destruction() { object_constructed = true; } ~Object_with_delayed_destruction() { Weak_object::lock_for_destruction(); timer.msleep(2000); - object_is_constructed = false; + object_constructed = false; } }; diff --git a/repos/dde_bsd/src/lib/audio/bus.cc b/repos/dde_bsd/src/lib/audio/bus.cc index ab9352c49..4d2eb06a3 100644 --- a/repos/dde_bsd/src/lib/audio/bus.cc +++ b/repos/dde_bsd/src/lib/audio/bus.cc @@ -86,7 +86,7 @@ class Pci_driver : public Bsd::Bus_driver } void *ptr = nullptr; - bool err = Allocator_avl::alloc_aligned(size, &ptr, align).is_error(); + bool err = Allocator_avl::alloc_aligned(size, &ptr, align).error(); return err ? 0 : (addr_t)ptr; } diff --git a/repos/dde_ipxe/src/lib/dde_ipxe/dde_support.cc b/repos/dde_ipxe/src/lib/dde_ipxe/dde_support.cc index b577ed269..f9e4848c1 100644 --- a/repos/dde_ipxe/src/lib/dde_ipxe/dde_support.cc +++ b/repos/dde_ipxe/src/lib/dde_ipxe/dde_support.cc @@ -365,7 +365,7 @@ extern "C" void *dde_dma_alloc(dde_size_t size, dde_size_t align, dde_size_t offset) { void *ptr; - if (allocator().alloc_aligned(size, &ptr, Genode::log2(align)).is_error()) { + if (allocator().alloc_aligned(size, &ptr, Genode::log2(align)).error()) { PERR("memory allocation failed in alloc_memblock (size=%zu, align=%zx," " offset=%zx)", (Genode::size_t)size, (Genode::size_t)align, (Genode::size_t)offset); return 0; diff --git a/repos/dde_linux/src/drivers/framebuffer/intel/include/component.h b/repos/dde_linux/src/drivers/framebuffer/intel/include/component.h index 7f695ce6a..93f6f6012 100644 --- a/repos/dde_linux/src/drivers/framebuffer/intel/include/component.h +++ b/repos/dde_linux/src/drivers/framebuffer/intel/include/component.h @@ -94,17 +94,17 @@ class Framebuffer::Session_component : public Genode::Rpc_object { _in_update = false; - if (_fb_ds.is_constructed()) + if (_fb_ds.constructed()) _fb_ds.destruct(); _fb_ds.construct(framebuffer_dataspace()); - if (!_fb_ds.is_constructed()) + if (!_fb_ds.constructed()) PERR("framebuffer dataspace not initialized"); if (_buffered) { _bb_ds.construct(Genode::env()->ram_session(), _width * _height * _bytes_per_pixel); - if (!_bb_ds.is_constructed()) { + if (!_bb_ds.constructed()) { PERR("buffered mode enabled, but buffer not initialized"); return Genode::Dataspace_capability(); } diff --git a/repos/dde_linux/src/drivers/framebuffer/intel/lx_emul.cc b/repos/dde_linux/src/drivers/framebuffer/intel/lx_emul.cc index 22c773e4a..3b484f61d 100644 --- a/repos/dde_linux/src/drivers/framebuffer/intel/lx_emul.cc +++ b/repos/dde_linux/src/drivers/framebuffer/intel/lx_emul.cc @@ -1205,7 +1205,7 @@ void update_genode_report() reporter.enabled(false); } - if (!reporter.is_enabled()) return; + if (!reporter.enabled()) return; try { diff --git a/repos/dde_linux/src/drivers/wifi/main.cc b/repos/dde_linux/src/drivers/wifi/main.cc index 0ad545760..65b35f8d7 100644 --- a/repos/dde_linux/src/drivers/wifi/main.cc +++ b/repos/dde_linux/src/drivers/wifi/main.cc @@ -151,7 +151,7 @@ struct Wlan_configration * configuration yet to fool wpa_supplicant to keep it scanning * for the non exisiting network. */ - if (!config_rom.is_valid()) { + if (!config_rom.valid()) { _active_dummy_configuration(); return; } diff --git a/repos/dde_linux/src/lib/usb/raw/raw.cc b/repos/dde_linux/src/lib/usb/raw/raw.cc index 0e1316928..612d4b3f1 100644 --- a/repos/dde_linux/src/lib/usb/raw/raw.cc +++ b/repos/dde_linux/src/lib/usb/raw/raw.cc @@ -118,7 +118,7 @@ struct Device : List::Element { list()->insert(this); - if (device_list_reporter().is_enabled()) + if (device_list_reporter().enabled()) report_device_list(); } @@ -126,7 +126,7 @@ struct Device : List::Element { list()->remove(this); - if (device_list_reporter().is_enabled()) + if (device_list_reporter().enabled()) report_device_list(); } @@ -756,7 +756,7 @@ class Usb::Root : public Genode::Root_component Genode::Xml_node config = Genode::config()->xml_node(); - if (!_config_reporter.is_enabled()) + if (!_config_reporter.enabled()) _config_reporter.enabled(true); bool const uhci = config.attribute_value("uhci", false); diff --git a/repos/dde_linux/src/server/usb_terminal/main.cc b/repos/dde_linux/src/server/usb_terminal/main.cc index 1f4441da5..5e269635e 100644 --- a/repos/dde_linux/src/server/usb_terminal/main.cc +++ b/repos/dde_linux/src/server/usb_terminal/main.cc @@ -98,7 +98,7 @@ struct Usb::Pl2303_driver : Completion Interface iface = device.interface(0); /* error or write packet */ - if (!p.succeded || !p.is_read_transfer()) { + if (!p.succeded || !p.read_transfer()) { iface.release(p); return; } diff --git a/repos/dde_rump/include/util/allocator_fap.h b/repos/dde_rump/include/util/allocator_fap.h index 9ad7a10a9..0cae4be2b 100644 --- a/repos/dde_rump/include/util/allocator_fap.h +++ b/repos/dde_rump/include/util/allocator_fap.h @@ -140,13 +140,13 @@ namespace Allocator { { void *addr; - if (!_range.alloc_aligned(size, &addr, align).is_error()) + if (!_range.alloc_aligned(size, &addr, align).error()) return addr; if (!_alloc_block()) return 0; - if (_range.alloc_aligned(size, &addr, align).is_error()) { + if (_range.alloc_aligned(size, &addr, align).error()) { PERR("Backend allocator: Unable to allocate memory (size: %zu align: %d:)", size, align); return 0; diff --git a/repos/dde_rump/src/server/rump_fs/main.cc b/repos/dde_rump/src/server/rump_fs/main.cc index d82c0a4d3..c16d7bb12 100644 --- a/repos/dde_rump/src/server/rump_fs/main.cc +++ b/repos/dde_rump/src/server/rump_fs/main.cc @@ -222,7 +222,7 @@ class File_system::Session_component : public Session_rpc_object if (!_writable && create) throw Permission_denied(); - if (!path.is_valid_string()) + if (!path.valid_string()) throw Name_too_long(); Directory *dir = _root.subdir(path_str, create); diff --git a/repos/demo/include/scout/element.h b/repos/demo/include/scout/element.h index 59f2d4578..012796caa 100644 --- a/repos/demo/include/scout/element.h +++ b/repos/demo/include/scout/element.h @@ -65,10 +65,10 @@ class Scout::Element /** * Accessor functionse */ - Point position() const { return _position; } - Area size() const { return _size; } - Area min_size() const { return _min_size; } - bool is_bottom() const { return _flags.bottom; } + Point position() const { return _position; } + Area size() const { return _size; } + Area min_size() const { return _min_size; } + bool bottom() const { return _flags.bottom; } void findable(int flag) { _flags.findable = flag; } diff --git a/repos/demo/include/scout/platform.h b/repos/demo/include/scout/platform.h index a9d5793f7..120d63e0d 100644 --- a/repos/demo/include/scout/platform.h +++ b/repos/demo/include/scout/platform.h @@ -119,7 +119,7 @@ class Scout::Platform void _import_events() { - if (_input.is_pending() == false) return; + if (_input.pending() == false) return; for (int i = 0, num = _input.flush(); i < num; i++) { diff --git a/repos/demo/src/app/scout/elements.cc b/repos/demo/src/app/scout/elements.cc index 02b4c9449..4ca96f653 100644 --- a/repos/demo/src/app/scout/elements.cc +++ b/repos/demo/src/app/scout/elements.cc @@ -198,7 +198,7 @@ void Parent_element::geometry(Rect rect) { ::Element::geometry(rect); - if (!_last || !_last->is_bottom()) return; + if (!_last || !_last->bottom()) return; _last->geometry(Rect(Point(_last->position().x(), rect.h() - _last->size().h()), _last->size())); diff --git a/repos/demo/src/server/nitlog/main.cc b/repos/demo/src/server/nitlog/main.cc index d602b9732..290a26390 100644 --- a/repos/demo/src/server/nitlog/main.cc +++ b/repos/demo/src/server/nitlog/main.cc @@ -294,7 +294,7 @@ class Log_session_component : public Genode::Rpc_object Genode::size_t write(String const &log_text) { - if (!log_text.is_valid_string()) { + if (!log_text.valid_string()) { PERR("corrupted string"); return 0; } @@ -441,7 +441,7 @@ int main(int argc, char **argv) unsigned key_cnt = 0; while (1) { - while (!nitpicker.input()->is_pending()) { + while (!nitpicker.input()->pending()) { if (log_window.draw()) nitpicker.framebuffer()->refresh(0, 0, log_win_w, log_win_h); timer.msleep(20); diff --git a/repos/gems/src/app/cpu_load_display/main.cc b/repos/gems/src/app/cpu_load_display/main.cc index 6b5fce5ac..4b08f7891 100644 --- a/repos/gems/src/app/cpu_load_display/main.cc +++ b/repos/gems/src/app/cpu_load_display/main.cc @@ -99,7 +99,7 @@ class Cpu_load_display::Timeline : public Genode::List::Element bool idle() const { return _sum_activity == 0; } - bool is_kernel() const + bool kernel() const { return _label == Label("kernel"); } @@ -293,7 +293,7 @@ class Cpu_load_display::Scene : public Nano3d::Scene { _trace_subjects.update(); - if (!_trace_subjects.is_valid()) + if (!_trace_subjects.valid()) return; _cpu_registry.advance(++_now); @@ -348,7 +348,7 @@ class Cpu_load_display::Scene : public Nano3d::Scene cpu.for_each_timeline([&] (Timeline const &timeline) { - if (timeline.is_kernel()) + if (timeline.kernel()) return; bool first = true; diff --git a/repos/gems/src/app/decorator/main.cc b/repos/gems/src/app/decorator/main.cc index 49a232b31..0bf077764 100644 --- a/repos/gems/src/app/decorator/main.cc +++ b/repos/gems/src/app/decorator/main.cc @@ -252,7 +252,7 @@ void Decorator::Main::handle_nitpicker_sync(unsigned) bool model_updated = false; - if (window_layout_update_needed && window_layout.is_valid()) { + if (window_layout_update_needed && window_layout.valid()) { try { Xml_node xml(window_layout.local_addr(), @@ -265,7 +265,7 @@ void Decorator::Main::handle_nitpicker_sync(unsigned) * A decorator element might have appeared or disappeared under * the pointer. */ - if (pointer.is_valid()) + if (pointer.valid()) update_hover_report(Xml_node(pointer.local_addr()), window_stack, hover, hover_reporter); @@ -309,7 +309,7 @@ void Decorator::Main::handle_pointer_update(unsigned) { pointer.update(); - if (pointer.is_valid()) + if (pointer.valid()) update_hover_report(Xml_node(pointer.local_addr()), window_stack, hover, hover_reporter); } diff --git a/repos/gems/src/app/decorator/window.h b/repos/gems/src/app/decorator/window.h index 08da789fe..8df1bb7b6 100644 --- a/repos/gems/src/app/decorator/window.h +++ b/repos/gems/src/app/decorator/window.h @@ -434,7 +434,7 @@ class Decorator::Window : public Window_base outer_geometry().cut(geometry(), top, left, right, bottom); } - bool is_in_front_of(Window_base const &neighbor) const override + bool in_front_of(Window_base const &neighbor) const override { return _neighbor == neighbor.frontmost_view(); } diff --git a/repos/gems/src/app/floating_window_layouter/main.cc b/repos/gems/src/app/floating_window_layouter/main.cc index 4638f52cb..5b8bb1648 100644 --- a/repos/gems/src/app/floating_window_layouter/main.cc +++ b/repos/gems/src/app/floating_window_layouter/main.cc @@ -144,7 +144,7 @@ struct Floating_window_layouter::Main : Operations if (!window) return; - window->is_maximized(!window->is_maximized()); + window->maximized(!window->maximized()); generate_resize_request_model(); } @@ -250,7 +250,7 @@ struct Floating_window_layouter::Main : Operations */ void handle_input(unsigned) { - while (input.is_pending()) + while (input.pending()) _user_state.handle_input(input_ds.local_addr(), input.flush(), Genode::config()->xml_node()); } @@ -297,10 +297,10 @@ struct Floating_window_layouter::Main : Operations Reporter focus_reporter = { "focus" }; - bool focused_window_is_maximized() const + bool focused_window_maximized() const { Window const *w = lookup_window_by_id(_user_state.focused_window_id()); - return w && w->is_maximized(); + return w && w->maximized(); } void import_window_list(Xml_node); @@ -376,7 +376,7 @@ void Floating_window_layouter::Main::import_window_list(Xml_node window_list_xml if (policy.has_attribute("xpos") && policy.has_attribute("ypos")) initial_position = point_attribute(node); - win->is_maximized(policy.attribute_value("maximized", false)); + win->maximized(policy.attribute_value("maximized", false)); } catch (Genode::Session_policy::No_policy_defined) { } @@ -387,10 +387,10 @@ void Floating_window_layouter::Main::import_window_list(Xml_node window_list_xml win->title(string_attribute(node, "title", Window::Title(""))); win->has_alpha(node.has_attribute("has_alpha") && node.attribute("has_alpha").has_value("yes")); - win->is_hidden(node.has_attribute("hidden") - && node.attribute("hidden").has_value("yes")); - win->is_resizeable(node.has_attribute("resizeable") - && node.attribute("resizeable").has_value("yes")); + win->hidden(node.has_attribute("hidden") + && node.attribute("hidden").has_value("yes")); + win->resizeable(node.has_attribute("resizeable") + && node.attribute("resizeable").has_value("yes")); } } catch (...) { } } @@ -402,13 +402,13 @@ void Floating_window_layouter::Main::generate_window_layout_model() { for (Window *w = windows.first(); w; w = w->next()) { - bool const is_hovered = w->has_id(_user_state.hover_state().window_id); - bool const is_focused = w->has_id(_user_state.focused_window_id()); + bool const hovered = w->has_id(_user_state.hover_state().window_id); + bool const focused = w->has_id(_user_state.focused_window_id()); Window::Element const highlight = - is_hovered ? _user_state.hover_state().element : Window::Element::UNDEFINED; + hovered ? _user_state.hover_state().element : Window::Element::UNDEFINED; - w->serialize(xml, is_focused, highlight); + w->serialize(xml, focused, highlight); } }); } diff --git a/repos/gems/src/app/floating_window_layouter/user_state.h b/repos/gems/src/app/floating_window_layouter/user_state.h index 9a8b81d4d..829340737 100644 --- a/repos/gems/src/app/floating_window_layouter/user_state.h +++ b/repos/gems/src/app/floating_window_layouter/user_state.h @@ -75,7 +75,7 @@ class Floating_window_layouter::User_state Focus_history &_focus_history; - bool _is_key(Input::Event const &ev) const + bool _key(Input::Event const &ev) const { if (ev.type() != Input::Event::PRESS && ev.type() != Input::Event::RELEASE) @@ -286,7 +286,7 @@ void Floating_window_layouter::User_state::_handle_event(Input::Event const &e, } /* handle key sequences */ - if (_is_key(e)) { + if (_key(e)) { if (e.type() == Input::Event::PRESS && _key_cnt == 1) _key_sequence_tracker.reset(); diff --git a/repos/gems/src/app/floating_window_layouter/window.h b/repos/gems/src/app/floating_window_layouter/window.h index 67ce037cd..2d6210d32 100644 --- a/repos/gems/src/app/floating_window_layouter/window.h +++ b/repos/gems/src/app/floating_window_layouter/window.h @@ -97,13 +97,13 @@ class Floating_window_layouter::Window : public List::Element /** * Window is temporarily not visible */ - bool _is_hidden = false; + bool _hidden = false; - bool _is_resizeable = false; + bool _resizeable = false; - bool _is_maximized = false; + bool _maximized = false; - bool _is_dragged = false; + bool _dragged = false; /* * Number of times the window has been topped. This value is used by @@ -146,7 +146,7 @@ class Floating_window_layouter::Window : public List::Element _requested_size = _geometry.area(); - _is_dragged = true; + _dragged = true; } /** @@ -204,9 +204,9 @@ class Floating_window_layouter::Window : public List::Element void has_alpha(bool has_alpha) { _has_alpha = has_alpha; } - void is_hidden(bool is_hidden) { _is_hidden = is_hidden; } + void hidden(bool hidden) { _hidden = hidden; } - void is_resizeable(bool is_resizeable) { _is_resizeable = is_resizeable; } + void resizeable(bool resizeable) { _resizeable = resizeable; } bool label_matches(Label const &label) const { return label == _label; } @@ -217,7 +217,7 @@ class Floating_window_layouter::Window : public List::Element */ void size(Area size) { - if (_is_maximized) { + if (_maximized) { _geometry = Rect(_maximized_geometry.p1(), size); return; } @@ -251,7 +251,7 @@ class Floating_window_layouter::Window : public List::Element void serialize(Xml_generator &xml, bool focused, Element highlight) { /* omit window from the layout if hidden */ - if (_is_hidden) + if (_hidden) return; xml.node("window", [&]() { @@ -289,7 +289,7 @@ class Floating_window_layouter::Window : public List::Element if (_has_alpha) xml.attribute("has_alpha", "yes"); - if (_is_resizeable) { + if (_resizeable) { xml.attribute("maximizer", "yes"); xml.attribute("closer", "yes"); } @@ -299,10 +299,10 @@ class Floating_window_layouter::Window : public List::Element void drag(Window::Element element, Point clicked, Point curr) { /* prevent maximized windows from being dragged */ - if (is_maximized()) + if (maximized()) return; - if (!_is_dragged) + if (!_dragged) _initiate_drag_operation(element); _apply_drag_operation(curr - clicked); @@ -311,7 +311,7 @@ class Floating_window_layouter::Window : public List::Element void finalize_drag_operation() { _requested_size = _geometry.area(); - _is_dragged = false; + _dragged = false; _drag_left_border = false; _drag_right_border = false; _drag_top_border = false; @@ -322,23 +322,23 @@ class Floating_window_layouter::Window : public List::Element void close() { _requested_size = Area(0, 0); } - bool is_maximized() const { return _is_maximized; } + bool maximized() const { return _maximized; } - void is_maximized(bool is_maximized) + void maximized(bool maximized) { /* enter maximized state */ - if (!_is_maximized && is_maximized) { + if (!_maximized && maximized) { _unmaximized_geometry = _geometry; _requested_size = _maximized_geometry.area(); } /* leave maximized state */ - if (_is_maximized && !is_maximized) { + if (_maximized && !maximized) { _requested_size = _unmaximized_geometry.area(); _geometry = Rect(_unmaximized_geometry.p1(), _geometry.area()); } - _is_maximized = is_maximized; + _maximized = maximized; } }; diff --git a/repos/gems/src/app/launcher/dialog_nitpicker.h b/repos/gems/src/app/launcher/dialog_nitpicker.h index f6f51842f..68ee59249 100644 --- a/repos/gems/src/app/launcher/dialog_nitpicker.h +++ b/repos/gems/src/app/launcher/dialog_nitpicker.h @@ -96,7 +96,7 @@ struct Launcher::Dialog_nitpicker_session : Wrapped_nitpicker_session Input::Event const * const events = _nitpicker_input_ds.local_addr(); - while (_nitpicker_input.is_pending()) { + while (_nitpicker_input.pending()) { size_t const num_events = _nitpicker_input.flush(); for (size_t i = 0; i < num_events; i++) { diff --git a/repos/gems/src/app/launcher/fading_dialog.h b/repos/gems/src/app/launcher/fading_dialog.h index 8e9fe737c..e6f0753fb 100644 --- a/repos/gems/src/app/launcher/fading_dialog.h +++ b/repos/gems/src/app/launcher/fading_dialog.h @@ -103,8 +103,8 @@ class Launcher::Fading_dialog : private Input_event_handler void _handle_hover_update(unsigned) { try { - if (!_hover_ds.is_constructed() || _hover_rom.update() == false) { - if (_hover_ds.is_constructed()) + if (!_hover_ds.constructed() || _hover_rom.update() == false) { + if (_hover_ds.constructed()) _hover_ds->invalidate(); _hover_ds.construct(_hover_rom.dataspace()); } diff --git a/repos/gems/src/app/launcher/panel_dialog.h b/repos/gems/src/app/launcher/panel_dialog.h index 596bfc159..477347340 100644 --- a/repos/gems/src/app/launcher/panel_dialog.h +++ b/repos/gems/src/app/launcher/panel_dialog.h @@ -58,7 +58,7 @@ class Launcher::Panel_dialog : Input_event_handler, Dialog_generator, Element _menu_button { _menu_button_label(), "Menu" }; - bool _is_focused(Element const &e) + bool _focused(Element const &e) { size_t const label_len = strlen(e.label.string()); @@ -93,7 +93,7 @@ class Launcher::Panel_dialog : Input_event_handler, Dialog_generator, || (e.hovered && e.touched)) xml.attribute("hovered", "yes"); - if (e.selected || e.touched || _is_focused(e)) + if (e.selected || e.touched || _focused(e)) xml.attribute("selected", "yes"); xml.node("label", [&] () { @@ -536,7 +536,7 @@ class Launcher::Panel_dialog : Input_event_handler, Dialog_generator, /* find focused element */ Element *e = _elements.first(); - for (; e && !_is_focused(*e); e = e->next()); + for (; e && !_focused(*e); e = e->next()); /* none of our subsystems is focused, start with the first one */ if (!e) diff --git a/repos/gems/src/app/menu_view/main.cc b/repos/gems/src/app/menu_view/main.cc index 92daf60b5..adbfdaade 100644 --- a/repos/gems/src/app/menu_view/main.cc +++ b/repos/gems/src/app/menu_view/main.cc @@ -193,14 +193,14 @@ void Menu_view::Main::handle_input(unsigned) Input::Event ev = ev_buf[i]; - if (ev.is_absolute_motion()) { + if (ev.absolute_motion()) { Point const at = Point(ev.ax(), ev.ay()) - position; Widget::Unique_id const new_hovered = root_widget.hovered(at); if (hovered != new_hovered) { - if (hover_reporter.is_enabled()) { + if (hover_reporter.enabled()) { Genode::Reporter::Xml_generator xml(hover_reporter, [&] () { root_widget.gen_hover_model(xml, at); }); @@ -218,7 +218,7 @@ void Menu_view::Main::handle_input(unsigned) hovered = Widget::Unique_id(); - if (hover_reporter.is_enabled()) { + if (hover_reporter.enabled()) { Genode::Reporter::Xml_generator xml(hover_reporter, [&] () { }); } } @@ -251,10 +251,10 @@ void Menu_view::Main::handle_frame_timer(unsigned) frame_cnt = 0; - Area const old_size = buffer.is_constructed() ? buffer->size() : Area(); + Area const old_size = buffer.constructed() ? buffer->size() : Area(); Area const size = root_widget.min_size(); - if (!buffer.is_constructed() || size != old_size) + if (!buffer.constructed() || size != old_size) buffer.construct(nitpicker, size, *env()->ram_session()); else buffer->reset_surface(); diff --git a/repos/gems/src/app/mixer_gui_qt/main.cpp b/repos/gems/src/app/mixer_gui_qt/main.cpp index 863c675b9..322da6041 100644 --- a/repos/gems/src/app/mixer_gui_qt/main.cpp +++ b/repos/gems/src/app/mixer_gui_qt/main.cpp @@ -45,7 +45,7 @@ struct Report_thread : Genode::Thread_deprecated { channels_rom.update(); - if (channels_rom.is_valid()) + if (channels_rom.valid()) _report(channels_rom.local_addr(), channels_rom.size()); } diff --git a/repos/gems/src/app/themed_decorator/main.cc b/repos/gems/src/app/themed_decorator/main.cc index b8b7be070..5cd637b8c 100644 --- a/repos/gems/src/app/themed_decorator/main.cc +++ b/repos/gems/src/app/themed_decorator/main.cc @@ -131,7 +131,7 @@ struct Decorator::Main : Window_factory_base } catch (Genode::Rom_connection::Rom_connection_failed) { PINF("pointer information unavailable"); - PDBG("is_constructed=%d", pointer.is_constructed()); + PDBG("constructed=%d", pointer.constructed()); } nitpicker.framebuffer()->sync_sigh(nitpicker_sync_dispatcher); @@ -256,7 +256,7 @@ void Decorator::Main::handle_nitpicker_sync(unsigned) bool model_updated = false; - if (window_layout_update_needed && window_layout.is_valid()) { + if (window_layout_update_needed && window_layout.valid()) { try { Xml_node xml(window_layout.local_addr(), @@ -269,7 +269,7 @@ void Decorator::Main::handle_nitpicker_sync(unsigned) * A decorator element might have appeared or disappeared under * the pointer. */ - if (pointer.is_constructed() && pointer->is_valid()) + if (pointer.constructed() && pointer->valid()) update_hover_report(Xml_node(pointer->local_addr()), window_stack, hover, hover_reporter); @@ -304,12 +304,12 @@ void Decorator::Main::handle_nitpicker_sync(unsigned) void Decorator::Main::handle_pointer_update(unsigned) { - if (!pointer.is_constructed()) + if (!pointer.constructed()) return; pointer->update(); - if (pointer->is_valid()) + if (pointer->valid()) update_hover_report(Xml_node(pointer->local_addr()), window_stack, hover, hover_reporter); } diff --git a/repos/gems/src/app/themed_decorator/window.h b/repos/gems/src/app/themed_decorator/window.h index 5c82e22e1..402d48e85 100644 --- a/repos/gems/src/app/themed_decorator/window.h +++ b/repos/gems/src/app/themed_decorator/window.h @@ -371,7 +371,7 @@ class Decorator::Window : public Window_base, public Animator::Item outer_geometry().cut(geometry(), top, left, right, bottom); } - bool is_in_front_of(Window_base const &neighbor) const override + bool in_front_of(Window_base const &neighbor) const override { return _neighbor == neighbor.frontmost_view(); } diff --git a/repos/gems/src/server/nit_fader/main.cc b/repos/gems/src/server/nit_fader/main.cc index 31763117f..84c3b4dcd 100644 --- a/repos/gems/src/server/nit_fader/main.cc +++ b/repos/gems/src/server/nit_fader/main.cc @@ -163,7 +163,7 @@ class Nit_fader::Framebuffer_session_component void transfer_src_to_dst_pixel(Rect const rect) { - if (!_dst_buffer.is_constructed()) + if (!_dst_buffer.constructed()) return; _dst_buffer->pixel_surface().clip(rect); @@ -178,7 +178,7 @@ class Nit_fader::Framebuffer_session_component void transfer_src_to_dst_alpha(Rect const rect) { - if (!_dst_buffer.is_constructed()) + if (!_dst_buffer.constructed()) return; _dst_buffer->alpha_surface().clip(rect); @@ -193,8 +193,8 @@ class Nit_fader::Framebuffer_session_component Area size() { - return _dst_buffer.is_constructed() ? _dst_buffer->pixel_surface().size() - : Area(); + return _dst_buffer.constructed() ? _dst_buffer->pixel_surface().size() + : Area(); } bool animate(unsigned num_frames) diff --git a/repos/gems/src/server/terminal/main.cc b/repos/gems/src/server/terminal/main.cc index 5151b3835..4242f3d6f 100644 --- a/repos/gems/src/server/terminal/main.cc +++ b/repos/gems/src/server/terminal/main.cc @@ -610,7 +610,7 @@ int main(int, char **) flush_callback_registry.flush(); - while (!input.is_pending()) { + while (!input.pending()) { enum { PASSED_MSECS = 10 }; timer.msleep(PASSED_MSECS); diff --git a/repos/gems/src/server/terminal_mux/main.cc b/repos/gems/src/server/terminal_mux/main.cc index 9c1dc3f23..2298b7af1 100644 --- a/repos/gems/src/server/terminal_mux/main.cc +++ b/repos/gems/src/server/terminal_mux/main.cc @@ -139,7 +139,7 @@ struct Registry _list.insert(entry); } - bool is_first(Entry const *entry) + bool first(Entry const *entry) { return _list.first() == entry; } @@ -450,52 +450,54 @@ class Menu : public Registry::Entry */ struct Seq_tracker { - enum State { INIT, GOT_ESC, GOT_FIRST } state; - char normal, first, second; - bool sequence_complete; + enum State { INIT, GOT_ESC, GOT_FIRST } _state; + char _normal, _first, _second; + bool _sequence_complete; - Seq_tracker() : state(INIT), sequence_complete(false) { } + Seq_tracker() : _state(INIT), _sequence_complete(false) { } void input(char c) { - switch (state) { + switch (_state) { case INIT: if (c == 27) - state = GOT_ESC; + _state = GOT_ESC; else - normal = c; - sequence_complete = false; + _normal = c; + _sequence_complete = false; break; case GOT_ESC: - first = c; - state = GOT_FIRST; + _first = c; + _state = GOT_FIRST; break; case GOT_FIRST: - second = c; - state = INIT; - sequence_complete = true; + _second = c; + _state = INIT; + _sequence_complete = true; break; } } - bool is_normal() const { return state == INIT && !sequence_complete; } + bool normal() const { return _state == INIT && !_sequence_complete; } - bool _is_normal(char c) const { return is_normal() && normal == c; } + char normal_char() const { return _normal; } + + bool _normal_matches(char c) const { return normal() && _normal == c; } bool _fn_complete(char match_first, char match_second) const { - return sequence_complete - && first == match_first - && second == match_second; + return _sequence_complete + && _first == match_first + && _second == match_second; } - bool is_key_up() const { - return _fn_complete(91, 65) || _is_normal('k'); } + bool key_up() const { + return _fn_complete(91, 65) || _normal_matches('k'); } - bool is_key_down() const { - return _fn_complete(91, 66) || _is_normal('j'); } + bool key_down() const { + return _fn_complete(91, 66) || _normal_matches('j'); } }; Seq_tracker _seq_tracker; @@ -559,13 +561,13 @@ class Menu : public Registry::Entry { _seq_tracker.input(c); - if (_seq_tracker.is_key_up()) { + if (_seq_tracker.key_up()) { if (_selected_idx > 0) _selected_idx--; flush_all(); } - if (_seq_tracker.is_key_down()) { + if (_seq_tracker.key_down()) { if (_selected_idx < _max_idx) _selected_idx++; flush_all(); @@ -574,7 +576,7 @@ class Menu : public Registry::Entry /* * Detect selection of menu entry via [enter] */ - if (_seq_tracker.is_normal() && _seq_tracker.normal == 13) { + if (_seq_tracker.normal() && _seq_tracker.normal_char() == 13) { Entry *entry = _registry.entry_at(_selected_idx + 1); if (entry) { @@ -618,7 +620,7 @@ Session_manager::Session_manager(Ncurses &ncurses, Registry ®istry, void Session_manager::_refresh_menu() { - if (_registry.is_first(&_menu)) + if (_registry.first(&_menu)) activate_menu(); } diff --git a/repos/gems/src/server/wm/decorator_nitpicker.h b/repos/gems/src/server/wm/decorator_nitpicker.h index 94886f94b..32e2120a2 100644 --- a/repos/gems/src/server/wm/decorator_nitpicker.h +++ b/repos/gems/src/server/wm/decorator_nitpicker.h @@ -135,7 +135,7 @@ class Wm::Decorator_content_registry return _lookup(view_handle).win_id; } - bool is_registered(Nitpicker::Session::View_handle view_handle) const + bool registered(Nitpicker::Session::View_handle view_handle) const { try { lookup(view_handle); return true; } catch (...) { } return false; @@ -220,7 +220,7 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object, Input::Event const * const events = _nitpicker_input_ds.local_addr(); - while (_nitpicker_input.is_pending()) { + while (_nitpicker_input.pending()) { size_t const num_events = _nitpicker_input.flush(); @@ -394,7 +394,7 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object, /* * Reset view geometry when destroying a content view */ - if (_content_registry.is_registered(view)) { + if (_content_registry.registered(view)) { Nitpicker::Rect rect(Nitpicker::Point(0, 0), Nitpicker::Area(0, 0)); _nitpicker_session.enqueue(view, rect); _nitpicker_session.execute(); diff --git a/repos/gems/src/server/wm/main.cc b/repos/gems/src/server/wm/main.cc index be653892e..5a2bfc90d 100644 --- a/repos/gems/src/server/wm/main.cc +++ b/repos/gems/src/server/wm/main.cc @@ -70,7 +70,7 @@ struct Wm::Main { try { focus_rom.update(); - if (!focus_rom.is_valid()) + if (!focus_rom.valid()) return; unsigned long win_id = 0; @@ -96,7 +96,7 @@ struct Wm::Main { try { resize_request_rom.update(); - if (!resize_request_rom.is_valid()) + if (!resize_request_rom.valid()) return; char const * const node_type = "window"; @@ -113,7 +113,7 @@ struct Wm::Main nitpicker_root.request_resize(win_id, Area(width, height)); - if (window.is_last(node_type)) + if (window.last(node_type)) break; window = window.next(node_type); diff --git a/repos/gems/src/server/wm/nitpicker.h b/repos/gems/src/server/wm/nitpicker.h index f86b9def3..9935e8425 100644 --- a/repos/gems/src/server/wm/nitpicker.h +++ b/repos/gems/src/server/wm/nitpicker.h @@ -140,7 +140,7 @@ class Wm::Nitpicker::View : public Genode::Weak_object, View_handle real_neighbor_handle; Locked_ptr neighbor(_neighbor_ptr); - if (neighbor.is_valid()) + if (neighbor.valid()) real_neighbor_handle = _real_nitpicker.view_handle(neighbor->real_view_cap()); if (_neighbor_behind) @@ -321,7 +321,7 @@ class Wm::Nitpicker::Top_level_view : public View, return _real_nitpicker.view_capability(_real_handle); } - void is_hidden(bool is_hidden) { _window_registry.is_hidden(_win_id, is_hidden); } + void hidden(bool hidden) { _window_registry.hidden(_win_id, hidden); } void resizeable(bool resizeable) { @@ -373,13 +373,13 @@ class Wm::Nitpicker::Child_view : public View, bool belongs_to_win_id(Window_registry::Id id) const override { Locked_ptr parent(_parent); - return parent.is_valid() && parent->belongs_to_win_id(id); + return parent.valid() && parent->belongs_to_win_id(id); } Point input_anchor_position() const override { Locked_ptr parent(_parent); - if (parent.is_valid()) + if (parent.valid()) return parent->input_anchor_position(); return Point(); @@ -391,7 +391,7 @@ class Wm::Nitpicker::Child_view : public View, return; Locked_ptr parent(_parent); - if (!parent.is_valid()) + if (!parent.valid()) return; View_handle parent_handle = _real_nitpicker.view_handle(parent->real_view_cap()); @@ -514,7 +514,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object, return Input::Event(); } - bool _is_click_into_unfocused_view(Input::Event const ev) + bool _click_into_unfocused_view(Input::Event const ev) { /* * XXX check if unfocused @@ -537,7 +537,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object, Input::Event const * const events = _nitpicker_input_ds.local_addr(); - while (_nitpicker_input.is_pending()) { + while (_nitpicker_input.pending()) { size_t const num_events = _nitpicker_input.flush(); @@ -548,7 +548,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object, Input::Event const ev = events[i]; /* propagate layout-affecting events to the layouter */ - if (_is_click_into_unfocused_view(ev)) + if (_click_into_unfocused_view(ev)) _click_handler.handle_click(Point(ev.ax(), ev.ay())); /* @@ -629,7 +629,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object, case Command::OP_GEOMETRY: { Locked_ptr view(_view_handle_registry.lookup(command.geometry.view)); - if (view.is_valid()) + if (view.valid()) view->geometry(command.geometry.rect); return; } @@ -637,7 +637,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object, case Command::OP_OFFSET: { Locked_ptr view(_view_handle_registry.lookup(command.offset.view)); - if (view.is_valid()) + if (view.valid()) view->buffer_offset(command.offset.offset); return; @@ -646,7 +646,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object, case Command::OP_TO_FRONT: { Locked_ptr view(_view_handle_registry.lookup(command.to_front.view)); - if (!view.is_valid()) + if (!view.valid()) return; /* bring to front if no neighbor is specified */ @@ -683,7 +683,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object, *c = '\''; Locked_ptr view(_view_handle_registry.lookup(command.title.view)); - if (view.is_valid()) + if (view.valid()) view->title(sanitized_title); return; @@ -808,10 +808,10 @@ class Wm::Nitpicker::Session_component : public Rpc_object, Signal_transmitter(_mode_sigh).submit(); } - void is_hidden(bool is_hidden) + void hidden(bool hidden) { for (Top_level_view *v = _top_level_views.first(); v; v = v->next()) - v->is_hidden(is_hidden); + v->hidden(hidden); } /** @@ -849,7 +849,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object, { try { Locked_ptr view(_view_handle_registry.lookup(handle)); - if (view.is_valid()) + if (view.valid()) _destroy_view_object(*view); } catch (View_handle_registry::Lookup_failed) { } @@ -868,7 +868,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object, { Locked_ptr view(_view_handle_registry.lookup(handle)); - return view.is_valid() ? view->cap() : View_capability(); + return view.valid() ? view->cap() : View_capability(); } void release_view_handle(View_handle handle) override @@ -1182,7 +1182,7 @@ class Wm::Nitpicker::Root : public Genode::Rpc_objectis_hidden(false); + s->hidden(false); break; case Session::SESSION_CONTROL_HIDE: - s->is_hidden(true); + s->hidden(true); break; case Session::SESSION_CONTROL_TO_FRONT: diff --git a/repos/gems/src/server/wm/window_registry.h b/repos/gems/src/server/wm/window_registry.h index 5f124871f..20be0fd27 100644 --- a/repos/gems/src/server/wm/window_registry.h +++ b/repos/gems/src/server/wm/window_registry.h @@ -66,7 +66,7 @@ class Wm::Window_registry enum Has_alpha { HAS_ALPHA, HAS_NO_ALPHA }; - enum Is_hidden { IS_HIDDEN, IS_NOT_HIDDEN }; + enum Hidden { HIDDEN, NOT_HIDDEN }; enum Resizeable { RESIZEABLE, NOT_RESIZEABLE }; @@ -80,7 +80,7 @@ class Wm::Window_registry Session_label label; Area size; Has_alpha has_alpha = HAS_NO_ALPHA; - Is_hidden is_hidden = IS_NOT_HIDDEN; + Hidden hidden = NOT_HIDDEN; Resizeable resizeable = NOT_RESIZEABLE; bool operator == (Attr const &other) const @@ -89,7 +89,7 @@ class Wm::Window_registry && label == other.label && size == other.size && has_alpha == other.has_alpha - && is_hidden == other.is_hidden + && hidden == other.hidden && resizeable == other.resizeable; } }; @@ -112,10 +112,10 @@ class Wm::Window_registry void attr(Session_label const &label) { _attr.label = label; } void attr(Area size) { _attr.size = size; } void attr(Has_alpha has_alpha) { _attr.has_alpha = has_alpha; } - void attr(Is_hidden is_hidden) { _attr.is_hidden = is_hidden; } + void attr(Hidden hidden) { _attr.hidden = hidden; } void attr(Resizeable resizeable) { _attr.resizeable = resizeable; } - bool is_flushed() const { return _attr == _flushed_attr; } + bool flushed() const { return _attr == _flushed_attr; } void generate_window_list_entry_xml(Xml_generator &xml) const { @@ -137,7 +137,7 @@ class Wm::Window_registry if (_attr.has_alpha == HAS_ALPHA) xml.attribute("has_alpha", "yes"); - if (_attr.is_hidden == IS_HIDDEN) + if (_attr.hidden == HIDDEN) xml.attribute("hidden", "yes"); if (_attr.resizeable == RESIZEABLE) @@ -148,11 +148,11 @@ class Wm::Window_registry void mark_as_flushed() const { _flushed_attr = _attr; } }; - bool _is_flushed() const + bool _flushed() const { bool result = true; for (Window const *w = _windows.first(); w; w = w->next()) - result &= w->is_flushed(); + result &= w->flushed(); return result; } @@ -253,9 +253,9 @@ class Wm::Window_registry _set_attr(id, has_alpha ? Window::HAS_ALPHA : Window::HAS_NO_ALPHA); } - void is_hidden(Id id, bool is_hidden) + void hidden(Id id, bool hidden) { - _set_attr(id, is_hidden ? Window::IS_HIDDEN : Window::IS_NOT_HIDDEN); + _set_attr(id, hidden ? Window::HIDDEN : Window::NOT_HIDDEN); } void resizeable(Id id, bool resizeable) @@ -265,7 +265,7 @@ class Wm::Window_registry void flush() { - if (_is_flushed()) + if (_flushed()) return; _report_updated_window_list_model(); diff --git a/repos/gems/src/test/terminal_decoder/main.cc b/repos/gems/src/test/terminal_decoder/main.cc index 149b83877..0e2a9bc29 100644 --- a/repos/gems/src/test/terminal_decoder/main.cc +++ b/repos/gems/src/test/terminal_decoder/main.cc @@ -246,7 +246,7 @@ void Static_character_screen::dump() const for (int x = 0; x < boundary.width; x++) { Character c = _char_array.get(Position(x, y)); - if (c.is_valid()) + if (c.valid()) line[x] = c.ascii(); else line[x] = ' '; diff --git a/repos/libports/src/app/mupdf/main.cc b/repos/libports/src/app/mupdf/main.cc index 502c19c61..77a7d5d25 100644 --- a/repos/libports/src/app/mupdf/main.cc +++ b/repos/libports/src/app/mupdf/main.cc @@ -318,7 +318,7 @@ int main(int, char **) * Input event loop */ for (;;) { - while (!input.is_pending()) timer.msleep(20); + while (!input.pending()) timer.msleep(20); for (int i = 0, num_ev = input.flush(); i < num_ev; i++) { diff --git a/repos/libports/src/lib/libc/fd_alloc.cc b/repos/libports/src/lib/libc/fd_alloc.cc index de17c5174..711f438eb 100644 --- a/repos/libports/src/lib/libc/fd_alloc.cc +++ b/repos/libports/src/lib/libc/fd_alloc.cc @@ -59,7 +59,7 @@ File_descriptor *File_descriptor_allocator::alloc(Plugin *plugin, if (libc_fd <= ANY_FD) alloc_ok = Allocator_avl_base::alloc(1, reinterpret_cast(&addr)); else - alloc_ok = (Allocator_avl_base::alloc_addr(1, addr).is_ok()); + alloc_ok = (Allocator_avl_base::alloc_addr(1, addr).ok()); if (!alloc_ok) { PERR("could not allocate libc_fd %d%s", diff --git a/repos/libports/src/lib/libc/file_operations.cc b/repos/libports/src/lib/libc/file_operations.cc index a1f95a4c6..aafe14dd9 100644 --- a/repos/libports/src/lib/libc/file_operations.cc +++ b/repos/libports/src/lib/libc/file_operations.cc @@ -462,7 +462,7 @@ extern "C" void *mmap(void *addr, ::size_t length, int prot, int flags, extern "C" int munmap(void *start, ::size_t length) { - if (!mmap_registry()->is_registered(start)) { + if (!mmap_registry()->registered(start)) { PWRN("munmap: could not lookup plugin for address %p", start); errno = EINVAL; return -1; diff --git a/repos/libports/src/lib/libc/libc_mem_alloc.cc b/repos/libports/src/lib/libc/libc_mem_alloc.cc index 676105a9a..f4900af84 100644 --- a/repos/libports/src/lib/libc/libc_mem_alloc.cc +++ b/repos/libports/src/lib/libc/libc_mem_alloc.cc @@ -65,7 +65,7 @@ int Libc::Mem_alloc_impl::Dataspace_pool::expand(size_t size, Range_allocator *a alloc->add_range((addr_t)local_addr, size); /* now that we have new backing store, allocate Dataspace structure */ - if (alloc->alloc_aligned(sizeof(Dataspace), &ds_addr, 2).is_error()) { + if (alloc->alloc_aligned(sizeof(Dataspace), &ds_addr, 2).error()) { PWRN("could not allocate meta data - this should never happen"); return -1; } @@ -85,7 +85,7 @@ void *Libc::Mem_alloc_impl::alloc(size_t size, size_t align_log2) /* try allocation at our local allocator */ void *out_addr = 0; - if (_alloc.alloc_aligned(size, &out_addr, align_log2).is_ok()) + if (_alloc.alloc_aligned(size, &out_addr, align_log2).ok()) return out_addr; /* @@ -112,7 +112,7 @@ void *Libc::Mem_alloc_impl::alloc(size_t size, size_t align_log2) } /* allocate originally requested block */ - return _alloc.alloc_aligned(size, &out_addr, align_log2).is_ok() ? out_addr : 0; + return _alloc.alloc_aligned(size, &out_addr, align_log2).ok() ? out_addr : 0; } diff --git a/repos/libports/src/lib/libc/libc_mmap_registry.h b/repos/libports/src/lib/libc/libc_mmap_registry.h index 44cf55200..7c2460b9c 100644 --- a/repos/libports/src/lib/libc/libc_mmap_registry.h +++ b/repos/libports/src/lib/libc/libc_mmap_registry.h @@ -93,7 +93,7 @@ class Libc::Mmap_registry return e ? e->plugin : 0; } - bool is_registered(void *start) const + bool registered(void *start) const { Genode::Lock::Guard guard(_lock); diff --git a/repos/libports/src/lib/libc/vfs_plugin.cc b/repos/libports/src/lib/libc/vfs_plugin.cc index 4cb3db66e..571b1ecf5 100644 --- a/repos/libports/src/lib/libc/vfs_plugin.cc +++ b/repos/libports/src/lib/libc/vfs_plugin.cc @@ -781,8 +781,8 @@ int Libc::Vfs_plugin::rename(char const *from_path, char const *to_path) if (_root_dir.leaf_path(to_path)) { - if (_root_dir.is_directory(to_path)) { - if (!_root_dir.is_directory(from_path)) { + if (_root_dir.directory(to_path)) { + if (!_root_dir.directory(from_path)) { errno = EISDIR; return -1; } @@ -791,7 +791,7 @@ int Libc::Vfs_plugin::rename(char const *from_path, char const *to_path) } } else { - if (_root_dir.is_directory(from_path)) { + if (_root_dir.directory(from_path)) { errno = ENOTDIR; return -1; } } diff --git a/repos/libports/src/lib/libc_pipe/plugin.cc b/repos/libports/src/lib/libc_pipe/plugin.cc index e112affd3..d04b82d11 100644 --- a/repos/libports/src/lib/libc_pipe/plugin.cc +++ b/repos/libports/src/lib/libc_pipe/plugin.cc @@ -118,13 +118,13 @@ namespace Libc_pipe { } - static inline bool is_read_end(Libc::File_descriptor *fdo) + static inline bool read_end(Libc::File_descriptor *fdo) { return (context(fdo)->type() == READ_END); } - static inline bool is_write_end(Libc::File_descriptor *fdo) + static inline bool write_end(Libc::File_descriptor *fdo) { return (context(fdo)->type() == WRITE_END); } @@ -239,7 +239,7 @@ namespace Libc_pipe { case F_GETFL: - if (is_write_end(pipefdo)) + if (write_end(pipefdo)) return O_WRONLY; else return O_RDONLY; @@ -285,7 +285,7 @@ namespace Libc_pipe { ssize_t Plugin::read(Libc::File_descriptor *fdo, void *buf, ::size_t count) { - if (!is_read_end(fdo)) { + if (!read_end(fdo)) { PERR("Cannot read from write end of pipe."); errno = EBADF; return -1; @@ -346,14 +346,14 @@ namespace Libc_pipe { continue; if (FD_ISSET(libc_fd, &in_readfds) && - is_read_end(fdo) && + read_end(fdo) && !context(fdo)->buffer()->empty()) { FD_SET(libc_fd, readfds); nready++; } if (FD_ISSET(libc_fd, &in_writefds) && - is_write_end(fdo) && + write_end(fdo) && (context(fdo)->buffer()->avail_capacity() > 0)) { FD_SET(libc_fd, writefds); nready++; @@ -366,7 +366,7 @@ namespace Libc_pipe { ssize_t Plugin::write(Libc::File_descriptor *fdo, const void *buf, ::size_t count) { - if (!is_write_end(fdo)) { + if (!write_end(fdo)) { PERR("Cannot write into read end of pipe."); errno = EBADF; return -1; diff --git a/repos/libports/src/lib/qemu-usb/host.cc b/repos/libports/src/lib/qemu-usb/host.cc index b124613f4..6255b6b73 100644 --- a/repos/libports/src/lib/qemu-usb/host.cc +++ b/repos/libports/src/lib/qemu-usb/host.cc @@ -574,7 +574,7 @@ struct Usb_devices : List _garbage_collect(); _devices_rom.update(); - if (!_devices_rom.is_valid()) + if (!_devices_rom.valid()) return; if (verbose_devices) diff --git a/repos/libports/src/lib/qt5/qtbase/src/plugins/platforms/nitpicker/qgenodeclipboard.cpp b/repos/libports/src/lib/qt5/qtbase/src/plugins/platforms/nitpicker/qgenodeclipboard.cpp index 3ae13a2d2..79e84c6a2 100644 --- a/repos/libports/src/lib/qt5/qtbase/src/plugins/platforms/nitpicker/qgenodeclipboard.cpp +++ b/repos/libports/src/lib/qt5/qtbase/src/plugins/platforms/nitpicker/qgenodeclipboard.cpp @@ -78,7 +78,7 @@ QMimeData *QGenodeClipboard::mimeData(QClipboard::Mode mode) _clipboard_ds->update(); - if (!_clipboard_ds->is_valid()) { + if (!_clipboard_ds->valid()) { if (verbose) PERR("invalid clipboard dataspace"); return 0; diff --git a/repos/libports/src/lib/sdl/video/SDL_genode_fb_events.cc b/repos/libports/src/lib/sdl/video/SDL_genode_fb_events.cc index cecf9bca8..004c056a7 100644 --- a/repos/libports/src/lib/sdl/video/SDL_genode_fb_events.cc +++ b/repos/libports/src/lib/sdl/video/SDL_genode_fb_events.cc @@ -59,7 +59,7 @@ extern "C" { void Genode_Fb_PumpEvents(SDL_VideoDevice *t) { - if (!input->is_pending()) + if (!input->pending()) return; int num_ev = input->flush(); for (int src_ev_cnt = 0; src_ev_cnt < num_ev; src_ev_cnt++) @@ -69,7 +69,7 @@ extern "C" { switch(curr.type()) { case Input::Event::MOTION: - if (curr.is_absolute_motion()) + if (curr.absolute_motion()) SDL_PrivateMouseMotion(0, 0, curr.ax(), curr.ay()); else SDL_PrivateMouseMotion(0, 1, curr.rx(), curr.ry()); diff --git a/repos/libports/src/server/ffat_fs/util.h b/repos/libports/src/server/ffat_fs/util.h index d28ad4f0b..36f7c1c42 100644 --- a/repos/libports/src/server/ffat_fs/util.h +++ b/repos/libports/src/server/ffat_fs/util.h @@ -13,34 +13,6 @@ #include -/** - * Return base-name portion of null-terminated path string - */ -static inline char const *basename(char const *path) -{ - char const *start = path; - - for (; *path; path++) - if (*path == '/') - start = path + 1; - - return start; -} - - -/** - * Return true if specified path is a base name (contains no path delimiters) - */ -static inline bool is_basename(char const *path) -{ - for (; *path; path++) - if (*path == '/') - return false; - - return true; -} - - /** * Return true if null-terminated string 'substr' occurs in null-terminated * string 'str' diff --git a/repos/libports/src/server/fuse_fs/fuse_fs_main.cc b/repos/libports/src/server/fuse_fs/fuse_fs_main.cc index c24af3234..1ccd0494f 100644 --- a/repos/libports/src/server/fuse_fs/fuse_fs_main.cc +++ b/repos/libports/src/server/fuse_fs/fuse_fs_main.cc @@ -248,7 +248,7 @@ class File_system::Session_component : public Session_rpc_object if (create && !_writeable) throw Permission_denied(); - if (!path.is_valid_string()) + if (!path.valid_string()) throw Name_too_long(); Directory *dir_node = new (&_md_alloc) Directory(_md_alloc, path_str, create); diff --git a/repos/libports/src/server/fuse_fs/util.h b/repos/libports/src/server/fuse_fs/util.h index d28ad4f0b..62206b483 100644 --- a/repos/libports/src/server/fuse_fs/util.h +++ b/repos/libports/src/server/fuse_fs/util.h @@ -28,19 +28,6 @@ static inline char const *basename(char const *path) } -/** - * Return true if specified path is a base name (contains no path delimiters) - */ -static inline bool is_basename(char const *path) -{ - for (; *path; path++) - if (*path == '/') - return false; - - return true; -} - - /** * Return true if null-terminated string 'substr' occurs in null-terminated * string 'str' diff --git a/repos/os/include/decorator/window.h b/repos/os/include/decorator/window.h index 4b941c703..717d7f97a 100644 --- a/repos/os/include/decorator/window.h +++ b/repos/os/include/decorator/window.h @@ -112,7 +112,7 @@ class Decorator::Window_base : public Window_list::Element virtual Nitpicker::Session::View_handle frontmost_view() const = 0; - virtual bool is_in_front_of(Window_base const &neighbor) const = 0; + virtual bool in_front_of(Window_base const &neighbor) const = 0; /** * Draw window elements diff --git a/repos/os/include/decorator/window_stack.h b/repos/os/include/decorator/window_stack.h index 5a52c2715..d324d6452 100644 --- a/repos/os/include/decorator/window_stack.h +++ b/repos/os/include/decorator/window_stack.h @@ -55,7 +55,7 @@ class Decorator::Window_stack : public Window_base::Draw_behind_fn if (node.has_type("window") && attribute(node, "id", 0UL) == id) return node; - if (node.is_last()) break; + if (node.last()) break; } throw Xml_node::Nonexistent_sub_node(); @@ -329,7 +329,7 @@ void Decorator::Window_stack::update_model(Genode::Xml_node root_node) _windows.insert(w); /* propagate change stacking order to nitpicker */ - if (w->is_in_front_of(*neighbor)) + if (w->in_front_of(*neighbor)) continue; w->stack(neighbor->frontmost_view()); diff --git a/repos/os/include/decorator/xml_utils.h b/repos/os/include/decorator/xml_utils.h index 05935f5e3..16ec7b6fe 100644 --- a/repos/os/include/decorator/xml_utils.h +++ b/repos/os/include/decorator/xml_utils.h @@ -119,7 +119,7 @@ Decorator::for_each_sub_node(Genode::Xml_node node, char const *type, if (node.has_type(type)) func(node); - if (node.is_last()) break; + if (node.last()) break; } } diff --git a/repos/os/include/file_system/util.h b/repos/os/include/file_system/util.h index 965dec6be..435f5a470 100644 --- a/repos/os/include/file_system/util.h +++ b/repos/os/include/file_system/util.h @@ -39,15 +39,26 @@ namespace File_system { /** - * Return true if specified path is a base name (contains no path delimiters) + * Return true if specified path contains at least path delimiters */ - static inline bool is_basename(char const *path) + static inline bool contains_path_delimiter(char const *path) { for (; *path; path++) if (*path == '/') - return false; + return true; - return true; + return false; + } + + + /** + * Return true if specified path is a base name (contains no path delimiters) + * + * \deprecated use !contains_path_delimiter instead + */ + static inline bool is_basename(char const *path) + { + return !contains_path_delimiter(path); } diff --git a/repos/os/include/file_system_session/file_system_session.h b/repos/os/include/file_system_session/file_system_session.h index 493ced913..9ab4b6647 100644 --- a/repos/os/include/file_system_session/file_system_session.h +++ b/repos/os/include/file_system_session/file_system_session.h @@ -187,8 +187,29 @@ struct File_system::Status unsigned mode; unsigned long inode; - bool is_directory() const { return mode & MODE_DIRECTORY; } - bool is_symlink() const { return mode & MODE_SYMLINK; } + /** + * Return true if node is a directory + */ + bool directory() const { return mode & MODE_DIRECTORY; } + + /** + * Return true if node is a symbolic link + */ + bool symlink() const { return mode & MODE_SYMLINK; } + + /** + * Return true if node is a directory + * + * \deprecated use 'directory' instead + */ + bool is_directory() const { return directory(); } + + /** + * Return true if node is a symbolic link + * + * \deprecated use 'symlink' instead + */ + bool is_symlink() const { return symlink(); } }; diff --git a/repos/os/include/gpio/config.h b/repos/os/include/gpio/config.h index 8482cca60..a07cf11b2 100644 --- a/repos/os/include/gpio/config.h +++ b/repos/os/include/gpio/config.h @@ -69,7 +69,7 @@ void Gpio::process_config(Gpio::Driver &driver) } catch(Gpio::Invalid_gpio_number) { PWRN("Invalid GPIO number %d. Ignore node", num); } - if (gpio_node.is_last("gpio")) break; + if (gpio_node.last("gpio")) break; } } catch (Genode::Xml_node::Nonexistent_sub_node) { diff --git a/repos/os/include/init/child.h b/repos/os/include/init/child.h index e05d40272..ee186837c 100644 --- a/repos/os/include/init/child.h +++ b/repos/os/include/init/child.h @@ -342,7 +342,7 @@ struct Init::Name_registry * * \return false if name already exists */ - virtual bool is_unique(const char *name) const = 0; + virtual bool unique(const char *name) const = 0; /** * Find server with specified name @@ -397,7 +397,7 @@ class Init::Child : Genode::Child_policy throw; } /* check for a name confict with the other children */ - if (!registry.is_unique(unique)) { + if (!registry.unique(unique)) { PERR("Child name \"%s\" is not unique", unique); throw Child_name_is_not_unique(); } @@ -720,7 +720,7 @@ class Init::Child : Genode::Child_policy } } - if (target.is_last()) + if (target.last()) break; } } diff --git a/repos/os/include/input/component.h b/repos/os/include/input/component.h index 6efe2d74e..7ec583e2e 100644 --- a/repos/os/include/input/component.h +++ b/repos/os/include/input/component.h @@ -61,7 +61,12 @@ class Input::Session_component : public Genode::Rpc_object Genode::Dataspace_capability dataspace() override { return _ds.cap(); } - bool is_pending() const override { return !_event_queue.empty(); } + bool pending() const override { return !_event_queue.empty(); } + + /* + * \deprecated use 'pending' instead + */ + bool is_pending() const { return pending(); } int flush() override { diff --git a/repos/os/include/input/event.h b/repos/os/include/input/event.h index 05562d001..4dcd2d2c1 100644 --- a/repos/os/include/input/event.h +++ b/repos/os/include/input/event.h @@ -75,9 +75,16 @@ class Input::Event return _type == PRESS || _type == RELEASE ? (Keycode)_code : KEY_UNKNOWN; } - bool is_absolute_motion() const { return _type == MOTION && !_rx && !_ry; } - bool is_relative_motion() const { return _type == MOTION && (_rx || _ry); } - bool is_touch_release() const { return _type == TOUCH && (_rx == -1) && (_ry == -1); } + bool absolute_motion() const { return _type == MOTION && !_rx && !_ry; } + bool relative_motion() const { return _type == MOTION && (_rx || _ry); } + bool touch_release() const { return _type == TOUCH && (_rx == -1) && (_ry == -1); } + + /* + * \deprecated use methods without the 'is_' prefix instead + */ + bool is_absolute_motion() const { return absolute_motion(); } + bool is_relative_motion() const { return relative_motion(); } + bool is_touch_release() const { return touch_release(); } static Event create_touch_event(int ax, int ay, int id, bool last = false) { diff --git a/repos/os/include/input_session/client.h b/repos/os/include/input_session/client.h index 2c69a56bc..1f5d4a479 100644 --- a/repos/os/include/input_session/client.h +++ b/repos/os/include/input_session/client.h @@ -28,8 +28,8 @@ struct Input::Session_client : Genode::Rpc_client Genode::Dataspace_capability dataspace() override { return call(); } - bool is_pending() const override { - return call(); } + bool pending() const override { + return call(); } int flush() override { return call(); } diff --git a/repos/os/include/input_session/input_session.h b/repos/os/include/input_session/input_session.h index 0dffd7e44..1eaad0e9d 100644 --- a/repos/os/include/input_session/input_session.h +++ b/repos/os/include/input_session/input_session.h @@ -38,7 +38,15 @@ struct Input::Session : Genode::Session * * \return true if new events are available */ - virtual bool is_pending() const = 0; + virtual bool pending() const = 0; + + /** + * Request input state + * + * \noapi + * \deprecated use 'pending' instead + */ + bool is_pending() const { return pending(); } /** * Flush pending events to event buffer @@ -58,11 +66,11 @@ struct Input::Session : Genode::Session *********************/ GENODE_RPC(Rpc_dataspace, Genode::Dataspace_capability, dataspace); - GENODE_RPC(Rpc_is_pending, bool, is_pending); + GENODE_RPC(Rpc_pending, bool, pending); GENODE_RPC(Rpc_flush, int, flush); GENODE_RPC(Rpc_sigh, void, sigh, Genode::Signal_context_capability); - GENODE_RPC_INTERFACE(Rpc_dataspace, Rpc_is_pending, Rpc_flush, Rpc_sigh); + GENODE_RPC_INTERFACE(Rpc_dataspace, Rpc_pending, Rpc_flush, Rpc_sigh); }; #endif /* _INCLUDE__INPUT_SESSION__INPUT_SESSION_H_ */ diff --git a/repos/os/include/nitpicker_gfx/box_painter.h b/repos/os/include/nitpicker_gfx/box_painter.h index 2c83f95d1..7fe4476a2 100644 --- a/repos/os/include/nitpicker_gfx/box_painter.h +++ b/repos/os/include/nitpicker_gfx/box_painter.h @@ -41,12 +41,12 @@ struct Box_painter int const alpha = color.a; - if (color.is_opaque()) + if (color.opaque()) for (int w, h = clipped.h() ; h--; dst_line += surface.size().w()) for (dst = dst_line, w = clipped.w(); w--; dst++) *dst = pix; - else if (!color.is_transparent()) + else if (!color.transparent()) for (int w, h = clipped.h() ; h--; dst_line += surface.size().w()) for (dst = dst_line, w = clipped.w(); w--; dst++) *dst = PT::mix(*dst, pix, alpha); diff --git a/repos/os/include/nitpicker_session/client.h b/repos/os/include/nitpicker_session/client.h index b076ccb30..01880a825 100644 --- a/repos/os/include/nitpicker_session/client.h +++ b/repos/os/include/nitpicker_session/client.h @@ -102,7 +102,7 @@ class Nitpicker::Session_client : public Genode::Rpc_client void enqueue(Command const &command) { - if (_command_buffer.is_full()) + if (_command_buffer.full()) execute(); _command_buffer.enqueue(command); diff --git a/repos/os/include/nitpicker_session/nitpicker_session.h b/repos/os/include/nitpicker_session/nitpicker_session.h index ef6dc6df1..b7d0ab5fa 100644 --- a/repos/os/include/nitpicker_session/nitpicker_session.h +++ b/repos/os/include/nitpicker_session/nitpicker_session.h @@ -139,7 +139,15 @@ struct Nitpicker::Session : Genode::Session public: - bool is_full() const { return _num >= MAX_COMMANDS; } + bool full() const { return _num >= MAX_COMMANDS; } + + /** + * Return true if there is no space left in the command buffer + * + * \noapi + * \deprecated use 'full' instead + */ + bool is_full() const { return full(); } unsigned num() const { @@ -154,11 +162,11 @@ struct Nitpicker::Session : Genode::Session * Enqueue command * * The command will be dropped if the buffer is full. Check for this - * condition by calling 'is_full()' prior calling this method. + * condition by calling 'full()' prior calling this method. */ void enqueue(Command const &command) { - if (!is_full()) + if (!full()) _commands[_num++] = command; } diff --git a/repos/os/include/os/packet_stream.h b/repos/os/include/os/packet_stream.h index dea721dc1..ada7f9367 100644 --- a/repos/os/include/os/packet_stream.h +++ b/repos/os/include/os/packet_stream.h @@ -645,7 +645,7 @@ class Genode::Packet_stream_source : private Packet_stream_base Packet_descriptor alloc_packet(Genode::size_t size, int align = POLICY::Packet_descriptor::PACKET_ALIGNMENT) { void *base = 0; - if (_packet_alloc->alloc_aligned(size, &base, align).is_error()) + if (_packet_alloc->alloc_aligned(size, &base, align).error()) throw Packet_alloc_failed(); return Packet_descriptor((Genode::off_t)base, size); diff --git a/repos/os/include/os/path.h b/repos/os/include/os/path.h index 678804f2b..363b99a98 100644 --- a/repos/os/include/os/path.h +++ b/repos/os/include/os/path.h @@ -32,11 +32,19 @@ class Genode::Path_base protected: - static bool is_absolute(char const *path) + static bool absolute(char const *path) { return path[0] == '/'; } + /** + * Return true if path starts with a '/' + * + * \noapi + * \deprecated use 'absolute' instead + */ + static bool is_absolute(char const *path) { return absolute(path); } + static bool ends_with(char c, char const *path) { return path[0] && (path[strlen(path) - 1] == c); @@ -71,11 +79,18 @@ class Genode::Path_base return result; } - static bool is_empty(char const *path) + static bool empty(char const *path) { return strlen(path) == 0; } + /** + * Return true if path contains no characters + * + * \deprecated use 'empty' instead + */ + static bool is_empty(char const *path) { return empty(path); } + /** * Remove superfluous single dots followed by a slash from path */ @@ -200,7 +215,7 @@ class Genode::Path_base /* * Use argument path if absolute */ - if (is_absolute(path)) + if (absolute(path)) strncpy(_path, path, _path_max_len); /* @@ -212,7 +227,7 @@ class Genode::Path_base strncpy(_path, pwd, _path_max_len); - if (!is_empty(relative_path)) { + if (!empty(relative_path)) { /* make sure to have a slash separating both portions */ _append_slash_if_needed(); diff --git a/repos/os/include/os/reporter.h b/repos/os/include/os/reporter.h index 7ac5cf84f..c6aba3e0c 100644 --- a/repos/os/include/os/reporter.h +++ b/repos/os/include/os/reporter.h @@ -83,7 +83,18 @@ class Genode::Reporter : Noncopyable _enabled = enabled; } - bool is_enabled() const { return _enabled; } + /** + * Return true if reporter is enabled + */ + bool enabled() const { return _enabled; } + + /** + * Return true if reporter is enabled + * + * \noapi + * \deprecated use 'enabled' instead + */ + bool is_enabled() const { return enabled(); } Name name() const { return _label; } diff --git a/repos/os/include/ram_fs/chunk.h b/repos/os/include/ram_fs/chunk.h index 3e872de70..3be1842b8 100644 --- a/repos/os/include/ram_fs/chunk.h +++ b/repos/os/include/ram_fs/chunk.h @@ -53,7 +53,7 @@ class File_system::Chunk_base : Noncopyable void assert_valid_range(seek_off_t start, size_t len, file_size_t chunk_size) const { - if (is_zero()) return; + if (zero()) return; if (start < _base_offset) throw Index_out_of_range(); @@ -85,7 +85,7 @@ class File_system::Chunk_base : Noncopyable /** * Return true if chunk is a read-only zero chunk */ - bool is_zero() const { return _base_offset == (seek_off_t)(~0L); } + bool zero() const { return _base_offset == (seek_off_t)(~0L); } /** * Return true if chunk has no allocated sub chunks @@ -326,7 +326,7 @@ class File_system::Chunk_index : public Chunk_base void operator () (Entry &entry, char *dst, size_t len, seek_off_t seek_offset) const { - if (entry.is_zero()) + if (entry.zero()) memset(dst, 0, len); else entry.read(dst, len, seek_offset); diff --git a/repos/os/include/ram_fs/directory.h b/repos/os/include/ram_fs/directory.h index 90b1e3dba..402692be5 100644 --- a/repos/os/include/ram_fs/directory.h +++ b/repos/os/include/ram_fs/directory.h @@ -111,7 +111,7 @@ class File_system::Directory : public Node if (!sub_node) throw Lookup_failed(); - if (is_basename(path)) { + if (!contains_path_delimiter(path)) { /* * Because 'path' is a basename that corresponds to an diff --git a/repos/os/include/report_rom/rom_module.h b/repos/os/include/report_rom/rom_module.h index 7db2256be..ded45d2c9 100644 --- a/repos/os/include/report_rom/rom_module.h +++ b/repos/os/include/report_rom/rom_module.h @@ -170,7 +170,7 @@ struct Rom::Module : Module_list::Element, Readable_module ** Interface to be used by the 'Registry' only ** *************************************************/ - bool _reader_is_registered(Reader const &reader) const + bool _reader_registered(Reader const &reader) const { for (Reader const *r = _readers.first(); r; r = r->next()) if (r == &reader) @@ -202,7 +202,7 @@ struct Rom::Module : Module_list::Element, Readable_module bool _has_name(Name const &name) const { return name == _name; } - bool _is_in_use() const + bool _in_use() const { return _readers.first() || _writers.first(); } @@ -239,7 +239,7 @@ struct Rom::Module : Module_list::Element, Readable_module * report. This way, we do not need to trust report clients to * append a zero termination to textual reports. */ - if (!_ds.is_constructed() || _ds->size() < (src_len + 1)) + if (!_ds.constructed() || _ds->size() < (src_len + 1)) _ds.construct(Genode::env()->ram_session(), (src_len + 1)); /* copy content into backing store */ @@ -264,7 +264,7 @@ struct Rom::Module : Module_list::Element, Readable_module */ size_t read_content(Reader const &reader, char *dst, size_t dst_len) const override { - if (!_ds.is_constructed() || !_last_writer) + if (!_ds.constructed() || !_last_writer) return 0; if (!_read_policy.read_permitted(*this, *_last_writer, reader)) diff --git a/repos/os/include/report_rom/rom_service.h b/repos/os/include/report_rom/rom_service.h index 53561b56f..d8482c54c 100644 --- a/repos/os/include/report_rom/rom_service.h +++ b/repos/os/include/report_rom/rom_service.h @@ -104,7 +104,7 @@ class Rom::Session_component : public Genode::Rpc_object, bool update() override { - if (!_ds.is_constructed() || _module.size() > _ds->size()) + if (!_ds.constructed() || _module.size() > _ds->size()) return false; size_t const new_content_size = diff --git a/repos/os/include/terminal/types.h b/repos/os/include/terminal/types.h index 0f4ef642d..c3f8aecca 100644 --- a/repos/os/include/terminal/types.h +++ b/repos/os/include/terminal/types.h @@ -36,7 +36,7 @@ struct Terminal::Character Character() : c(0) { } Character(unsigned char c) : c(c) { } - bool is_valid() const { return c != 0; } + bool valid() const { return c != 0; } unsigned char ascii() const { return c; } }; diff --git a/repos/os/include/usb/usb.h b/repos/os/include/usb/usb.h index 2e82b02d6..a2d4f319d 100644 --- a/repos/os/include/usb/usb.h +++ b/repos/os/include/usb/usb.h @@ -92,8 +92,14 @@ class Usb::Endpoint : public Endpoint_descriptor Endpoint(Endpoint_descriptor &endpoint_descr) : Endpoint_descriptor(endpoint_descr) { } - bool is_bulk() const { return (attributes & 0x3) == ENDPOINT_BULK; } - bool is_interrupt() const { return (attributes & 0x3) == ENDPOINT_INTERRUPT; } + bool bulk() const { return (attributes & 0x3) == ENDPOINT_BULK; } + bool interrupt() const { return (attributes & 0x3) == ENDPOINT_INTERRUPT; } + + /* + * \deprecated use 'bulk' and 'interrupt' instead + */ + bool is_bulk() const { return bulk(); } + bool is_interrupt() const { return interrupt(); } void dump() { diff --git a/repos/os/include/usb_session/usb_session.h b/repos/os/include/usb_session/usb_session.h index 043cfe269..335d59e91 100644 --- a/repos/os/include/usb_session/usb_session.h +++ b/repos/os/include/usb_session/usb_session.h @@ -80,7 +80,18 @@ struct Usb::Packet_descriptor : Genode::Packet_descriptor Error error = NO_ERROR; - bool is_read_transfer() { return transfer.ep & ENDPOINT_IN; } + /** + * Return true if packet is a read transfer + */ + bool read_transfer() { return transfer.ep & ENDPOINT_IN; } + + /** + * Return true if packet is a read transfer + * + * \noapi + * \deprecated use 'read_transfer' instead + */ + bool is_read_transfer() { return read_transfer(); } Packet_descriptor(off_t offset = 0, size_t size = 0) : Genode::Packet_descriptor(offset, size) { } diff --git a/repos/os/include/util/color.h b/repos/os/include/util/color.h index ffb8135e1..64f977d62 100644 --- a/repos/os/include/util/color.h +++ b/repos/os/include/util/color.h @@ -27,8 +27,14 @@ struct Genode::Color { int r, g, b, a; - bool is_opaque() const { return a == 255; } - bool is_transparent() const { return a == 0; } + bool opaque() const { return a == 255; } + bool transparent() const { return a == 0; } + + /* + * \deprecated use 'opaque' and 'transparent' instead + */ + bool is_opaque() const { return opaque(); } + bool is_transparent() const { return transparent(); } Color(int red, int green, int blue, int alpha = 255) : r(red), g(green), b(blue), a(alpha) { } diff --git a/repos/os/include/vfs/dir_file_system.h b/repos/os/include/vfs/dir_file_system.h index c9a427c6d..57cda509a 100644 --- a/repos/os/include/vfs/dir_file_system.h +++ b/repos/os/include/vfs/dir_file_system.h @@ -52,7 +52,7 @@ class Vfs::Dir_file_system : public File_system */ char _name[MAX_NAME_LEN]; - bool _is_root() const { return _name[0] == 0; } + bool _root() const { return _name[0] == 0; } /** * Perform operation on a file system @@ -125,7 +125,7 @@ class Vfs::Dir_file_system : public File_system char const *_sub_path(char const *path) const { /* do not strip anything from the path when we are root */ - if (_is_root()) + if (_root()) return path; /* skip heading slash in path if present */ @@ -326,7 +326,7 @@ class Vfs::Dir_file_system : public File_system Dirent_result dirent(char const *path, file_offset index, Dirent &out) override { - if (_is_root()) + if (_root()) return _dirent_of_file_systems(path, index, out); if (strcmp(path, "/") == 0) { @@ -348,7 +348,7 @@ class Vfs::Dir_file_system : public File_system file_size num_dirent(char const *path) override { - if (_is_root()) { + if (_root()) { return _sum_dirents_of_file_systems(path); } else { @@ -372,7 +372,10 @@ class Vfs::Dir_file_system : public File_system } } - bool is_directory(char const *path) override + /** + * Return true if specified path is a directory + */ + bool directory(char const *path) override { path = _sub_path(path); if (!path) @@ -382,12 +385,20 @@ class Vfs::Dir_file_system : public File_system return true; for (File_system *fs = _first_file_system; fs; fs = fs->next) - if (fs->is_directory(path)) + if (fs->directory(path)) return true; return false; } + /** + * Return true if specified path is a directory + * + * \noapi + * \deprecated use 'directory instead + */ + bool is_directory(char const *path) { return directory(path); } + char const *leaf_path(char const *path) override { path = _sub_path(path); @@ -416,7 +427,7 @@ class Vfs::Dir_file_system : public File_system * for the root directory so that subsequent 'dirent' calls * are subjected to the stacked file-system layout. */ - if (is_directory(path)) { + if (directory(path)) { *out_handle = new (alloc) Vfs_handle(*this, *this, alloc, 0); return OPEN_OK; } diff --git a/repos/os/include/vfs/directory_service.h b/repos/os/include/vfs/directory_service.h index 7cafcb164..2745f4a4e 100644 --- a/repos/os/include/vfs/directory_service.h +++ b/repos/os/include/vfs/directory_service.h @@ -185,7 +185,7 @@ struct Vfs::Directory_service */ virtual file_size num_dirent(char const *path) = 0; - virtual bool is_directory(char const *path) = 0; + virtual bool directory(char const *path) = 0; virtual char const *leaf_path(char const *path) = 0; }; diff --git a/repos/os/include/vfs/fs_file_system.h b/repos/os/include/vfs/fs_file_system.h index 119d21112..9b7c62c4c 100644 --- a/repos/os/include/vfs/fs_file_system.h +++ b/repos/os/include/vfs/fs_file_system.h @@ -261,10 +261,10 @@ class Vfs::Fs_file_system : public File_system out.size = status.size; out.mode = STAT_MODE_FILE | 0777; - if (status.is_symlink()) + if (status.symlink()) out.mode = STAT_MODE_SYMLINK | 0777; - if (status.is_directory()) + if (status.directory()) out.mode = STAT_MODE_DIRECTORY | 0777; out.uid = 0; @@ -497,7 +497,7 @@ class Vfs::Fs_file_system : public File_system return status.size / sizeof(::File_system::Directory_entry); } - bool is_directory(char const *path) override + bool directory(char const *path) override { try { ::File_system::Node_handle node = _fs.node(path); @@ -505,7 +505,7 @@ class Vfs::Fs_file_system : public File_system ::File_system::Status status = _fs.status(node); - return status.is_directory(); + return status.directory(); } catch (...) { return false; } } diff --git a/repos/os/include/vfs/ram_file_system.h b/repos/os/include/vfs/ram_file_system.h index 18e746b91..366792a21 100644 --- a/repos/os/include/vfs/ram_file_system.h +++ b/repos/os/include/vfs/ram_file_system.h @@ -442,7 +442,7 @@ class Vfs::Ram_file_system : public Vfs::File_system return 0; } - bool is_directory(char const *path) + bool directory(char const *path) override { using namespace Vfs_ram; diff --git a/repos/os/include/vfs/rom_file_system.h b/repos/os/include/vfs/rom_file_system.h index d06f3793f..0af32548b 100644 --- a/repos/os/include/vfs/rom_file_system.h +++ b/repos/os/include/vfs/rom_file_system.h @@ -93,7 +93,7 @@ class Vfs::Rom_file_system : public Single_file_system Stat_result result = Single_file_system::stat(path, out); _rom.update(); - out.size = _rom.is_valid() ? _rom.size() : 0; + out.size = _rom.valid() ? _rom.size() : 0; return result; } diff --git a/repos/os/include/vfs/single_file_system.h b/repos/os/include/vfs/single_file_system.h index 5cdff5860..773f54cb7 100644 --- a/repos/os/include/vfs/single_file_system.h +++ b/repos/os/include/vfs/single_file_system.h @@ -33,12 +33,12 @@ class Vfs::Single_file_system : public File_system enum { FILENAME_MAX_LEN = 64 }; char _filename[FILENAME_MAX_LEN]; - bool _is_root(const char *path) + bool _root(const char *path) { return (strcmp(path, "") == 0) || (strcmp(path, "/") == 0); } - bool _is_single_file(const char *path) + bool _single_file(const char *path) { return (strlen(path) == (strlen(_filename) + 1)) && (strcmp(&path[1], _filename) == 0); @@ -73,10 +73,10 @@ class Vfs::Single_file_system : public File_system out = { 0, 0, 0, 0, 0, 0 }; out.device = (Genode::addr_t)this; - if (_is_root(path)) { + if (_root(path)) { out.mode = STAT_MODE_DIRECTORY; - } else if (_is_single_file(path)) { + } else if (_single_file(path)) { switch (_node_type) { case NODE_TYPE_FILE: out.mode = STAT_MODE_FILE; break; case NODE_TYPE_CHAR_DEVICE: out.mode = STAT_MODE_CHARDEV; break; @@ -91,7 +91,7 @@ class Vfs::Single_file_system : public File_system Dirent_result dirent(char const *path, file_offset index, Dirent &out) override { - if (!_is_root(path)) + if (!_root(path)) return DIRENT_ERR_INVALID_PATH; if (index == 0) { @@ -111,15 +111,15 @@ class Vfs::Single_file_system : public File_system file_size num_dirent(char const *path) override { - if (_is_root(path)) + if (_root(path)) return 1; else return 0; } - bool is_directory(char const *path) override + bool directory(char const *path) override { - if (_is_root(path)) + if (_root(path)) return true; return false; @@ -127,14 +127,14 @@ class Vfs::Single_file_system : public File_system char const *leaf_path(char const *path) override { - return _is_single_file(path) ? path : 0; + return _single_file(path) ? path : 0; } Open_result open(char const *path, unsigned, Vfs_handle **out_handle, Allocator &alloc) override { - if (!_is_single_file(path)) + if (!_single_file(path)) return OPEN_ERR_UNACCESSIBLE; *out_handle = new (alloc) Vfs_handle(*this, *this, alloc, 0); @@ -160,7 +160,7 @@ class Vfs::Single_file_system : public File_system Rename_result rename(char const *from, char const *to) override { - if (_is_single_file(from) || _is_single_file(to)) + if (_single_file(from) || _single_file(to)) return RENAME_ERR_NO_PERM; return RENAME_ERR_NO_ENTRY; } diff --git a/repos/os/include/vfs/symlink_file_system.h b/repos/os/include/vfs/symlink_file_system.h index 2712b9ae8..6414b2443 100644 --- a/repos/os/include/vfs/symlink_file_system.h +++ b/repos/os/include/vfs/symlink_file_system.h @@ -29,12 +29,12 @@ class Vfs::Symlink_file_system : public File_system char _target[MAX_PATH_LEN]; char _filename[FILENAME_MAX_LEN]; - bool _is_root(const char *path) + bool _root(const char *path) { return (strcmp(path, "") == 0) || (strcmp(path, "/") == 0); } - bool _is_single_file(const char *path) + bool _single_file(const char *path) { return (strlen(path) == (strlen(_filename) + 1)) && (strcmp(&path[1], _filename) == 0); @@ -66,7 +66,7 @@ class Vfs::Symlink_file_system : public File_system file_size buf_size, file_size &out_len) override { - if (!_is_single_file(path)) + if (!_single_file(path)) return READLINK_ERR_NO_ENTRY; out_len = min(buf_size, file_size(sizeof(_target))); strncpy(buf, _target, out_len); @@ -78,10 +78,10 @@ class Vfs::Symlink_file_system : public File_system out = { 0, 0, 0, 0, 0, 0 }; out.device = (Genode::addr_t)this; - if (_is_root(path)) { + if (_root(path)) { out.mode = STAT_MODE_DIRECTORY; - } else if (_is_single_file(path)) { + } else if (_single_file(path)) { out.mode = STAT_MODE_SYMLINK; out.inode = 1; } else { @@ -92,15 +92,15 @@ class Vfs::Symlink_file_system : public File_system file_size num_dirent(char const *path) override { - if (_is_root(path)) + if (_root(path)) return 1; else return 0; } - bool is_directory(char const *path) override + bool directory(char const *path) override { - if (_is_root(path)) + if (_root(path)) return true; return false; @@ -108,12 +108,12 @@ class Vfs::Symlink_file_system : public File_system char const *leaf_path(char const *path) override { - return _is_single_file(path) ? path : 0; + return _single_file(path) ? path : 0; } Dirent_result dirent(char const *path, file_offset index, Dirent &out) override { - if (!_is_root(path)) + if (!_root(path)) return DIRENT_ERR_INVALID_PATH; if (index == 0) { @@ -142,7 +142,7 @@ class Vfs::Symlink_file_system : public File_system Rename_result rename(char const *from, char const *to) override { - if (_is_single_file(from) || _is_single_file(to)) + if (_single_file(from) || _single_file(to)) return RENAME_ERR_NO_PERM; return RENAME_ERR_NO_ENTRY; } diff --git a/repos/os/include/vfs/tar_file_system.h b/repos/os/include/vfs/tar_file_system.h index 255254ba4..1341ee62a 100644 --- a/repos/os/include/vfs/tar_file_system.h +++ b/repos/os/include/vfs/tar_file_system.h @@ -557,7 +557,7 @@ class Vfs::Tar_file_system : public File_system return _cached_num_dirent.num_dirent(path); } - bool is_directory(char const *path) override + bool directory(char const *path) override { Node const *node = dereference(path); diff --git a/repos/os/run/volatile_object.run b/repos/os/run/volatile_object.run index ef335bfec..c15def78e 100644 --- a/repos/os/run/volatile_object.run +++ b/repos/os/run/volatile_object.run @@ -36,11 +36,11 @@ compare_output_to { [init -> test-volatile_object] -- create Compound object -- [init -> test-volatile_object] construct Member_with_reference [init -> test-volatile_object] construct Compound -[init -> test-volatile_object] compound.member.is_constructed returns 1 -[init -> test-volatile_object] compound.lazy_member.is_constructed returns 0 +[init -> test-volatile_object] compound.member.constructed returns 1 +[init -> test-volatile_object] compound.lazy_member.constructed returns 0 [init -> test-volatile_object] -- construct lazy member -- [init -> test-volatile_object] construct Member_with_reference -[init -> test-volatile_object] compound.lazy_member.is_constructed returns 1 +[init -> test-volatile_object] compound.lazy_member.constructed returns 1 [init -> test-volatile_object] -- call method on member (with reference to Object 1) -- [init -> test-volatile_object] const method called on Object 1 [init -> test-volatile_object] -- reconstruct member with Object 2 as reference -- diff --git a/repos/os/src/app/cli_monitor/line_editor.h b/repos/os/src/app/cli_monitor/line_editor.h index 7fa08aae9..ce4740041 100644 --- a/repos/os/src/app/cli_monitor/line_editor.h +++ b/repos/os/src/app/cli_monitor/line_editor.h @@ -308,50 +308,52 @@ class Line_editor */ struct Seq_tracker { - enum State { INIT, GOT_ESC, GOT_FIRST } state; - char normal, first, second; - bool sequence_complete; + enum State { INIT, GOT_ESC, GOT_FIRST } _state; + char _normal, _first, _second; + bool _sequence_complete; - Seq_tracker() : state(INIT), sequence_complete(false) { } + Seq_tracker() : _state(INIT), _sequence_complete(false) { } void input(char c) { - switch (state) { + switch (_state) { case INIT: if (c == 27) - state = GOT_ESC; + _state = GOT_ESC; else - normal = c; - sequence_complete = false; + _normal = c; + _sequence_complete = false; break; case GOT_ESC: - first = c; - state = GOT_FIRST; + _first = c; + _state = GOT_FIRST; break; case GOT_FIRST: - second = c; - state = INIT; - sequence_complete = true; + _second = c; + _state = INIT; + _sequence_complete = true; break; } } - bool is_normal() const { return state == INIT && !sequence_complete; } + bool normal() const { return _state == INIT && !_sequence_complete; } + + char normal_char() const { return _normal; } bool _fn_complete(char match_first, char match_second) const { - return sequence_complete - && first == match_first - && second == match_second; + return _sequence_complete + && _first == match_first + && _second == match_second; } - bool is_key_up() const { return _fn_complete(91, 65); } - bool is_key_down() const { return _fn_complete(91, 66); } - bool is_key_right() const { return _fn_complete(91, 67); } - bool is_key_left() const { return _fn_complete(91, 68); } - bool is_key_delete() const { return _fn_complete(91, 51); } + bool key_up() const { return _fn_complete(91, 65); } + bool key_down() const { return _fn_complete(91, 66); } + bool key_right() const { return _fn_complete(91, 67); } + bool key_left() const { return _fn_complete(91, 68); } + bool key_delete() const { return _fn_complete(91, 51); } }; Seq_tracker _seq_tracker; @@ -418,7 +420,7 @@ class Line_editor LINE_FEED = 10, CARRIAGE_RETURN = 13 }; - if (_seq_tracker.is_key_left()) { + if (_seq_tracker.key_left()) { if (_cursor_pos > 0) { _cursor_pos--; _write(BACKSPACE); @@ -426,7 +428,7 @@ class Line_editor return; } - if (_seq_tracker.is_key_right()) { + if (_seq_tracker.key_right()) { if (_cursor_pos < strlen(_buf)) { _cursor_pos++; _move_cursor_to(_cursor_pos); @@ -434,13 +436,13 @@ class Line_editor return; } - if (_seq_tracker.is_key_delete()) + if (_seq_tracker.key_delete()) _delete_character(); - if (!_seq_tracker.is_normal()) + if (!_seq_tracker.normal()) return; - char const c = _seq_tracker.normal; + char const c = _seq_tracker.normal_char(); if (c == TAB) { _perform_completion(); @@ -864,7 +866,7 @@ class Line_editor * Returns true if the editing is complete, i.e., the user pressed the * return key. */ - bool is_complete() const { return _complete; } + bool completed() const { return _complete; } }; #endif /* _LINE_EDITOR_H_ */ diff --git a/repos/os/src/app/cli_monitor/main.cc b/repos/os/src/app/cli_monitor/main.cc index 5918e828b..29801025e 100644 --- a/repos/os/src/app/cli_monitor/main.cc +++ b/repos/os/src/app/cli_monitor/main.cc @@ -160,7 +160,7 @@ int main(int argc, char **argv) if (signal.context() == &read_avail_sig_ctx) { /* supply pending terminal input to line editor */ - while (terminal.avail() && !line_editor.is_complete()) { + while (terminal.avail() && !line_editor.completed()) { char c; terminal.read(&c, 1); line_editor.submit_input(c); @@ -207,7 +207,7 @@ int main(int argc, char **argv) continue; } - if (!line_editor.is_complete()) + if (!line_editor.completed()) continue; Command *command = lookup_command(buf, commands); diff --git a/repos/os/src/app/rom_logger/main.cc b/repos/os/src/app/rom_logger/main.cc index 27bad74c1..604ecd953 100644 --- a/repos/os/src/app/rom_logger/main.cc +++ b/repos/os/src/app/rom_logger/main.cc @@ -85,10 +85,10 @@ void Rom_logger::Main::_handle_update(unsigned) /* * Update ROM module and print content to LOG */ - if (_rom_ds.is_constructed()) { + if (_rom_ds.constructed()) { _rom_ds->update(); - if (_rom_ds->is_valid()) { + if (_rom_ds->valid()) { PLOG("ROM '%s':", _rom_name.string()); Genode::print_lines<200>(_rom_ds->local_addr(), _rom_ds->size(), diff --git a/repos/os/src/app/rom_to_file/main.cc b/repos/os/src/app/rom_to_file/main.cc index 13b993fae..57bf12287 100644 --- a/repos/os/src/app/rom_to_file/main.cc +++ b/repos/os/src/app/rom_to_file/main.cc @@ -105,10 +105,10 @@ void Rom_to_file::Main::_handle_update(unsigned) /* * Update ROM module and print content to LOG */ - if (_rom_ds.is_constructed()) { + if (_rom_ds.constructed()) { _rom_ds->update(); - if (_rom_ds->is_valid()) { + if (_rom_ds->valid()) { using namespace File_system; char dir_path[] = "/"; diff --git a/repos/os/src/app/status_bar/main.cc b/repos/os/src/app/status_bar/main.cc index b7e70a4d2..9b6d6869f 100644 --- a/repos/os/src/app/status_bar/main.cc +++ b/repos/os/src/app/status_bar/main.cc @@ -228,7 +228,7 @@ void Main::handle_focus(unsigned) { /* fetch new content of the focus ROM module */ focus_ds.update(); - if (!focus_ds.is_valid()) + if (!focus_ds.valid()) return; /* reset status-bar properties */ diff --git a/repos/os/src/app/usb_report_filter/main.cc b/repos/os/src/app/usb_report_filter/main.cc index 174b4b2c2..f9df0791a 100644 --- a/repos/os/src/app/usb_report_filter/main.cc +++ b/repos/os/src/app/usb_report_filter/main.cc @@ -227,7 +227,7 @@ class Usb_filter::Device_registry { _devices_rom.update(); - if (!_devices_rom.is_valid()) return; + if (!_devices_rom.valid()) return; if (verbose) PLOG("device report:\n%s", _devices_rom.local_addr()); @@ -320,7 +320,7 @@ class Usb_filter::Device_registry { _usb_drv_config_rom.update(); - if (!_usb_drv_config_rom.is_valid()) return; + if (!_usb_drv_config_rom.valid()) return; Xml_node config(_usb_drv_config_rom.local_addr(), _usb_drv_config_rom.size()); diff --git a/repos/os/src/app/xray_trigger/main.cc b/repos/os/src/app/xray_trigger/main.cc index 89ff7e064..678293960 100644 --- a/repos/os/src/app/xray_trigger/main.cc +++ b/repos/os/src/app/xray_trigger/main.cc @@ -218,7 +218,7 @@ void Xray_trigger::Main::_handle_update(unsigned) /* obtain / update hover model if needed */ if (Genode::config()->xml_node().has_sub_node("hover")) { - if (!_hover_ds.is_constructed()) { + if (!_hover_ds.constructed()) { _hover_ds.construct("hover"); _hover_ds->sigh(_update_dispatcher); } diff --git a/repos/os/src/app/xvfb/main.cc b/repos/os/src/app/xvfb/main.cc index 3cc4adea9..c8db895db 100644 --- a/repos/os/src/app/xvfb/main.cc +++ b/repos/os/src/app/xvfb/main.cc @@ -326,7 +326,7 @@ int main(int, char **) /* * Forward input events to the X session */ - while (input.is_pending()) { + while (input.pending()) { int num_ev = input.flush(); for (int i = 0; i < num_ev; i++) diff --git a/repos/os/src/drivers/acpi/memory.h b/repos/os/src/drivers/acpi/memory.h index a373817fe..11ddead10 100644 --- a/repos/os/src/drivers/acpi/memory.h +++ b/repos/os/src/drivers/acpi/memory.h @@ -78,7 +78,7 @@ class Acpi::Memory for (addr_t size = 0; size < size_aligned; size += 0x1000UL) { addr_t const low = (phys_aligned + size) & _align_offset(ACPI_REGION_SIZE_LOG2); - if (!_range.alloc_addr(0x1000UL, low).is_ok()) + if (!_range.alloc_addr(0x1000UL, low).ok()) continue; /* allocate acpi page as io memory */ diff --git a/repos/os/src/drivers/ahci/ahci.cc b/repos/os/src/drivers/ahci/ahci.cc index 5d88180a0..9feec71d7 100644 --- a/repos/os/src/drivers/ahci/ahci.cc +++ b/repos/os/src/drivers/ahci/ahci.cc @@ -66,12 +66,12 @@ struct Ahci scan_ports(); } - bool is_atapi(unsigned sig) + bool atapi(unsigned sig) { return sig == ATAPI_SIG_QEMU || sig == ATAPI_SIG; } - bool is_ata(unsigned sig) + bool ata(unsigned sig) { return sig == ATA_SIG; } @@ -130,7 +130,7 @@ struct Ahci /* check for ATA/ATAPI devices */ unsigned sig = port.read(); - if (!is_atapi(sig) && !is_ata(sig)) { + if (!atapi(sig) && !ata(sig)) { PINF("\t\t#%u: off", i); continue; } @@ -141,7 +141,7 @@ struct Ahci try { enabled = port.enable(); } catch (Port::Not_ready) { PERR("Could not enable port %u", i); } - PINF("\t\t#%u: %s", i, is_atapi(sig) ? "ATAPI" : "ATA"); + PINF("\t\t#%u: %s", i, atapi(sig) ? "ATAPI" : "ATA"); if (!enabled) continue; @@ -168,7 +168,7 @@ struct Ahci Block::Driver *claim_port(unsigned port_num) { - if (!is_avail(port_num)) + if (!avail(port_num)) throw -1; port_claimed[port_num] = true; @@ -180,7 +180,7 @@ struct Ahci port_claimed[port_num] = false; } - bool is_avail(unsigned port_num) + bool avail(unsigned port_num) { return port_num < MAX_PORTS && ports[port_num] && !port_claimed[port_num] && ports[port_num]->ready(); @@ -227,9 +227,9 @@ void Ahci_driver::free_port(long device_num) } -bool Ahci_driver::is_avail(long device_num) +bool Ahci_driver::avail(long device_num) { - return sata_ahci()->is_avail(device_num); + return sata_ahci()->avail(device_num); } diff --git a/repos/os/src/drivers/ahci/ahci.h b/repos/os/src/drivers/ahci/ahci.h index 13f3fdfc5..a316a31d1 100644 --- a/repos/os/src/drivers/ahci/ahci.h +++ b/repos/os/src/drivers/ahci/ahci.h @@ -38,7 +38,7 @@ namespace Ahci_driver { void init(Ahci_root &ep); - bool is_avail(long device_num); + bool avail(long device_num); long device_number(char const *model_num, char const *serial_num); Block::Driver *claim_port(long device_num); diff --git a/repos/os/src/drivers/ahci/main.cc b/repos/os/src/drivers/ahci/main.cc index 95a817feb..c7e2e9b11 100644 --- a/repos/os/src/drivers/ahci/main.cc +++ b/repos/os/src/drivers/ahci/main.cc @@ -116,7 +116,7 @@ class Block::Root_multiple_clients : public Root_component< ::Session_component> throw Root::Invalid_args(); } - if (!Ahci_driver::is_avail(num)) { + if (!Ahci_driver::avail(num)) { PERR("Device %ld not available", num); throw Root::Unavailable(); } diff --git a/repos/os/src/drivers/framebuffer/spec/rpi/main.cc b/repos/os/src/drivers/framebuffer/spec/rpi/main.cc index be10df6aa..553545ac7 100644 --- a/repos/os/src/drivers/framebuffer/spec/rpi/main.cc +++ b/repos/os/src/drivers/framebuffer/spec/rpi/main.cc @@ -81,7 +81,7 @@ class Framebuffer::Session_component : public Genode::Rpc_objectcap(); else return _fb_mem.cap(); @@ -102,7 +102,7 @@ class Framebuffer::Session_component : public Genode::Rpc_object(p); /* try to create proxy */ - if (!irq_alloc || irq_alloc->alloc_addr(1, irq_number).is_error()) + if (!irq_alloc || irq_alloc->alloc_addr(1, irq_number).error()) return 0; PROXY *new_proxy = new (env()->heap()) PROXY(irq_number, trigger, diff --git a/repos/os/src/drivers/platform/spec/x86/main.cc b/repos/os/src/drivers/platform/spec/x86/main.cc index 4a9062849..7e71ccb59 100644 --- a/repos/os/src/drivers/platform/spec/x86/main.cc +++ b/repos/os/src/drivers/platform/spec/x86/main.cc @@ -63,7 +63,7 @@ int main(int argc, char **argv) acpi_rom.sigh(sig_cap); - while (!acpi_rom.is_valid()) { + while (!acpi_rom.valid()) { sig_rec.wait_for_signal(); acpi_rom.update(); } diff --git a/repos/os/src/drivers/platform/spec/x86/nonpci_devices.cc b/repos/os/src/drivers/platform/spec/x86/nonpci_devices.cc index 3f1580d24..1c74ce49f 100644 --- a/repos/os/src/drivers/platform/spec/x86/nonpci_devices.cc +++ b/repos/os/src/drivers/platform/spec/x86/nonpci_devices.cc @@ -87,7 +87,7 @@ class Nonpci::Ps2 : public Platform::Device_component */ Platform::Device_capability Platform::Session_component::device(String const &name) { - if (!name.is_valid_string()) + if (!name.valid_string()) return Device_capability(); using namespace Genode; diff --git a/repos/os/src/drivers/platform/spec/x86/pci_device_component.h b/repos/os/src/drivers/platform/spec/x86/pci_device_component.h index 8cbfb63ff..ace2ede57 100644 --- a/repos/os/src/drivers/platform/spec/x86/pci_device_component.h +++ b/repos/os/src/drivers/platform/spec/x86/pci_device_component.h @@ -167,7 +167,7 @@ class Platform::Device_component : public Genode::Rpc_object, * Disabling a bridge may make the devices behind non-functional, * as we have no driver which will switch it on again */ - if (_device_config.is_pci_bridge()) + if (_device_config.pci_bridge()) return; unsigned cmd = _device_config.read(&_config_access, PCI_CMD_REG, diff --git a/repos/os/src/drivers/platform/spec/x86/pci_device_config.h b/repos/os/src/drivers/platform/spec/x86/pci_device_config.h index e3c0f36b7..09b6c46c8 100644 --- a/repos/os/src/drivers/platform/spec/x86/pci_device_config.h +++ b/repos/os/src/drivers/platform/spec/x86/pci_device_config.h @@ -152,7 +152,18 @@ namespace Platform { unsigned short device_id() { return _device_id; } unsigned short vendor_id() { return _vendor_id; } unsigned int class_code() { return _class_code; } - bool is_pci_bridge() { return _header_type == HEADER_PCI_TO_PCI; } + + /** + * Return true if device is a PCI bridge + */ + bool pci_bridge() { return _header_type == HEADER_PCI_TO_PCI; } + + /** + * Return true if device is a PCI bridge + * + * \deprecated use 'pci_bridge instead + */ + bool is_pci_bridge() { return pci_bridge(); } /** * Return true if device is valid diff --git a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h index eb134f5c7..510662d00 100644 --- a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h +++ b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h @@ -751,7 +751,7 @@ namespace Platform { Io_mem_dataspace_capability io_mem = device->get_config_space(); - if (!_device_pd.is_constructed()) + if (!_device_pd.constructed()) _device_pd.construct(_device_pd_ep, _md_alloc, _resources.ram().cap(), _label.string()); @@ -779,7 +779,7 @@ namespace Platform { Ram_capability alloc_dma_buffer(Genode::size_t const size) { - if (!_device_pd.is_constructed()) + if (!_device_pd.constructed()) _device_pd.construct(_device_pd_ep, _md_alloc, _resources.ram().cap(), _label.string()); @@ -927,7 +927,7 @@ class Platform::Root : public Genode::Root_component Device_config bridge(bus, dev, func, &config_access); - if (bridge.is_pci_bridge()) + if (bridge.pci_bridge()) /* PCI bridge spec 3.2.5.3, 3.2.5.4 */ bus = bridge.read(&config_access, 0x19, Device::ACCESS_8BIT); @@ -959,7 +959,7 @@ class Platform::Root : public Genode::Root_component if (!config.valid()) continue; - if (!config.is_pci_bridge() && bridge_bdf != 0) + if (!config.pci_bridge() && bridge_bdf != 0) /** * If the bridge bdf has not a type header of a bridge in * the pci config space, then it should be the host bridge diff --git a/repos/os/src/drivers/platform/spec/x86/session.cc b/repos/os/src/drivers/platform/spec/x86/session.cc index 9bf68465d..e51228a58 100644 --- a/repos/os/src/drivers/platform/spec/x86/session.cc +++ b/repos/os/src/drivers/platform/spec/x86/session.cc @@ -63,7 +63,7 @@ bool Platform::bus_valid(int bus) valid[bus] = true; /* scan behind bridge */ - if (config.is_pci_bridge()) { + if (config.pci_bridge()) { /* PCI bridge spec 3.2.5.3, 3.2.5.4 */ unsigned char sec_bus = config.read(&config_access, 0x19, Device::ACCESS_8BIT); diff --git a/repos/os/src/drivers/usb_block/main.cc b/repos/os/src/drivers/usb_block/main.cc index ddccdd3db..878cf6fc3 100644 --- a/repos/os/src/drivers/usb_block/main.cc +++ b/repos/os/src/drivers/usb_block/main.cc @@ -171,7 +171,7 @@ struct Usb::Block_driver : Usb::Completion, } /* OUT transfer finished */ - if (!p.is_read_transfer()) { + if (!p.read_transfer()) { iface.release(p); return; } @@ -571,7 +571,7 @@ struct Usb::Block_driver : Usb::Completion, } static bool request_executed = false; - if (!p.is_read_transfer()) { + if (!p.read_transfer()) { /* send read/write request */ if (req.pending) { diff --git a/repos/os/src/init/main.cc b/repos/os/src/init/main.cc index e84c0330f..9a2a79245 100644 --- a/repos/os/src/init/main.cc +++ b/repos/os/src/init/main.cc @@ -83,7 +83,7 @@ inline void determine_parent_services(Genode::Service_registry *services) if (Init::config_verbose) printf(" service \"%s\"\n", service_name); - if (node.is_last("service")) break; + if (node.last("service")) break; } } @@ -190,7 +190,7 @@ class Init::Child_registry : public Name_registry, Child_list */ void insert_alias(Alias *alias) { - if (!is_unique(alias->name.string())) { + if (!unique(alias->name.string())) { PERR("Alias name %s is not unique", alias->name.string()); throw Alias_name_is_not_unique(); } @@ -243,7 +243,7 @@ class Init::Child_registry : public Name_registry, Child_list ** Name-registry interface ** *****************************/ - bool is_unique(const char *name) const + bool unique(const char *name) const { /* check for name clash with an existing child */ Genode::List_element const *curr = first(); diff --git a/repos/os/src/server/fs_log/session.h b/repos/os/src/server/fs_log/session.h index 8c19ef987..665dbea31 100644 --- a/repos/os/src/server/fs_log/session.h +++ b/repos/os/src/server/fs_log/session.h @@ -66,7 +66,7 @@ class Fs_log::Unlabeled_session_component : public Session_component size_t write(Log_session::String const &msg) { - if (!msg.is_valid_string()) { + if (!msg.valid_string()) { PERR("corrupted string"); return 0; } @@ -103,7 +103,7 @@ class Fs_log::Labeled_session_component : public Session_component size_t write(Log_session::String const &msg) { - if (!msg.is_valid_string()) { + if (!msg.valid_string()) { PERR("corrupted string"); return 0; } diff --git a/repos/os/src/server/iso9660/backing_store.h b/repos/os/src/server/iso9660/backing_store.h index 4cc644938..d30b43233 100644 --- a/repos/os/src/server/iso9660/backing_store.h +++ b/repos/os/src/server/iso9660/backing_store.h @@ -86,7 +86,7 @@ class Backing_store /** * Return true if block is in use */ - bool is_occupied() const { return _user != 0; } + bool occupied() const { return _user != 0; } /** * Return user of the block @@ -192,7 +192,7 @@ class Backing_store } /* evict block if needed */ - if (_curr_block()->is_occupied()) + if (_curr_block()->occupied()) _curr_block()->evict(); /* reserve allocated block (prevent eviction prior assignment) */ diff --git a/repos/os/src/server/iso9660/iso9660.cc b/repos/os/src/server/iso9660/iso9660.cc index 797a291bc..5588272ac 100644 --- a/repos/os/src/server/iso9660/iso9660.cc +++ b/repos/os/src/server/iso9660/iso9660.cc @@ -274,7 +274,7 @@ namespace Iso { } /* describes this record a directory */ - bool is_directory() { return file_flags() & DIR_FLAG; } + bool directory() { return file_flags() & DIR_FLAG; } }; @@ -301,10 +301,10 @@ namespace Iso { Directory_record * root_record() { return ptr(156); } /* check for primary descriptor */ - bool is_primary() { return type() == PRIMARY; } + bool primary() { return type() == PRIMARY; } /* check for terminating descriptor */ - bool is_terminator() { return type() == TERMINATOR; } + bool terminator() { return type() == TERMINATOR; } /* copy the root record */ Directory_record *copy_root_record() @@ -334,10 +334,10 @@ namespace Iso { if (verbose) PDBG("Volume: type %u", vol->type()); - if (vol->is_primary()) + if (vol->primary()) return vol->copy_root_record(); - if (vol->is_terminator()) + if (vol->terminator()) return 0; } } @@ -444,7 +444,7 @@ namespace Iso { if (verbose) PDBG("Found %s", level); - if (!dir->is_directory()) { + if (!dir->directory()) { blk_nr = dir->blk_nr(); data_length = dir->data_length(); } diff --git a/repos/os/src/server/loader/input.h b/repos/os/src/server/loader/input.h index 732a1b59e..b9013d342 100644 --- a/repos/os/src/server/loader/input.h +++ b/repos/os/src/server/loader/input.h @@ -69,7 +69,7 @@ class Input::Session_component : public Rpc_object Dataspace_capability dataspace() override { return _real_input.dataspace(); } - bool is_pending() const override { return _real_input.is_pending(); } + bool pending() const override { return _real_input.pending(); } int flush() override { diff --git a/repos/os/src/server/lx_fs/main.cc b/repos/os/src/server/lx_fs/main.cc index d804fe29f..04f5661da 100644 --- a/repos/os/src/server/lx_fs/main.cc +++ b/repos/os/src/server/lx_fs/main.cc @@ -220,7 +220,7 @@ class File_system::Session_component : public Session_rpc_object if (!_writable && create) throw Permission_denied(); - if (!path.is_valid_string()) + if (!path.valid_string()) throw Name_too_long(); Directory *dir = _root.subdir(path_str, create); diff --git a/repos/os/src/server/nitpicker/domain_registry.h b/repos/os/src/server/nitpicker/domain_registry.h index 2871b9c48..6c6670a16 100644 --- a/repos/os/src/server/nitpicker/domain_registry.h +++ b/repos/os/src/server/nitpicker/domain_registry.h @@ -245,7 +245,7 @@ class Domain_registry _insert(domain); - if (domain.is_last(type)) + if (domain.last(type)) break; } } diff --git a/repos/os/src/server/nitpicker/input.h b/repos/os/src/server/nitpicker/input.h index ee024a580..815e2c97d 100644 --- a/repos/os/src/server/nitpicker/input.h +++ b/repos/os/src/server/nitpicker/input.h @@ -33,13 +33,13 @@ static unsigned num_consecutive_events(Input::Event const *ev, unsigned max) if (max < 1) return 0; if (ev->type() != Input::Event::MOTION) return 1; - bool first_is_absolute = ev->is_absolute_motion(); + bool const first_absolute = ev->absolute_motion(); /* iterate until we get a different event type, start at second */ unsigned cnt = 1; for (ev++ ; cnt < max; cnt++, ev++) { if (ev->type() != Input::Event::MOTION) break; - if (first_is_absolute != ev->is_absolute_motion()) break; + if (first_absolute != ev->absolute_motion()) break; } return cnt; } @@ -72,7 +72,7 @@ static Input::Event merge_motion_events(Input::Event const *ev, unsigned n) static bool import_input_events(Input::Event *ev_buf, unsigned num_ev, User_state &user_state) { - bool user_is_active = false; + bool user_active = false; if (num_ev > 0) { /* @@ -97,7 +97,7 @@ static bool import_input_events(Input::Event *ev_buf, unsigned num_ev, * a zero-motion event, drop it. Otherwise, it would be * misinterpreted as absolute event pointing to (0, 0). */ - if (e->is_relative_motion() && curr.rx() == 0 && curr.ry() == 0) + if (e->relative_motion() && curr.rx() == 0 && curr.ry() == 0) continue; /* @@ -105,7 +105,7 @@ static bool import_input_events(Input::Event *ev_buf, unsigned num_ev, * we regard the user as active. This check captures the presence * of press-release combinations within one batch of input events. */ - user_is_active |= user_state.key_is_pressed(); + user_active |= user_state.key_pressed(); /* pass event to user state */ user_state.handle_event(curr); @@ -122,9 +122,9 @@ static bool import_input_events(Input::Event *ev_buf, unsigned num_ev, /* * If at least one key is kept pressed, we regard the user as active. */ - user_is_active |= user_state.key_is_pressed(); + user_active |= user_state.key_pressed(); - return user_is_active; + return user_active; } #endif /* _INPUT_H_ */ diff --git a/repos/os/src/server/nitpicker/main.cc b/repos/os/src/server/nitpicker/main.cc index 992c7cd8f..8421be460 100644 --- a/repos/os/src/server/nitpicker/main.cc +++ b/repos/os/src/server/nitpicker/main.cc @@ -79,7 +79,7 @@ Framebuffer::Session *tmp_fb; static void report_session(Genode::Reporter &reporter, Session *session, bool active = false) { - if (!reporter.is_enabled()) + if (!reporter.enabled()) return; Genode::Reporter::Xml_generator xml(reporter, [&] () @@ -277,7 +277,7 @@ class Input::Session_component : public Genode::Rpc_object Dataspace_capability dataspace() override { return _ev_ram_ds.cap(); } - bool is_pending() const override { return _num_ev > 0; } + bool pending() const override { return _num_ev > 0; } int flush() override { @@ -527,7 +527,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object, case Command::OP_GEOMETRY: { Locked_ptr view(_view_handle_registry.lookup(command.geometry.view)); - if (!view.is_valid()) + if (!view.valid()) return; Point pos = command.geometry.rect.p1(); @@ -536,7 +536,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object, if (view->top_level()) pos = ::Session::phys_pos(pos, _view_stack.size()); - if (view.is_valid()) + if (view.valid()) _view_stack.geometry(*view, Rect(pos, command.geometry.rect.area())); return; @@ -546,7 +546,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object, { Locked_ptr view(_view_handle_registry.lookup(command.geometry.view)); - if (view.is_valid()) + if (view.valid()) _view_stack.buffer_offset(*view, command.offset.offset); return; @@ -558,7 +558,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object, return; Locked_ptr view(_view_handle_registry.lookup(command.to_front.view)); - if (!view.is_valid()) + if (!view.valid()) return; /* bring to front if no neighbor is specified */ @@ -569,7 +569,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object, /* stack view relative to neighbor */ Locked_ptr neighbor(_view_handle_registry.lookup(command.to_front.neighbor)); - if (neighbor.is_valid()) + if (neighbor.valid()) _view_stack.stack(*view, &(*neighbor), false); return; @@ -581,7 +581,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object, return; Locked_ptr view(_view_handle_registry.lookup(command.to_back.view)); - if (!view.is_valid()) + if (!view.valid()) return; /* bring to front if no neighbor is specified */ @@ -592,7 +592,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object, /* stack view relative to neighbor */ Locked_ptr neighbor(_view_handle_registry.lookup(command.to_back.neighbor)); - if (neighbor.is_valid()) + if (neighbor.valid()) _view_stack.stack(*view, &(*neighbor), true); return; @@ -602,7 +602,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object, { if (_provides_default_bg) { Locked_ptr view(_view_handle_registry.lookup(command.to_front.view)); - if (!view.is_valid()) + if (!view.valid()) return; view->background(true); @@ -616,7 +616,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object, /* assign session background */ Locked_ptr view(_view_handle_registry.lookup(command.to_front.view)); - if (!view.is_valid()) + if (!view.valid()) return; ::Session::background(&(*view)); @@ -632,7 +632,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object, { Locked_ptr view(_view_handle_registry.lookup(command.title.view)); - if (view.is_valid()) + if (view.valid()) _view_stack.title(*view, command.title.title.string()); return; @@ -764,7 +764,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object, try { Locked_ptr parent(_view_handle_registry.lookup(parent_handle)); - if (!parent.is_valid()) + if (!parent.valid()) return View_handle(); view = new (_view_alloc) @@ -849,7 +849,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object, { try { Locked_ptr view(_view_handle_registry.lookup(handle)); - return view.is_valid() ? view->cap() : View_capability(); + return view.valid() ? view->cap() : View_capability(); } catch (View_handle_registry::Lookup_failed) { return View_capability(); @@ -1272,7 +1272,7 @@ void Nitpicker::Main::handle_input(unsigned) user_active = false; /* report mouse-position updates */ - if (pointer_reporter.is_enabled() && old_pointer_pos != new_pointer_pos) { + if (pointer_reporter.enabled() && old_pointer_pos != new_pointer_pos) { Genode::Reporter::Xml_generator xml(pointer_reporter, [&] () { @@ -1282,7 +1282,7 @@ void Nitpicker::Main::handle_input(unsigned) } /* report hover changes */ - if (!user_state.Mode::key_is_pressed() + if (!user_state.Mode::key_pressed() && old_pointed_session != new_pointed_session) { report_session(hover_reporter, new_pointed_session); } diff --git a/repos/os/src/server/nitpicker/mode.h b/repos/os/src/server/nitpicker/mode.h index 02b9be8d8..c0f256540 100644 --- a/repos/os/src/server/nitpicker/mode.h +++ b/repos/os/src/server/nitpicker/mode.h @@ -51,7 +51,7 @@ class Mode bool has_key_cnt(unsigned cnt) const { return cnt == _key_cnt; } - bool key_is_pressed() const { return _key_cnt > 0; } + bool key_pressed() const { return _key_cnt > 0; } Session *focused_session() { return _focused_session; } Session const *focused_session() const { return _focused_session; } @@ -62,7 +62,7 @@ class Mode _next_focused_session = session; } - bool is_focused(Session const &session) const { return &session == _focused_session; } + bool focused(Session const &session) const { return &session == _focused_session; } void next_focused_session(Session *session) { _next_focused_session = session; } @@ -77,7 +77,7 @@ class Mode * inconsistent press and release events. However, focus changes * during global key sequences are fine. */ - if (key_is_pressed() && !_global_key_sequence) + if (key_pressed() && !_global_key_sequence) return; if (_focused_session != _next_focused_session) diff --git a/repos/os/src/server/nitpicker/user_state.cc b/repos/os/src/server/nitpicker/user_state.cc index ee91ab178..1c96fe1e5 100644 --- a/repos/os/src/server/nitpicker/user_state.cc +++ b/repos/os/src/server/nitpicker/user_state.cc @@ -75,7 +75,7 @@ void User_state::handle_event(Input::Event ev) ax = ev.ax(); ay = ev.ay(); ev = Input::Event::create_touch_event(ax, ay, ev.code(), - ev.is_touch_release()); + ev.touch_release()); } else ev = Input::Event(type, keycode, ax, ay, rx, ry); diff --git a/repos/os/src/server/nitpicker/view.h b/repos/os/src/server/nitpicker/view.h index 95602b748..2176e8da3 100644 --- a/repos/os/src/server/nitpicker/view.h +++ b/repos/os/src/server/nitpicker/view.h @@ -206,7 +206,7 @@ class View : public Same_buffer_list_elem, { if (!_session.label_visible()) return 0; - return mode.is_focused(_session) ? 5 : 3; + return mode.focused(_session) ? 5 : 3; } /** @@ -236,10 +236,10 @@ class View : public Same_buffer_list_elem, /** * Set view as background * - * \param is_bg true if view is background + * \param bg true if view is background */ - void background(bool is_bg) { - _background = is_bg ? BACKGROUND : NOT_BACKGROUND; } + void background(bool bg) { + _background = bg ? BACKGROUND : NOT_BACKGROUND; } /** * Accessors diff --git a/repos/os/src/server/part_blk/gpt.h b/repos/os/src/server/part_blk/gpt.h index 3e5a62455..4ca847898 100644 --- a/repos/os/src/server/part_blk/gpt.h +++ b/repos/os/src/server/part_blk/gpt.h @@ -126,7 +126,7 @@ class Gpt : public Block::Partition_table PLOGV(" gpe crc: %x", _gpe_crc); } - bool is_valid(bool check_primary = true) + bool valid(bool check_primary = true) { dump_hdr(check_primary); @@ -156,7 +156,7 @@ class Gpt : public Block::Partition_table if (check_primary) { /* check backup gpt header */ Sector backup_hdr(_backup_hdr_lba, 1); - if (!backup_hdr.addr()->is_valid(false)) { + if (!backup_hdr.addr()->valid(false)) { PWRN("Backup GPT header is corrupted"); } } @@ -181,7 +181,7 @@ class Gpt : public Block::Partition_table Genode::uint64_t _attr; /* partition attributes */ Genode::uint16_t _name[NAME_LEN]; /* partition name in UNICODE-16 */ - bool is_valid() + bool valid() { if (_type.time_low == 0x00000000) return false; @@ -226,7 +226,7 @@ class Gpt : public Block::Partition_table */ void _parse_gpt(Gpt_hdr *gpt) { - if (!(gpt->is_valid())) + if (!(gpt->valid())) throw Genode::Exception(); Sector entry_array(gpt->_gpe_lba, @@ -236,7 +236,7 @@ class Gpt : public Block::Partition_table for (int i = 0; i < MAX_PARTITIONS; i++) { Gpt_entry *e = (entries + i); - if (!e->is_valid()) + if (!e->valid()) continue; Genode::uint64_t start = e->_lba_start; diff --git a/repos/os/src/server/part_blk/mbr.h b/repos/os/src/server/part_blk/mbr.h index 6f0c65c94..7ecfd3a7f 100644 --- a/repos/os/src/server/part_blk/mbr.h +++ b/repos/os/src/server/part_blk/mbr.h @@ -46,9 +46,9 @@ struct Mbr_partition_table : public Block::Partition_table Genode::uint32_t _lba; /* logical block address */ Genode::uint32_t _sectors; /* number of sectors */ - bool is_valid() { return _type != INVALID; } - bool is_extented() { return _type == EXTENTED; } - bool is_protective() { return _type == PROTECTIVE; } + bool valid() { return _type != INVALID; } + bool extented() { return _type == EXTENTED; } + bool protective() { return _type == PROTECTIVE; } } __attribute__((packed)); @@ -61,7 +61,7 @@ struct Mbr_partition_table : public Block::Partition_table Partition_record _records[4]; Genode::uint16_t _magic; - bool is_valid() + bool valid() { /* magic number of partition table */ enum { MAGIC = 0xaa55 }; @@ -86,13 +86,13 @@ struct Mbr_partition_table : public Block::Partition_table Sector s(lba, 1); Mbr *ebr = s.addr(); - if (!(ebr->is_valid())) + if (!(ebr->valid())) return; /* The first record is the actual logical partition. The lba of this * partition is relative to the lba of the current EBR */ Partition_record *logical = &(ebr->_records[0]); - if (logical->is_valid() && nr < MAX_PARTITIONS) { + if (logical->valid() && nr < MAX_PARTITIONS) { _part_list[nr++] = new (Genode::env()->heap()) Block::Partition(logical->_lba + lba, logical->_sectors); @@ -107,29 +107,29 @@ struct Mbr_partition_table : public Block::Partition_table r = &(ebr->_records[1]); lba += ebr->_records[1]._lba; - } while (r->is_valid()); + } while (r->valid()); } void _parse_mbr(Mbr *mbr) { /* no partition table, use whole disc as partition 0 */ - if (!(mbr->is_valid())) + if (!(mbr->valid())) _part_list[0] = new(Genode::env()->heap()) Block::Partition(0, Block::Driver::driver().blk_cnt() - 1); for (int i = 0; i < 4; i++) { Partition_record *r = &(mbr->_records[i]); - if (!r->is_valid()) + if (!r->valid()) continue; PINF("Partition %d: LBA %u (%u blocks) type: %x", i + 1, r->_lba, r->_sectors, r->_type); - if (r->is_protective()) + if (r->protective()) throw Protective_mbr_found(); - if (r->is_extented()) { + if (r->extented()) { _parse_extented(r); continue; } diff --git a/repos/os/src/server/ram_fs/main.cc b/repos/os/src/server/ram_fs/main.cc index f4f2abd1c..0030b5601 100644 --- a/repos/os/src/server/ram_fs/main.cc +++ b/repos/os/src/server/ram_fs/main.cc @@ -256,7 +256,7 @@ namespace File_system { if (!_writable) throw Permission_denied(); - if (!path.is_valid_string()) + if (!path.valid_string()) throw Name_too_long(); Directory *parent = _root.lookup_and_lock_parent(path_str); diff --git a/repos/os/src/server/report_rom/rom_registry.h b/repos/os/src/server/report_rom/rom_registry.h index 97e93627d..b3504f03f 100644 --- a/repos/os/src/server/report_rom/rom_registry.h +++ b/repos/os/src/server/report_rom/rom_registry.h @@ -77,7 +77,7 @@ struct Rom::Registry : Registry_for_reader, Registry_for_writer, Genode::Noncopy void _try_to_destroy(Module const &module) { - if (module._is_in_use()) + if (module._in_use()) return; _modules.remove(&module); diff --git a/repos/os/src/server/rom_filter/input_rom_registry.h b/repos/os/src/server/rom_filter/input_rom_registry.h index 5b699d242..0911e5f34 100644 --- a/repos/os/src/server/rom_filter/input_rom_registry.h +++ b/repos/os/src/server/rom_filter/input_rom_registry.h @@ -77,7 +77,7 @@ class Rom_filter::Input_rom_registry void _handle_rom_changed(unsigned) { _rom_ds.update(); - if (!_rom_ds.is_valid()) + if (!_rom_ds.valid()) return; try { diff --git a/repos/os/src/server/rom_filter/main.cc b/repos/os/src/server/rom_filter/main.cc index a7ac08553..8ecc6a0e5 100644 --- a/repos/os/src/server/rom_filter/main.cc +++ b/repos/os/src/server/rom_filter/main.cc @@ -87,7 +87,7 @@ class Rom_filter::Session_component : public Rpc_object, using namespace Genode; /* replace dataspace by new one as needed */ - if (!_ram_ds.is_constructed() + if (!_ram_ds.constructed() || _output_buffer.content_size() > _ram_ds->size()) { _ram_ds.construct(env()->ram_session(), _output_buffer.content_size()); @@ -180,7 +180,7 @@ struct Rom_filter::Main : Input_rom_registry::Input_rom_changed_fn, xml_ds_size = Genode::config()->xml_node().attribute_value("buffer", xml_ds_size); - if (!_xml_ds.is_constructed() || xml_ds_size != _xml_ds->size()) + if (!_xml_ds.constructed() || xml_ds_size != _xml_ds->size()) _xml_ds.construct(env()->ram_session(), xml_ds_size); /* diff --git a/repos/os/src/server/terminal_log/main.cc b/repos/os/src/server/terminal_log/main.cc index 0b782ef59..59a0ef45a 100644 --- a/repos/os/src/server/terminal_log/main.cc +++ b/repos/os/src/server/terminal_log/main.cc @@ -56,7 +56,7 @@ namespace Genode { */ size_t write(String const &string_buf) { - if (!(string_buf.is_valid_string())) { + if (!(string_buf.valid_string())) { PERR("corrupted string"); return 0; } diff --git a/repos/os/src/server/trace_fs/chunk.h b/repos/os/src/server/trace_fs/chunk.h index 4a2e130c5..09909a96f 100644 --- a/repos/os/src/server/trace_fs/chunk.h +++ b/repos/os/src/server/trace_fs/chunk.h @@ -45,7 +45,7 @@ namespace File_system { void assert_valid_range(seek_off_t start, size_t len, file_size_t chunk_size) const { - if (is_zero()) return; + if (zero()) return; if (start < _base_offset) throw Index_out_of_range(); @@ -77,7 +77,7 @@ namespace File_system { /** * Return true if chunk is a read-only zero chunk */ - bool is_zero() const { return _base_offset == (seek_off_t)(~0L); } + bool zero() const { return _base_offset == (seek_off_t)(~0L); } /** * Return true if chunk has no allocated sub chunks @@ -318,7 +318,7 @@ namespace File_system { void operator () (Entry &entry, char *dst, size_t len, seek_off_t seek_offset) const { - if (entry.is_zero()) + if (entry.zero()) memset(dst, 0, len); else entry.read(dst, len, seek_offset); diff --git a/repos/os/src/server/trace_fs/directory.h b/repos/os/src/server/trace_fs/directory.h index 27c4dfd7b..fee792b1b 100644 --- a/repos/os/src/server/trace_fs/directory.h +++ b/repos/os/src/server/trace_fs/directory.h @@ -125,7 +125,7 @@ namespace File_system { if (!sub_node) throw Lookup_failed(); - if (is_basename(path)) { + if (!contains_path_delimiter(path)) { /* * Because 'path' is a basename that corresponds to an diff --git a/repos/os/src/server/trace_fs/followed_subject.h b/repos/os/src/server/trace_fs/followed_subject.h index c6e83cec6..d03fddd75 100644 --- a/repos/os/src/server/trace_fs/followed_subject.h +++ b/repos/os/src/server/trace_fs/followed_subject.h @@ -68,7 +68,7 @@ namespace Trace_fs { bool last_entry() const { - return current_entry.is_last(); + return current_entry.last(); } void rewind() { current_entry = buffer->first(); } diff --git a/repos/os/src/server/trace_fs/main.cc b/repos/os/src/server/trace_fs/main.cc index d11941e19..ba427f1e4 100644 --- a/repos/os/src/server/trace_fs/main.cc +++ b/repos/os/src/server/trace_fs/main.cc @@ -840,7 +840,7 @@ class File_system::Session_component : public Session_rpc_object if (create) throw Permission_denied(); - if (!path.is_valid_string()) + if (!path.valid_string()) throw Name_too_long(); Directory *dir = dynamic_cast(_root_dir.lookup(path_str + 1)); diff --git a/repos/os/src/server/vfs/main.cc b/repos/os/src/server/vfs/main.cc index f9eb468d3..4c1cd40b1 100644 --- a/repos/os/src/server/vfs/main.cc +++ b/repos/os/src/server/vfs/main.cc @@ -323,7 +323,7 @@ class Vfs_server::Session_component : /* make sure a handle is free before allocating */ auto slot = _next_slot(); - if (!create && !_vfs.is_directory(path_str)) + if (!create && !_vfs.directory(path_str)) throw Lookup_failed(); Directory *dir; @@ -653,7 +653,7 @@ class Vfs_server::Root : ram_quota -= session_size; /* check if the session root exists */ - if (!((session_root == "/") || _vfs.is_directory(session_root.base()))) { + if (!((session_root == "/") || _vfs.directory(session_root.base()))) { PERR("session root '%s' not found for '%s'", session_root.base(), label.string()); throw Root::Unavailable(); } diff --git a/repos/os/src/test/clipboard/main.cc b/repos/os/src/test/clipboard/main.cc index 6a2332528..e510f4ae3 100644 --- a/repos/os/src/test/clipboard/main.cc +++ b/repos/os/src/test/clipboard/main.cc @@ -115,7 +115,7 @@ class Subsystem _import_rom.update(); - if (!_import_rom.is_valid()) + if (!_import_rom.valid()) return; _import_content = _import_rom.local_addr(); @@ -203,7 +203,7 @@ class Subsystem return false; } - bool is_cleared() const + bool cleared() const { try { _imported_text(); @@ -312,8 +312,8 @@ struct Server::Main : Handle_step_fn case EXPECT_PRIVATE_KEY: - if (!_hobby.is_cleared() - || !_work .is_cleared() + if (!_hobby.cleared() + || !_work .cleared() || !_admin.has_content(private_key)) return; @@ -350,7 +350,7 @@ struct Server::Main : Handle_step_fn case EXPECT_CONTRACT: - if (!_hobby.is_cleared() + if (!_hobby.cleared() || !_work .has_content(contract) || !_admin.has_content(contract)) return; diff --git a/repos/os/src/test/input/test.cc b/repos/os/src/test/input/test.cc index 1705208b1..8bb417aad 100644 --- a/repos/os/src/test/input/test.cc +++ b/repos/os/src/test/input/test.cc @@ -66,7 +66,7 @@ int main(int argc, char **argv) int key_cnt = 0; while (1) { /* poll input service every 20 ms */ - while (!input.is_pending()) timer.msleep(20); + while (!input.pending()) timer.msleep(20); for (int i = 0, num_ev = input.flush(); i < num_ev; ++i) { diff --git a/repos/os/src/test/iso/main.cc b/repos/os/src/test/iso/main.cc index 9084870ac..dc6d8f5da 100644 --- a/repos/os/src/test/iso/main.cc +++ b/repos/os/src/test/iso/main.cc @@ -56,7 +56,7 @@ int main() dump(ptr, 0x20000); Attached_rom_dataspace rom("/notavail.txt"); - if (!rom.is_valid()) + if (!rom.valid()) PDBG("Expected ROM error occured"); else PERR("found file where no file should be!"); diff --git a/repos/os/src/test/nitpicker/test.cc b/repos/os/src/test/nitpicker/test.cc index 5201248da..9ad07d5ee 100644 --- a/repos/os/src/test/nitpicker/test.cc +++ b/repos/os/src/test/nitpicker/test.cc @@ -206,7 +206,7 @@ int main(int argc, char **argv) Test_view *tv = 0; while (1) { - while (!nitpicker.input()->is_pending()) timer.msleep(20); + while (!nitpicker.input()->pending()) timer.msleep(20); for (int i = 0, num_ev = nitpicker.input()->flush(); i < num_ev; i++) { diff --git a/repos/os/src/test/report_rom/main.cc b/repos/os/src/test/report_rom/main.cc index e978cac71..bd86dba07 100644 --- a/repos/os/src/test/report_rom/main.cc +++ b/repos/os/src/test/report_rom/main.cc @@ -50,7 +50,7 @@ int main(int argc, char **argv) printf("ROM client: request brightness report\n"); Attached_rom_dataspace brightness_rom("brightness"); - ASSERT(brightness_rom.is_valid()); + ASSERT(brightness_rom.valid()); brightness_rom.sigh(sig_cap); printf(" -> %s\n", brightness_rom.local_addr()); @@ -74,7 +74,7 @@ int main(int argc, char **argv) timer.msleep(250); brightness_rom.update(); - ASSERT(brightness_rom.is_valid()); + ASSERT(brightness_rom.valid()); printf("ROM client: ROM is available despite report was closed - OK\n"); printf("Reporter: start reporting (while the ROM client still listens)\n"); diff --git a/repos/os/src/test/trace/main.cc b/repos/os/src/test/trace/main.cc index b6f9f3c15..6e13048dd 100644 --- a/repos/os/src/test/trace/main.cc +++ b/repos/os/src/test/trace/main.cc @@ -102,7 +102,7 @@ class Trace_buffer_monitor PLOG("overflows: %u", _buffer->wrapped()); PLOG("read all remaining events"); - for (; !_curr_entry.is_last(); _curr_entry = _buffer->next(_curr_entry)) { + for (; !_curr_entry.last(); _curr_entry = _buffer->next(_curr_entry)) { /* omit empty entries */ if (_curr_entry.length() == 0) continue; @@ -203,7 +203,7 @@ int main(int argc, char **argv) PINF("load module: '%s' for label: '%s'", policy_module, policy_label); - if (policy.is_last("trace_policy")) break; + if (policy.last("trace_policy")) break; } } catch (...) { } diff --git a/repos/os/src/test/volatile_object/main.cc b/repos/os/src/test/volatile_object/main.cc index 3e658bdc6..0e67d6d52 100644 --- a/repos/os/src/test/volatile_object/main.cc +++ b/repos/os/src/test/volatile_object/main.cc @@ -123,15 +123,15 @@ int main(int, char **) printf("-- create Compound object --\n"); Compound compound(object_1); - PLOG("compound.member.is_constructed returns %d", - compound.member.is_constructed()); - PLOG("compound.lazy_member.is_constructed returns %d", - compound.lazy_member.is_constructed()); + PLOG("compound.member.constructed returns %d", + compound.member.constructed()); + PLOG("compound.lazy_member.constructed returns %d", + compound.lazy_member.constructed()); printf("-- construct lazy member --\n"); compound.lazy_member.construct(object_2); - PLOG("compound.lazy_member.is_constructed returns %d", - compound.lazy_member.is_constructed()); + PLOG("compound.lazy_member.constructed returns %d", + compound.lazy_member.constructed()); printf("-- call method on member (with reference to Object 1) --\n"); call_const_method(compound); diff --git a/repos/ports/include/vmm/vcpu_thread.h b/repos/ports/include/vmm/vcpu_thread.h index 7a7d5bf57..a04096d7d 100644 --- a/repos/ports/include/vmm/vcpu_thread.h +++ b/repos/ports/include/vmm/vcpu_thread.h @@ -75,7 +75,7 @@ class Vmm::Vcpu_other_pd : public Vmm::Vcpu_thread /* tell parent that this will be a vCPU */ Thread_state state; state.sel_exc_base = Native_thread::INVALID_INDEX; - state.is_vcpu = true; + state.vcpu = true; Cpu_thread_client cpu_thread(vcpu_vm); @@ -125,7 +125,7 @@ class Vmm::Vcpu_same_pd : public Vmm::Vcpu_thread, Genode::Thread this->native_thread().exc_pt_sel = cap_map()->insert(Nova::NUM_INITIAL_VCPU_PT_LOG2); /* tell generic thread code that this becomes a vCPU */ - this->native_thread().is_vcpu = true; + this->native_thread().vcpu = true; } ~Vcpu_same_pd() diff --git a/repos/ports/src/app/gdb_monitor/gdbserver/genode-low.cc b/repos/ports/src/app/gdb_monitor/gdbserver/genode-low.cc index 120453fc4..3bc1421c5 100644 --- a/repos/ports/src/app/gdb_monitor/gdbserver/genode-low.cc +++ b/repos/ports/src/app/gdb_monitor/gdbserver/genode-low.cc @@ -250,7 +250,7 @@ class Memory_model bool valid() { return _region != 0; } - bool is_loaded(Region_map_component::Region const * region) + bool loaded(Region_map_component::Region const * region) { return _region == region; } @@ -301,7 +301,7 @@ class Memory_model unsigned char *_update_curr_region(Region_map_component::Region *region) { for (unsigned i = 0; i < NUM_MAPPED_REGIONS; i++) { - if (_mapped_region[i].is_loaded(region)) + if (_mapped_region[i].loaded(region)) return _mapped_region[i].local_base(); } diff --git a/repos/ports/src/app/seoul/console.cc b/repos/ports/src/app/seoul/console.cc index 3839bd1cc..27888234b 100644 --- a/repos/ports/src/app/seoul/console.cc +++ b/repos/ports/src/app/seoul/console.cc @@ -61,7 +61,7 @@ struct Ps2_mouse_packet : Genode::Register<32> }; -static bool is_mouse_event(Input::Event const *ev) +static bool mouse_event(Input::Event const *ev) { using Input::Event; if (ev->type() == Event::PRESS || ev->type() == Event::RELEASE) { @@ -96,7 +96,7 @@ unsigned Vancouver_console::_input_to_ps2mouse(Input::Event const *ev) int rx; int ry; - if (ev->is_absolute_motion()) { + if (ev->absolute_motion()) { static Input::Event last_event; rx = ev->ax() - last_event.ax(); ry = ev->ay() - last_event.ay(); @@ -257,7 +257,7 @@ void Vancouver_console::entry() _startup_lock.unlock(); while (1) { - while (!input.is_pending()) { + while (!input.pending()) { /* transfer text buffer content into chunky canvas */ if (_regs && ++count % 10 == 0 && _regs->mode == 0 @@ -341,7 +341,7 @@ void Vancouver_console::entry() Input::Event *ev = &ev_buf[i]; /* update mouse model (PS2) */ - if (is_mouse_event(ev)) { + if (mouse_event(ev)) { MessageInput msg(0x10001, _input_to_ps2mouse(ev)); _motherboard()->bus_input.send(msg); } diff --git a/repos/ports/src/app/seoul/main.cc b/repos/ports/src/app/seoul/main.cc index 0b3dfe262..24898375c 100644 --- a/repos/ports/src/app/seoul/main.cc +++ b/repos/ports/src/app/seoul/main.cc @@ -1338,7 +1338,7 @@ class Machine : public StaticReceiver */ dmi->create(_unsynchronized_motherboard, argv, "", 0); - if (node.is_last()) + if (node.last()) break; } } diff --git a/repos/ports/src/app/vbox_pointer/main.cc b/repos/ports/src/app/vbox_pointer/main.cc index 86e529946..19952f714 100644 --- a/repos/ports/src/app/vbox_pointer/main.cc +++ b/repos/ports/src/app/vbox_pointer/main.cc @@ -190,7 +190,7 @@ void Main::_handle_hover(unsigned) using Vbox_pointer::read_string_attribute; _hover_ds.update(); - if (!_hover_ds.is_valid()) + if (!_hover_ds.valid()) return; /* read new hover information from nitpicker's hover report */ @@ -216,7 +216,7 @@ void Main::_handle_hover(unsigned) void Main::_handle_xray(unsigned) { _xray_ds.update(); - if (!_xray_ds.is_valid()) + if (!_xray_ds.valid()) return; try { diff --git a/repos/ports/src/app/vbox_pointer/policy.cc b/repos/ports/src/app/vbox_pointer/policy.cc index 6342decc2..8f50fe1d5 100644 --- a/repos/ports/src/app/vbox_pointer/policy.cc +++ b/repos/ports/src/app/vbox_pointer/policy.cc @@ -61,7 +61,7 @@ class Vbox_pointer::Policy_entry : public Vbox_pointer::Policy, _shape_ds.update(); - if (!_shape_ds.is_valid()) + if (!_shape_ds.valid()) return; if (_shape_ds.size() < sizeof(Vbox_pointer::Shape_report)) diff --git a/repos/ports/src/noux/child.h b/repos/ports/src/noux/child.h index b608eb3ad..4f701d068 100644 --- a/repos/ports/src/noux/child.h +++ b/repos/ports/src/noux/child.h @@ -97,7 +97,10 @@ namespace Noux { class Child; - bool is_init_process(Child *child); + /** + * Return true is child is the init process + */ + bool init_process(Child *child); void init_process_exited(int); class Child : public Rpc_object, @@ -306,7 +309,7 @@ namespace Noux { _entrypoint.dissolve(this); - if (is_init_process(this)) + if (init_process(this)) init_process_exited(_child_policy.exit_value()); } @@ -426,7 +429,7 @@ namespace Noux { void submit_exit_signal() { - if (is_init_process(this)) { + if (init_process(this)) { PINF("init process exited"); /* trigger exit of main event loop */ diff --git a/repos/ports/src/noux/file_descriptor_registry.h b/repos/ports/src/noux/file_descriptor_registry.h index 74746e3c4..87f8cea04 100644 --- a/repos/ports/src/noux/file_descriptor_registry.h +++ b/repos/ports/src/noux/file_descriptor_registry.h @@ -32,7 +32,7 @@ namespace Noux { Shared_pointer io_channel; } _fds[MAX_FILE_DESCRIPTORS]; - bool _is_valid_fd(int fd) const + bool _valid_fd(int fd) const { return (fd >= 0) && (fd < MAX_FILE_DESCRIPTORS); } @@ -79,7 +79,7 @@ namespace Noux { return -1; } - if (!_is_valid_fd(fd)) { + if (!_valid_fd(fd)) { PERR("File descriptor %d is out of range", fd); return -2; } @@ -90,7 +90,7 @@ namespace Noux { virtual void remove_io_channel(int fd) { - if (!_is_valid_fd(fd)) + if (!_valid_fd(fd)) PERR("File descriptor %d is out of range", fd); else _reset_fd(fd); @@ -98,7 +98,7 @@ namespace Noux { bool fd_in_use(int fd) const { - return (_is_valid_fd(fd) && _fds[fd].io_channel); + return (_valid_fd(fd) && _fds[fd].io_channel); } Shared_pointer io_channel_by_fd(int fd) const diff --git a/repos/ports/src/noux/io_channel.h b/repos/ports/src/noux/io_channel.h index 83de5ddd3..a4b9afac9 100644 --- a/repos/ports/src/noux/io_channel.h +++ b/repos/ports/src/noux/io_channel.h @@ -95,7 +95,7 @@ namespace Noux { /** * Return true if the channel is set to non-blocking mode */ - virtual bool is_nonblocking() { return false; } + virtual bool nonblocking() { return false; } /** * Register blocker for getting waked up on an I/O channel event diff --git a/repos/ports/src/noux/main.cc b/repos/ports/src/noux/main.cc index 1a9051975..ddb7ea450 100644 --- a/repos/ports/src/noux/main.cc +++ b/repos/ports/src/noux/main.cc @@ -52,7 +52,7 @@ namespace Noux { static Noux::Child *init_child; static int exit_value = ~0; - bool is_init_process(Child *child) { return child == init_child; } + bool init_process(Child *child) { return child == init_child; } void init_process_exited(int exit) { init_child = 0; exit_value = exit; } }; @@ -170,7 +170,7 @@ bool Noux::Child::syscall(Noux::Session::Syscall sc) Shared_pointer io = _lookup_channel(_sysio->write_in.fd); - if (!io->is_nonblocking()) + if (!io->nonblocking()) _block_for_io_channel(io, false, true, false); if (io->check_unblock(false, true, false)) { @@ -196,7 +196,7 @@ bool Noux::Child::syscall(Noux::Session::Syscall sc) { Shared_pointer io = _lookup_channel(_sysio->read_in.fd); - if (!io->is_nonblocking()) + if (!io->nonblocking()) _block_for_io_channel(io, true, false, false); if (io->check_unblock(true, false, false)) diff --git a/repos/ports/src/virtualbox/frontend/console.cc b/repos/ports/src/virtualbox/frontend/console.cc index 8cba1b2ae..429e9e457 100644 --- a/repos/ports/src/virtualbox/frontend/console.cc +++ b/repos/ports/src/virtualbox/frontend/console.cc @@ -191,23 +191,23 @@ void GenodeConsole::handle_input(unsigned) for (int i = 0, num_ev = _input.flush(); i < num_ev; ++i) { Input::Event &ev = _ev_buf[i]; - bool const is_press = ev.type() == Input::Event::PRESS; - bool const is_release = ev.type() == Input::Event::RELEASE; - bool const is_key = is_press || is_release; - bool const is_motion = ev.type() == Input::Event::MOTION; - bool const is_wheel = ev.type() == Input::Event::WHEEL; - bool const is_touch = ev.type() == Input::Event::TOUCH; + bool const press = ev.type() == Input::Event::PRESS; + bool const release = ev.type() == Input::Event::RELEASE; + bool const key = press || release; + bool const motion = ev.type() == Input::Event::MOTION; + bool const wheel = ev.type() == Input::Event::WHEEL; + bool const touch = ev.type() == Input::Event::TOUCH; - if (is_key) { + if (key) { Scan_code scan_code(ev.keycode()); unsigned char const release_bit = (ev.type() == Input::Event::RELEASE) ? 0x80 : 0; - if (scan_code.is_normal()) + if (scan_code.normal()) _vbox_keyboard->PutScancode(scan_code.code() | release_bit); - if (scan_code.is_ext()) { + if (scan_code.ext()) { _vbox_keyboard->PutScancode(0xe0); _vbox_keyboard->PutScancode(scan_code.ext() | release_bit); } @@ -217,22 +217,22 @@ void GenodeConsole::handle_input(unsigned) * Track press/release status of keys and buttons. Currently, * only the mouse-button states are actually used. */ - if (is_press) + if (press) _key_status[ev.keycode()] = true; - if (is_release) + if (release) _key_status[ev.keycode()] = false; - bool const is_mouse_button_event = - is_key && _is_mouse_button(ev.keycode()); + bool const mouse_button_event = + key && _mouse_button(ev.keycode()); - bool const is_mouse_event = is_mouse_button_event || is_motion; + bool const mouse_event = mouse_button_event || motion; - if (is_mouse_event) { + if (mouse_event) { unsigned const buttons = (_key_status[Input::BTN_LEFT] ? MouseButtonState_LeftButton : 0) - | (_key_status[Input::BTN_RIGHT] ? MouseButtonState_RightButton : 0) - | (_key_status[Input::BTN_MIDDLE] ? MouseButtonState_MiddleButton : 0); - if (ev.is_absolute_motion()) { + | (_key_status[Input::BTN_RIGHT] ? MouseButtonState_RightButton : 0) + | (_key_status[Input::BTN_MIDDLE] ? MouseButtonState_MiddleButton : 0); + if (ev.absolute_motion()) { _last_received_motion_event_was_absolute = true; @@ -246,12 +246,12 @@ void GenodeConsole::handle_input(unsigned) _vbox_mouse->PutMouseEvent(rx, ry, 0, 0, buttons); } else _vbox_mouse->PutMouseEventAbsolute(ev.ax(), ev.ay(), 0, - 0, buttons); + 0, buttons); _ax = ev.ax(); _ay = ev.ay(); - } else if (ev.is_relative_motion()) { + } else if (ev.relative_motion()) { _last_received_motion_event_was_absolute = false; @@ -284,14 +284,14 @@ void GenodeConsole::handle_input(unsigned) } } - if (is_wheel) { + if (wheel) { if (_last_received_motion_event_was_absolute) _vbox_mouse->PutMouseEventAbsolute(_ax, _ay, -ev.ry(), -ev.rx(), 0); else _vbox_mouse->PutMouseEvent(0, 0, -ev.ry(), -ev.rx(), 0); } - if (is_touch) { + if (touch) { /* if multitouch queue is full - send it */ if (mt_number >= sizeof(mt_events) / sizeof(mt_events[0])) { _vbox_mouse->PutEventMultiTouch(mt_number, mt_number, @@ -314,7 +314,7 @@ void GenodeConsole::handle_input(unsigned) }; int status = MultiTouch::InContact | MultiTouch::InRange; - if (ev.is_touch_release()) + if (ev.touch_release()) status = MultiTouch::None; uint16_t const s = RT_MAKE_U16(slot, status); @@ -476,7 +476,7 @@ int vboxClipboardReadData (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t format, clipboard_rom->update(); - if (!clipboard_rom->is_valid()) { + if (!clipboard_rom->valid()) { PERR("invalid clipboard dataspace"); return VERR_NOT_SUPPORTED; } diff --git a/repos/ports/src/virtualbox/frontend/console.h b/repos/ports/src/virtualbox/frontend/console.h index 89926c30d..0fb4cd7d8 100644 --- a/repos/ports/src/virtualbox/frontend/console.h +++ b/repos/ports/src/virtualbox/frontend/console.h @@ -87,12 +87,11 @@ class Scan_code Scan_code(Input::Keycode keycode) : _keycode(keycode) { } - bool is_normal() const { return converter().scan_code[_keycode]; } - bool is_ext() const { return converter().scan_code_ext[_keycode]; } + bool normal() const { return converter().scan_code[_keycode]; } bool valid() const { - return is_normal() || is_ext(); + return normal() || ext(); } unsigned char code() const @@ -129,7 +128,7 @@ class GenodeConsole : public Console { bool _key_status[Input::KEY_MAX + 1]; - static bool _is_mouse_button(Input::Keycode keycode) + static bool _mouse_button(Input::Keycode keycode) { return keycode == Input::BTN_LEFT || keycode == Input::BTN_RIGHT