mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
Everywhere: Switch from (void) to [[maybe_unused]] (#4473)
Problem: - `(void)` simply casts the expression to void. This is understood to indicate that it is ignored, but this is really a compiler trick to get the compiler to not generate a warning. Solution: - Use the `[[maybe_unused]]` attribute to indicate the value is unused. Note: - Functions taking a `(void)` argument list have also been changed to `()` because this is not needed and shows up in the same grep command.
This commit is contained in:
parent
4421d98e30
commit
765936ebae
103 changed files with 219 additions and 362 deletions
|
@ -64,9 +64,9 @@ static GenericInterruptHandler* s_interrupt_handler[GENERIC_INTERRUPT_HANDLERS_C
|
|||
extern "C" void enter_thread_context(Thread* from_thread, Thread* to_thread);
|
||||
extern "C" void context_first_init(Thread* from_thread, Thread* to_thread, TrapFrame* trap);
|
||||
extern "C" u32 do_init_context(Thread* thread, u32 flags);
|
||||
extern "C" void exit_kernel_thread(void);
|
||||
extern "C" void pre_init_finished(void);
|
||||
extern "C" void post_init_finished(void);
|
||||
extern "C" void exit_kernel_thread();
|
||||
extern "C" void pre_init_finished();
|
||||
extern "C" void post_init_finished();
|
||||
extern "C" void handle_interrupt(TrapFrame*);
|
||||
|
||||
#define EH_ENTRY(ec, title) \
|
||||
|
@ -1490,13 +1490,10 @@ void Processor::switch_context(Thread*& from_thread, Thread*& to_thread)
|
|||
#endif
|
||||
}
|
||||
|
||||
extern "C" void context_first_init(Thread* from_thread, Thread* to_thread, TrapFrame* trap)
|
||||
extern "C" void context_first_init([[maybe_unused]] Thread* from_thread, [[maybe_unused]] Thread* to_thread, [[maybe_unused]] TrapFrame* trap)
|
||||
{
|
||||
ASSERT(!are_interrupts_enabled());
|
||||
ASSERT(is_kernel_mode());
|
||||
(void)from_thread;
|
||||
(void)to_thread;
|
||||
(void)trap;
|
||||
|
||||
#ifdef CONTEXT_SWITCH_DEBUG
|
||||
dbg() << "switch_context <-- from " << VirtualAddress(from_thread) << " " << *from_thread << " to " << VirtualAddress(to_thread) << " " << *to_thread << " (context_first_init)";
|
||||
|
@ -1513,7 +1510,7 @@ extern "C" void context_first_init(Thread* from_thread, Thread* to_thread, TrapF
|
|||
Scheduler::leave_on_first_switch(trap->regs->eflags);
|
||||
}
|
||||
|
||||
extern "C" void thread_context_first_enter(void);
|
||||
extern "C" void thread_context_first_enter();
|
||||
asm(
|
||||
// enter_thread_context returns to here first time a thread is executing
|
||||
".globl thread_context_first_enter \n"
|
||||
|
@ -1529,7 +1526,7 @@ asm(
|
|||
" jmp common_trap_exit \n"
|
||||
);
|
||||
|
||||
void exit_kernel_thread(void)
|
||||
void exit_kernel_thread()
|
||||
{
|
||||
Thread::current()->exit();
|
||||
}
|
||||
|
@ -1674,7 +1671,7 @@ void Processor::assume_context(Thread& thread, u32 flags)
|
|||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
extern "C" void pre_init_finished(void)
|
||||
extern "C" void pre_init_finished()
|
||||
{
|
||||
ASSERT(g_scheduler_lock.own_lock());
|
||||
|
||||
|
@ -1687,7 +1684,7 @@ extern "C" void pre_init_finished(void)
|
|||
Scheduler::leave_on_first_switch(prev_flags);
|
||||
}
|
||||
|
||||
extern "C" void post_init_finished(void)
|
||||
extern "C" void post_init_finished()
|
||||
{
|
||||
// We need to re-acquire the scheduler lock before a context switch
|
||||
// transfers control into the idle loop, which needs the lock held
|
||||
|
@ -1731,7 +1728,7 @@ void Processor::initialize_context_switching(Thread& initial_thread)
|
|||
[from_to_thread] "b" (&initial_thread),
|
||||
[cpu] "c" (id())
|
||||
);
|
||||
|
||||
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue