mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
DevTools: Mark compilation-unit-only functions as static
This enables a nice warning in case a function becomes dead code. Also, in case of signal_trampoline_dummy, marking it external (non-static) prevents it from being 'optimized away', which would lead to surprising and weird linker errors.
This commit is contained in:
parent
84e112be6b
commit
5574d45eda
Notes:
sideshowbarker
2024-07-19 03:43:06 +09:00
Author: https://github.com/BenWiederhake
Commit: 5574d45eda
Pull-request: https://github.com/SerenityOS/serenity/pull/3096
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/stelar7
2 changed files with 4 additions and 2 deletions
|
@ -132,7 +132,7 @@ int main(int argc, char** argv)
|
||||||
return app->exec();
|
return app->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool prompt_to_stop_profiling()
|
static bool prompt_to_stop_profiling()
|
||||||
{
|
{
|
||||||
auto window = GUI::Window::construct();
|
auto window = GUI::Window::construct();
|
||||||
window->set_title("Profiling");
|
window->set_title("Profiling");
|
||||||
|
|
|
@ -1124,7 +1124,7 @@ enum class DefaultSignalAction {
|
||||||
Continue,
|
Continue,
|
||||||
};
|
};
|
||||||
|
|
||||||
DefaultSignalAction default_signal_action(int signal)
|
static DefaultSignalAction default_signal_action(int signal)
|
||||||
{
|
{
|
||||||
ASSERT(signal && signal < NSIG);
|
ASSERT(signal && signal < NSIG);
|
||||||
|
|
||||||
|
@ -1235,6 +1235,8 @@ void report(const char* format, ...)
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure the compiler doesn't "optimize away" this function:
|
||||||
|
extern void signal_trampoline_dummy(void);
|
||||||
void signal_trampoline_dummy(void)
|
void signal_trampoline_dummy(void)
|
||||||
{
|
{
|
||||||
// The trampoline preserves the current eax, pushes the signal code and
|
// The trampoline preserves the current eax, pushes the signal code and
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue