1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:57:35 +00:00

Everywhere: Run clang-format

This commit is contained in:
Idan Horowitz 2022-04-01 20:58:27 +03:00 committed by Linus Groh
parent 0376c127f6
commit 086969277e
1665 changed files with 8479 additions and 8479 deletions

View file

@ -12,9 +12,9 @@
#include <sys/stat.h>
#include <unistd.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size);
int fuzz_from_file(const char* filename)
int fuzz_from_file(char const* filename)
{
struct stat file_stats;

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
(void)TLS::Certificate::parse_asn1({ data, size });

View file

@ -7,7 +7,7 @@
#include <LibGfx/BMPLoader.h>
#include <stdio.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Gfx::BMPImageDecoderPlugin decoder(data, size);
(void)decoder.frame(0);

View file

@ -9,7 +9,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto* decoder = TextCodec::decoder_for("windows-1251");
VERIFY(decoder);

View file

@ -7,7 +7,7 @@
#include <LibCompress/Deflate.h>
#include <stdio.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto result = Compress::DeflateCompressor::compress_all(ReadonlyBytes { data, size });
return result.has_value();

View file

@ -7,7 +7,7 @@
#include <LibCompress/Deflate.h>
#include <stdio.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto result = Compress::DeflateDecompressor::decompress_all(ReadonlyBytes { data, size });
return result.has_value();

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
ELF::Image elf(data, size, /*verbose_logging=*/false);
return 0;

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto flac_data = ByteBuffer::copy(data, size).release_value();
auto flac = make<Audio::FlacLoaderPlugin>(flac_data);

View file

@ -11,7 +11,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Gfx::GIFImageDecoderPlugin gif_decoder(data, size);
auto bitmap_or_error = gif_decoder.frame(0);

View file

@ -10,9 +10,9 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto gemini = StringView(static_cast<const unsigned char*>(data), size);
auto gemini = StringView(static_cast<unsigned char const*>(data), size);
(void)Gemini::Document::parse(gemini, {});
return 0;
}

View file

@ -7,7 +7,7 @@
#include <LibCompress/Gzip.h>
#include <stdio.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto result = Compress::GzipCompressor::compress_all(ReadonlyBytes { data, size });
return result.has_value();

View file

@ -7,7 +7,7 @@
#include <LibCompress/Gzip.h>
#include <stdio.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto result = Compress::GzipDecompressor::decompress_all(ReadonlyBytes { data, size });
return result.has_value();

View file

@ -9,7 +9,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto* decoder = TextCodec::decoder_for("windows-1255");
VERIFY(decoder);

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto request_wrapper = HTTP::HttpRequest::from_raw_request(ReadonlyBytes { data, size });
if (!request_wrapper.has_value())

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Gfx::ICOImageDecoderPlugin decoder(data, size);
(void)decoder.frame(0);

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto parser = IMAP::Parser();
parser.parse(ByteBuffer::copy(data, size).release_value(), true);

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Gfx::JPGImageDecoderPlugin decoder(data, size);
(void)decoder.frame(0);

View file

@ -12,9 +12,9 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto js = StringView(static_cast<const unsigned char*>(data), size);
auto js = StringView(static_cast<unsigned char const*>(data), size);
auto vm = JS::VM::create();
auto interpreter = JS::Interpreter::create<JS::GlobalObject>(*vm);
auto parse_result = JS::Script::parse(js, interpreter->realm());

View file

@ -9,7 +9,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto* decoder = TextCodec::decoder_for("windows-1252");
VERIFY(decoder);

View file

@ -9,7 +9,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto* decoder = TextCodec::decoder_for("iso-8859-2");
VERIFY(decoder);

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Crypto::Hash::MD5::hash(data, size);
return 0;

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto flac_data = ByteBuffer::copy(data, size).release_value();
auto mp3 = make<Audio::MP3LoaderPlugin>(flac_data);

View file

@ -10,9 +10,9 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto markdown = StringView(static_cast<const unsigned char*>(data), size);
auto markdown = StringView(static_cast<unsigned char const*>(data), size);
(void)Markdown::Document::parse(markdown);
return 0;
}

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Gfx::PBMImageDecoderPlugin decoder(data, size);
(void)decoder.frame(0);

View file

@ -7,7 +7,7 @@
#include <LibPDF/Document.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
ReadonlyBytes bytes { data, size };

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
(void)Crypto::decode_pem({ data, size });
return 0;

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Gfx::PGMImageDecoderPlugin decoder(data, size);
(void)decoder.frame(0);

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Gfx::PNGImageDecoderPlugin decoder(data, size);
(void)decoder.frame(0);

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Gfx::PPMImageDecoderPlugin decoder(data, size);
(void)decoder.frame(0);

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Crypto::PK::RSA::parse_rsa_key({ data, size });
return 0;

View file

@ -9,9 +9,9 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto pattern = StringView(static_cast<const unsigned char*>(data), size);
auto pattern = StringView(static_cast<unsigned char const*>(data), size);
[[maybe_unused]] auto re = Regex<ECMA262>(pattern);
return 0;
}

View file

@ -9,9 +9,9 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto pattern = StringView(static_cast<const unsigned char*>(data), size);
auto pattern = StringView(static_cast<unsigned char const*>(data), size);
[[maybe_unused]] auto re = Regex<PosixBasic>(pattern);
return 0;
}

View file

@ -9,9 +9,9 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto pattern = StringView(static_cast<const unsigned char*>(data), size);
auto pattern = StringView(static_cast<unsigned char const*>(data), size);
[[maybe_unused]] auto re = Regex<PosixExtended>(pattern);
return 0;
}

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Crypto::Hash::SHA1::hash(data, size);
return 0;

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Crypto::Hash::SHA256::hash(data, size);
return 0;

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Crypto::Hash::SHA384::hash(data, size);
return 0;

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
Crypto::Hash::SHA512::hash(data, size);
return 0;

View file

@ -8,7 +8,7 @@
#include <LibSQL/AST/Parser.h>
#include <stdio.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto parser = SQL::AST::Parser(SQL::AST::Lexer({ data, size }));
[[maybe_unused]] auto statement = parser.next_statement();

View file

@ -9,9 +9,9 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto source = StringView(static_cast<const unsigned char*>(data), size);
auto source = StringView(static_cast<unsigned char const*>(data), size);
Shell::Parser parser(source);
(void)parser.parse();
return 0;

View file

@ -6,7 +6,7 @@
#include <AK/URL.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto string_view = StringView(data, size);
auto url = URL(string_view);

View file

@ -9,7 +9,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto* decoder = TextCodec::decoder_for("utf-16be");
VERIFY(decoder);

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
if (!data)
return 0;

View file

@ -10,7 +10,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
ReadonlyBytes bytes { data, size };
InputMemoryStream stream { bytes };

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto zip_file = Archive::Zip::try_create({ data, size });
if (!zip_file.has_value())

View file

@ -7,7 +7,7 @@
#include <LibCompress/Zlib.h>
#include <stdio.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto result = Compress::Zlib::decompress_all(ReadonlyBytes { data, size });
return result.has_value();

View file

