diff --git a/AK/Assertions.h b/AK/Assertions.h index 0d09c7b7fdd..e4c9e3124cb 100644 --- a/AK/Assertions.h +++ b/AK/Assertions.h @@ -21,8 +21,8 @@ static constexpr bool TODO = false; #define TODO_PPC64() VERIFY(TODO) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */ #define TODO_PPC() VERIFY(TODO) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */ -#ifndef NDEBUG extern "C" __attribute__((noreturn)) void ak_assertion_failed(char const*); +#ifndef NDEBUG # define ASSERT(expr) \ (__builtin_expect(!(expr), 0) \ ? ak_assertion_failed(#expr " at " __FILE__ ":" __stringify(__LINE__)) \ diff --git a/Ladybird/AppKit/Application/EventLoopImplementation.mm b/Ladybird/AppKit/Application/EventLoopImplementation.mm index 650d00e99cf..10ac24b1c29 100644 --- a/Ladybird/AppKit/Application/EventLoopImplementation.mm +++ b/Ladybird/AppKit/Application/EventLoopImplementation.mm @@ -130,7 +130,7 @@ struct SignalHandlersInfo { }; static Singleton s_signals; -SignalHandlersInfo* signals_info() +static SignalHandlersInfo* signals_info() { return s_signals.ptr(); } diff --git a/Ladybird/Qt/EventLoopImplementationQt.cpp b/Ladybird/Qt/EventLoopImplementationQt.cpp index fcd70bbd165..7c5276863f9 100644 --- a/Ladybird/Qt/EventLoopImplementationQt.cpp +++ b/Ladybird/Qt/EventLoopImplementationQt.cpp @@ -94,7 +94,7 @@ struct SignalHandlersInfo { }; static Singleton s_signals; -SignalHandlersInfo* signals_info() +static SignalHandlersInfo* signals_info() { return s_signals.ptr(); } diff --git a/Ladybird/Qt/InspectorWidget.h b/Ladybird/Qt/InspectorWidget.h index 88110769ad0..59268212aed 100644 --- a/Ladybird/Qt/InspectorWidget.h +++ b/Ladybird/Qt/InspectorWidget.h @@ -35,7 +35,7 @@ public slots: void device_pixel_ratio_changed(qreal dpi); private: - bool event(QEvent*) override; + virtual bool event(QEvent*) override; void closeEvent(QCloseEvent*) override; QScreen* m_current_screen; diff --git a/Ladybird/Qt/TabBar.h b/Ladybird/Qt/TabBar.h index 75cde7fa79e..dfff7e66e72 100644 --- a/Ladybird/Qt/TabBar.h +++ b/Ladybird/Qt/TabBar.h @@ -42,7 +42,7 @@ public: explicit TabBarButton(QIcon const& icon, QWidget* parent = nullptr); protected: - bool event(QEvent* event); + virtual bool event(QEvent* event) override; }; } diff --git a/Ladybird/Qt/main.cpp b/Ladybird/Qt/main.cpp index a85969185ea..7347d6c2b87 100644 --- a/Ladybird/Qt/main.cpp +++ b/Ladybird/Qt/main.cpp @@ -30,6 +30,8 @@ namespace Ladybird { +// FIXME: Find a place to put this declaration (and other helper functions). +bool is_using_dark_system_theme(QWidget&); bool is_using_dark_system_theme(QWidget& widget) { // FIXME: Qt does not provide any method to query if the system is using a dark theme. We will have to implement diff --git a/Ladybird/RequestServer/main.cpp b/Ladybird/RequestServer/main.cpp index 90544511bcd..47a894fbf69 100644 --- a/Ladybird/RequestServer/main.cpp +++ b/Ladybird/RequestServer/main.cpp @@ -23,7 +23,7 @@ # include #endif -ErrorOr find_certificates(StringView serenity_resource_root) +static ErrorOr find_certificates(StringView serenity_resource_root) { auto cert_path = ByteString::formatted("{}/ladybird/cacert.pem", serenity_resource_root); if (!FileSystem::exists(cert_path)) diff --git a/Meta/CMake/common_compile_options.cmake b/Meta/CMake/common_compile_options.cmake index 7f6cdd646d1..5dbe15ed898 100644 --- a/Meta/CMake/common_compile_options.cmake +++ b/Meta/CMake/common_compile_options.cmake @@ -22,6 +22,7 @@ endif() add_compile_options(-Wcast-qual) add_compile_options(-Wformat=2) add_compile_options(-Wimplicit-fallthrough) +add_compile_options(-Wmissing-declarations) add_compile_options(-Wsuggest-override) add_compile_options(-Wno-invalid-offsetof) @@ -43,6 +44,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_SIMULATE_ID MATCHES # Clang's default constexpr-steps limit is 1048576(2^20), GCC doesn't have one add_compile_options(-fconstexpr-steps=16777216) + add_compile_options(-Wmissing-prototypes) + add_compile_options(-Wno-implicit-const-int-float-conversion) add_compile_options(-Wno-user-defined-literals) add_compile_options(-Wno-vla-cxx-extension) diff --git a/Meta/Lagom/Fuzzers/CMakeLists.txt b/Meta/Lagom/Fuzzers/CMakeLists.txt index da28471985c..bfc3266340f 100644 --- a/Meta/Lagom/Fuzzers/CMakeLists.txt +++ b/Meta/Lagom/Fuzzers/CMakeLists.txt @@ -19,6 +19,12 @@ function(add_simple_fuzzer name) target_sources(${name} PRIVATE "EntryShim.cpp") target_link_libraries(${name} PUBLIC ${ARGN} AK LibCore) endif() + + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$") + target_compile_options(${name} PRIVATE -Wno-missing-prototypes) + else() + target_compile_options(${name} PRIVATE -Wno-missing-declarations) + endif() endfunction() include(fuzzers.cmake) diff --git a/Meta/Lagom/Fuzzers/FuzzilliJs.cpp b/Meta/Lagom/Fuzzers/FuzzilliJs.cpp index 4d1feee9747..2300130ff90 100644 --- a/Meta/Lagom/Fuzzers/FuzzilliJs.cpp +++ b/Meta/Lagom/Fuzzers/FuzzilliJs.cpp @@ -24,6 +24,13 @@ #include #include +// These are hooks into sancov's internals, their declaration isn't available in public headers. +// See compiler-rt/lib/sanitizer_common/sanitizer_interface_internal.h +extern "C" { +void __sanitizer_cov_trace_pc_guard_init(uint32_t*, uint32_t*); +void __sanitizer_cov_trace_pc_guard(uint32_t*); +} + // // BEGIN FUZZING CODE // @@ -51,7 +58,7 @@ struct shmem_data { struct shmem_data* __shmem; uint32_t *__edges_start, *__edges_stop; -void __sanitizer_cov_reset_edgeguards() +static void __sanitizer_cov_reset_edgeguards() { uint64_t N = 0; for (uint32_t* x = __edges_start; x < __edges_stop && N < MAX_EDGES; x++) diff --git a/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp index ba0e5d28767..77dfc418ef5 100644 --- a/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp @@ -16,6 +16,7 @@ #include #include +namespace { struct Parameter { Vector attributes; ByteString type; @@ -823,6 +824,7 @@ void build(StringBuilder& builder, Vector const& endpoints) for (auto const& endpoint : endpoints) build_endpoint(generator.fork(), endpoint); } +} // end anonymous namespace ErrorOr serenity_main(Main::Arguments arguments) { diff --git a/Meta/Lagom/Tools/CodeGenerators/LibTextCodec/GenerateEncodingIndexes.cpp b/Meta/Lagom/Tools/CodeGenerators/LibTextCodec/GenerateEncodingIndexes.cpp index 6567471f214..0c64138f25a 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibTextCodec/GenerateEncodingIndexes.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibTextCodec/GenerateEncodingIndexes.cpp @@ -15,6 +15,7 @@ #include #include +namespace { struct LookupTable { u32 first_pointer; u32 max_code_point; @@ -175,6 +176,7 @@ namespace TextCodec { TRY(file.write_until_depleted(generator.as_string_view().bytes())); return {}; } +} // end anonymous namespace ErrorOr serenity_main(Main::Arguments arguments) { diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index ece6ecf9fb6..2f614997b44 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -10,6 +10,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include "IDLGenerators.h" #include "Namespaces.h" #include #include @@ -17,10 +18,10 @@ #include #include -Vector s_header_search_paths; - namespace IDL { +Vector g_header_search_paths; + // FIXME: Generate this automatically somehow. static bool is_platform_object(Type const& type) { @@ -284,7 +285,7 @@ static void generate_include_for(auto& generator, auto& path) { auto forked_generator = generator.fork(); auto path_string = path; - for (auto& search_path : s_header_search_paths) { + for (auto& search_path : g_header_search_paths) { if (!path.starts_with(search_path)) continue; auto relative_path = LexicalPath::relative_path(path, search_path); diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.h b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.h new file mode 100644 index 00000000000..9d36ab176c7 --- /dev/null +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2020-2023, Andreas Kling + * Copyright (c) 2021-2023, Linus Groh + * Copyright (c) 2021-2023, Luke Wilde + * Copyright (c) 2022, Ali Mohammad Pur + * Copyright (c) 2023-2024, Kenneth Myhra + * Copyright (c) 2023-2024, Shannon Booth + * Copyright (c) 2023-2024, Matthew Olsson + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include +#include + +namespace IDL { + +void generate_namespace_header(IDL::Interface const&, StringBuilder&); +void generate_namespace_implementation(IDL::Interface const&, StringBuilder&); +void generate_constructor_header(IDL::Interface const&, StringBuilder&); +void generate_constructor_implementation(IDL::Interface const&, StringBuilder&); +void generate_prototype_header(IDL::Interface const&, StringBuilder&); +void generate_prototype_implementation(IDL::Interface const&, StringBuilder&); +void generate_iterator_prototype_header(IDL::Interface const&, StringBuilder&); +void generate_iterator_prototype_implementation(IDL::Interface const&, StringBuilder&); +void generate_global_mixin_header(IDL::Interface const&, StringBuilder&); +void generate_global_mixin_implementation(IDL::Interface const&, StringBuilder&); + +extern Vector g_header_search_paths; + +} diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp index 9b4f328b728..f16ea469fce 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp @@ -8,6 +8,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include "IDLGenerators.h" #include "Namespaces.h" #include #include @@ -16,21 +17,6 @@ #include #include -extern Vector s_header_search_paths; - -namespace IDL { -void generate_namespace_header(IDL::Interface const&, StringBuilder&); -void generate_namespace_implementation(IDL::Interface const&, StringBuilder&); -void generate_constructor_header(IDL::Interface const&, StringBuilder&); -void generate_constructor_implementation(IDL::Interface const&, StringBuilder&); -void generate_prototype_header(IDL::Interface const&, StringBuilder&); -void generate_prototype_implementation(IDL::Interface const&, StringBuilder&); -void generate_iterator_prototype_header(IDL::Interface const&, StringBuilder&); -void generate_iterator_prototype_implementation(IDL::Interface const&, StringBuilder&); -void generate_global_mixin_header(IDL::Interface const&, StringBuilder&); -void generate_global_mixin_implementation(IDL::Interface const&, StringBuilder&); -} - ErrorOr serenity_main(Main::Arguments arguments) { Core::ArgsParser args_parser; @@ -47,7 +33,7 @@ ErrorOr serenity_main(Main::Arguments arguments) .short_name = 'i', .value_name = "path", .accept_value = [&](StringView s) { - s_header_search_paths.append(s); + IDL::g_header_search_paths.append(s); return true; }, }); diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateAriaRoles.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateAriaRoles.cpp index 0c6957bc8f2..870d9d09c1e 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateAriaRoles.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateAriaRoles.cpp @@ -10,34 +10,7 @@ #include #include -ErrorOr generate_header_file(JsonObject& roles_data, Core::File& file); -ErrorOr generate_implementation_file(JsonObject& roles_data, Core::File& file); - -ErrorOr serenity_main(Main::Arguments arguments) -{ - StringView generated_header_path; - StringView generated_implementation_path; - StringView identifiers_json_path; - - Core::ArgsParser args_parser; - args_parser.add_option(generated_header_path, "Path to the TransformFunctions header file to generate", "generated-header-path", 'h', "generated-header-path"); - args_parser.add_option(generated_implementation_path, "Path to the TransformFunctions implementation file to generate", "generated-implementation-path", 'c', "generated-implementation-path"); - args_parser.add_option(identifiers_json_path, "Path to the JSON file to read from", "json-path", 'j', "json-path"); - args_parser.parse(arguments); - - auto json = TRY(read_entire_file_as_json(identifiers_json_path)); - VERIFY(json.is_object()); - auto roles_data = json.as_object(); - - auto generated_header_file = TRY(Core::File::open(generated_header_path, Core::File::OpenMode::Write)); - auto generated_implementation_file = TRY(Core::File::open(generated_implementation_path, Core::File::OpenMode::Write)); - - TRY(generate_header_file(roles_data, *generated_header_file)); - TRY(generate_implementation_file(roles_data, *generated_implementation_file)); - - return 0; -} - +namespace { ErrorOr generate_header_file(JsonObject& roles_data, Core::File& file) { StringBuilder builder; @@ -387,3 +360,29 @@ NameFromSource @name@::name_from_source() const TRY(file.write_until_depleted(generator.as_string_view().bytes())); return {}; } +} // end anonymous namespace + +ErrorOr serenity_main(Main::Arguments arguments) +{ + StringView generated_header_path; + StringView generated_implementation_path; + StringView identifiers_json_path; + + Core::ArgsParser args_parser; + args_parser.add_option(generated_header_path, "Path to the TransformFunctions header file to generate", "generated-header-path", 'h', "generated-header-path"); + args_parser.add_option(generated_implementation_path, "Path to the TransformFunctions implementation file to generate", "generated-implementation-path", 'c', "generated-implementation-path"); + args_parser.add_option(identifiers_json_path, "Path to the JSON file to read from", "json-path", 'j', "json-path"); + args_parser.parse(arguments); + + auto json = TRY(read_entire_file_as_json(identifiers_json_path)); + VERIFY(json.is_object()); + auto roles_data = json.as_object(); + + auto generated_header_file = TRY(Core::File::open(generated_header_path, Core::File::OpenMode::Write)); + auto generated_implementation_file = TRY(Core::File::open(generated_implementation_path, Core::File::OpenMode::Write)); + + TRY(generate_header_file(roles_data, *generated_header_file)); + TRY(generate_implementation_file(roles_data, *generated_implementation_file)); + + return 0; +} diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMathFunctions.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMathFunctions.cpp index f045518effc..a7646dc1448 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMathFunctions.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMathFunctions.cpp @@ -10,34 +10,7 @@ #include #include -ErrorOr generate_header_file(JsonObject& functions_data, Core::File& file); -ErrorOr generate_implementation_file(JsonObject& functions_data, Core::File& file); - -ErrorOr serenity_main(Main::Arguments arguments) -{ - StringView generated_header_path; - StringView generated_implementation_path; - StringView identifiers_json_path; - - Core::ArgsParser args_parser; - args_parser.add_option(generated_header_path, "Path to the MathFunctions header file to generate", "generated-header-path", 'h', "generated-header-path"); - args_parser.add_option(generated_implementation_path, "Path to the MathFunctions implementation file to generate", "generated-implementation-path", 'c', "generated-implementation-path"); - args_parser.add_option(identifiers_json_path, "Path to the JSON file to read from", "json-path", 'j', "json-path"); - args_parser.parse(arguments); - - auto json = TRY(read_entire_file_as_json(identifiers_json_path)); - VERIFY(json.is_object()); - auto math_functions_data = json.as_object(); - - auto generated_header_file = TRY(Core::File::open(generated_header_path, Core::File::OpenMode::Write)); - auto generated_implementation_file = TRY(Core::File::open(generated_implementation_path, Core::File::OpenMode::Write)); - - TRY(generate_header_file(math_functions_data, *generated_header_file)); - TRY(generate_implementation_file(math_functions_data, *generated_implementation_file)); - - return 0; -} - +namespace { ErrorOr generate_header_file(JsonObject& functions_data, Core::File& file) { StringBuilder builder; @@ -378,3 +351,29 @@ OwnPtr Parser::parse_math_function(PropertyID property_id, Func TRY(file.write_until_depleted(generator.as_string_view().bytes())); return {}; } +} // end anonymous namespace + +ErrorOr serenity_main(Main::Arguments arguments) +{ + StringView generated_header_path; + StringView generated_implementation_path; + StringView identifiers_json_path; + + Core::ArgsParser args_parser; + args_parser.add_option(generated_header_path, "Path to the MathFunctions header file to generate", "generated-header-path", 'h', "generated-header-path"); + args_parser.add_option(generated_implementation_path, "Path to the MathFunctions implementation file to generate", "generated-implementation-path", 'c', "generated-implementation-path"); + args_parser.add_option(identifiers_json_path, "Path to the JSON file to read from", "json-path", 'j', "json-path"); + args_parser.parse(arguments); + + auto json = TRY(read_entire_file_as_json(identifiers_json_path)); + VERIFY(json.is_object()); + auto math_functions_data = json.as_object(); + + auto generated_header_file = TRY(Core::File::open(generated_header_path, Core::File::OpenMode::Write)); + auto generated_implementation_file = TRY(Core::File::open(generated_implementation_path, Core::File::OpenMode::Write)); + + TRY(generate_header_file(math_functions_data, *generated_header_file)); + TRY(generate_implementation_file(math_functions_data, *generated_implementation_file)); + + return 0; +} diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GeneratorUtil.h b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GeneratorUtil.h index 28c1b77d31f..708832679d4 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GeneratorUtil.h +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GeneratorUtil.h @@ -13,7 +13,7 @@ #include #include -String title_casify(StringView dashy_name) +inline String title_casify(StringView dashy_name) { auto parts = dashy_name.split_view('-'); StringBuilder builder; @@ -28,7 +28,7 @@ String title_casify(StringView dashy_name) return MUST(builder.to_string()); } -String camel_casify(StringView dashy_name) +inline String camel_casify(StringView dashy_name) { auto parts = dashy_name.split_view('-'); StringBuilder builder; @@ -49,14 +49,14 @@ String camel_casify(StringView dashy_name) return MUST(builder.to_string()); } -String snake_casify(StringView dashy_name) +inline String snake_casify(StringView dashy_name) { // FIXME: We don't really need to convert dashy_name to a String first, but currently // all the `replace` functions that take a StringView return ByteString. return MUST(MUST(String::from_utf8(dashy_name)).replace("-"sv, "_"sv, ReplaceMode::All)); } -ErrorOr read_entire_file_as_json(StringView filename) +inline ErrorOr read_entire_file_as_json(StringView filename) { auto file = TRY(Core::File::open(filename, Core::File::OpenMode::Read)); auto json_size = TRY(file->size()); diff --git a/Tests/LibJS/test262-runner.cpp b/Tests/LibJS/test262-runner.cpp index 0d318c677e6..93c739355e8 100644 --- a/Tests/LibJS/test262-runner.cpp +++ b/Tests/LibJS/test262-runner.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -544,7 +543,15 @@ static bool g_in_assert = false; // FIXME: Use a SIGABRT handler here instead of overriding internal libc assertion handlers. // Fixing this will likely require updating the test driver as well to pull the assertion failure // message out of stderr rather than from the json object printed to stdout. -#ifdef ASSERT_FAIL_HAS_INT /* Set by CMake */ +// FIXME: This likely doesn't even work with our custom ak_verification_failed handler +#pragma push_macro("NDEBUG") +// Apple headers do not expose the declaration of __assert_rtn when NDEBUG is set. +#undef NDEBUG +#include + +#ifdef AK_OS_MACOS +extern "C" __attribute__((__noreturn__)) void __assert_rtn(char const* function, char const* file, int line, char const* assertion) +#elifdef ASSERT_FAIL_HAS_INT /* Set by CMake */ extern "C" __attribute__((__noreturn__)) void __assert_fail(char const* assertion, char const* file, int line, char const* function) #else extern "C" __attribute__((__noreturn__)) void __assert_fail(char const* assertion, char const* file, unsigned int line, char const* function) @@ -553,6 +560,7 @@ extern "C" __attribute__((__noreturn__)) void __assert_fail(char const* assertio auto full_message = ByteString::formatted("{}:{}: {}: Assertion `{}' failed.", file, line, function, assertion); handle_failed_assert(full_message.characters()); } +#pragma pop_macro("NDEBUG") constexpr int exit_wrong_arguments = 2; constexpr int exit_stdout_setup_failed = 1; diff --git a/Userland/Libraries/LibCore/VulkanContext.cpp b/Userland/Libraries/LibCore/VulkanContext.cpp index e1525b41555..32d5331fee8 100644 --- a/Userland/Libraries/LibCore/VulkanContext.cpp +++ b/Userland/Libraries/LibCore/VulkanContext.cpp @@ -10,7 +10,7 @@ namespace Core { -ErrorOr create_instance(uint32_t api_version) +static ErrorOr create_instance(uint32_t api_version) { VkInstance instance; @@ -35,7 +35,7 @@ ErrorOr create_instance(uint32_t api_version) return instance; } -ErrorOr pick_physical_device(VkInstance instance) +static ErrorOr pick_physical_device(VkInstance instance) { uint32_t device_count = 0; vkEnumeratePhysicalDevices(instance, &device_count, nullptr); @@ -65,7 +65,7 @@ ErrorOr pick_physical_device(VkInstance instance) VERIFY_NOT_REACHED(); } -ErrorOr create_logical_device(VkPhysicalDevice physical_device) +static ErrorOr create_logical_device(VkPhysicalDevice physical_device) { VkDevice device; diff --git a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp index 956e9144c80..5c811f4d725 100644 --- a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp @@ -876,7 +876,7 @@ inline void fast_typed_array_set_element(TypedArrayBase& typed_array, u32 index, *slot = value; } -Completion throw_null_or_undefined_property_get(VM& vm, Value base_value, Optional base_identifier, IdentifierTableIndex property_identifier, Executable const& executable) +static Completion throw_null_or_undefined_property_get(VM& vm, Value base_value, Optional base_identifier, IdentifierTableIndex property_identifier, Executable const& executable) { VERIFY(base_value.is_nullish()); @@ -885,7 +885,7 @@ Completion throw_null_or_undefined_property_get(VM& vm, Value base_value, Option return vm.throw_completion(ErrorType::ToObjectNullOrUndefinedWithProperty, executable.get_identifier(property_identifier), base_value); } -Completion throw_null_or_undefined_property_get(VM& vm, Value base_value, Optional base_identifier, Value property, Executable const& executable) +static Completion throw_null_or_undefined_property_get(VM& vm, Value base_value, Optional base_identifier, Value property, Executable const& executable) { VERIFY(base_value.is_nullish()); diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 04a71889be2..e774f1940d5 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -594,7 +594,7 @@ DOMTokenList* Element::class_list() } // https://dom.spec.whatwg.org/#valid-shadow-host-name -bool is_valid_shadow_host_name(FlyString const& name) +static bool is_valid_shadow_host_name(FlyString const& name) { // A valid shadow host name is: // - a valid custom element name diff --git a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp index faab1081e73..a5bd6ec3ea2 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp @@ -839,7 +839,7 @@ CommandResult DisplayListPlayerSkia::fill_path_using_color(FillPathUsingColor co return CommandResult::Continue; } -SkTileMode to_skia_tile_mode(SVGLinearGradientPaintStyle::SpreadMethod spread_method) +static SkTileMode to_skia_tile_mode(SVGLinearGradientPaintStyle::SpreadMethod spread_method) { switch (spread_method) { case SVGLinearGradientPaintStyle::SpreadMethod::Pad: @@ -853,7 +853,7 @@ SkTileMode to_skia_tile_mode(SVGLinearGradientPaintStyle::SpreadMethod spread_me } } -SkPaint paint_style_to_skia_paint(Painting::SVGGradientPaintStyle const& paint_style, Gfx::FloatRect bounding_rect) +static SkPaint paint_style_to_skia_paint(Painting::SVGGradientPaintStyle const& paint_style, Gfx::FloatRect bounding_rect) { SkPaint paint; diff --git a/Userland/Libraries/LibWeb/WebIDL/Tracing.h b/Userland/Libraries/LibWeb/WebIDL/Tracing.h index 6a4ba27d29b..de43e98adc6 100644 --- a/Userland/Libraries/LibWeb/WebIDL/Tracing.h +++ b/Userland/Libraries/LibWeb/WebIDL/Tracing.h @@ -12,9 +12,10 @@ namespace Web::WebIDL { extern bool g_enable_idl_tracing; +void log_trace_impl(JS::VM&, char const*); + inline void log_trace(JS::VM& vm, char const* function) { - void log_trace_impl(JS::VM&, char const*); if (g_enable_idl_tracing) log_trace_impl(vm, function); }