@ -73,7 +73,7 @@ extern "C" void __sanitizer_cov_trace_pc_guard_init(uint32_t* start, uint32_t* s
__edges_stop = stop;
// Map the shared memory region
const char* shm_key = getenv("SHM_ID");
char const* shm_key = getenv("SHM_ID");
if (!shm_key) {
puts("[COV] no shared memory bitmap available, skipping");
__shmem = (struct shmem_data*)malloc(SHM_SIZE);
@ -205,7 +205,7 @@ int main(int, char**)
int result = 0;
auto js = StringView(static_cast<const unsigned char*>(data_buffer.data()), script_size);
auto js = StringView(static_cast<unsigned char const*>(data_buffer.data()), script_size);
auto parse_result = JS::Script::parse(js, interpreter->realm());
if (parse_result.is_error()) {

View file

@ -282,7 +282,7 @@ String constructor_for_message(String const& name, Vector<Parameter> const& para
return builder.to_string();
}
void do_message(SourceGenerator message_generator, const String& name, const Vector<Parameter>& parameters, const String& response_type = {})
void do_message(SourceGenerator message_generator, String const& name, Vector<Parameter> const& parameters, String const& response_type = {})
{
auto pascal_name = pascal_case(name);
message_generator.set("message.name", name);
@ -598,7 +598,7 @@ public:
switch (message_id) {)~~~");
for (auto const& message : endpoint.messages) {
auto do_decode_message = [&](const String& name) {
auto do_decode_message = [&](String const& name) {
auto message_generator = generator.fork();
message_generator.set("message.name", name);

View file

@ -125,7 +125,7 @@ static ErrorOr<HashMap<String, PnpIdData>> parse_pnp_ids_database(Core::File& pn
HashMap<String, PnpIdData> pnp_id_data;
for (size_t row_content_offset = 0;;) {
static const auto row_start_tag = "<tr class=\""sv;
static auto const row_start_tag = "<tr class=\""sv;
auto row_start = pnp_ids_file_contents.find(row_start_tag, row_content_offset);
if (!row_start.has_value())
break;
@ -134,7 +134,7 @@ static ErrorOr<HashMap<String, PnpIdData>> parse_pnp_ids_database(Core::File& pn
if (!row_start_tag_end.has_value())
return Error::from_string_literal("Incomplete row start tag"sv);
static const auto row_end_tag = "</tr>"sv;
static auto const row_end_tag = "</tr>"sv;
auto row_end = pnp_ids_file_contents.find(row_end_tag, row_start.value());
if (!row_end.has_value())
return Error::from_string_literal("No matching row end tag found"sv);
@ -145,12 +145,12 @@ static ErrorOr<HashMap<String, PnpIdData>> parse_pnp_ids_database(Core::File& pn
auto row_string = pnp_ids_file_contents.substring_view(row_start_tag_end.value() + 1, row_end.value() - row_start_tag_end.value() - 1);
Vector<String, (size_t)PnpIdColumns::ColumnCount> columns;
for (size_t column_row_offset = 0;;) {
static const auto column_start_tag = "<td>"sv;
static auto const column_start_tag = "<td>"sv;
auto column_start = row_string.find(column_start_tag, column_row_offset);
if (!column_start.has_value())
break;
static const auto column_end_tag = "</td>"sv;
static auto const column_end_tag = "</td>"sv;
auto column_end = row_string.find(column_end_tag, column_start.value() + column_start_tag.length());
if (!column_end.has_value())
return Error::from_string_literal("No matching column end tag found"sv);

View file

@ -211,12 +211,12 @@ parse_state_machine(StringView input)
return state_machine;
}
void output_header(const StateMachine&, SourceGenerator&);
void output_header(StateMachine const&, SourceGenerator&);
int main(int argc, char** argv)
{
Core::ArgsParser args_parser;
const char* path = nullptr;
char const* path = nullptr;
args_parser.add_positional_argument(path, "Path to parser description", "input", Core::ArgsParser::Required::Yes);
args_parser.parse(argc, argv);
@ -235,11 +235,11 @@ int main(int argc, char** argv)
return 0;
}
HashTable<String> actions(const StateMachine& machine)
HashTable<String> actions(StateMachine const& machine)
{
HashTable<String> table;
auto do_state = [&](const State& state) {
auto do_state = [&](State const& state) {
if (state.entry_action.has_value())
table.set(state.entry_action.value());
if (state.exit_action.has_value())
@ -257,13 +257,13 @@ HashTable<String> actions(const StateMachine& machine)
return table;
}
void generate_lookup_table(const StateMachine& machine, SourceGenerator& generator)
void generate_lookup_table(StateMachine const& machine, SourceGenerator& generator)
{
generator.append(R"~~~(
static constexpr StateTransition STATE_TRANSITION_TABLE[][256] = {
)~~~");
auto generate_for_state = [&](const State& s) {
auto generate_for_state = [&](State const& s) {
auto table_generator = generator.fork();
table_generator.set("active_state", s.name);
table_generator.append("/* @active_state@ */ { ");
@ -295,7 +295,7 @@ void generate_lookup_table(const StateMachine& machine, SourceGenerator& generat
)~~~");
}
void output_header(const StateMachine& machine, SourceGenerator& generator)
void output_header(StateMachine const& machine, SourceGenerator& generator)
{
generator.set("class_name", machine.name);
generator.set("initial_state", machine.initial_state);