mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
Everywhere: Remove a bunch of dead write-only variables
LLVM 15 now warns (and thus errors) about this, and there is really no point in keeping them.
This commit is contained in:
parent
643d2a683b
commit
8763dbcccc
Notes:
sideshowbarker
2024-07-18 02:13:10 +09:00
Author: https://github.com/timschumi Commit: https://github.com/SerenityOS/serenity/commit/8763dbcccc Pull-request: https://github.com/SerenityOS/serenity/pull/15233 Reviewed-by: https://github.com/BenWiederhake ✅ Reviewed-by: https://github.com/bgianfo
8 changed files with 6 additions and 18 deletions
|
@ -167,7 +167,6 @@ UNMAP_AFTER_INIT ErrorOr<NonnullOwnPtr<Partition::PartitionTable>> StorageManage
|
|||
UNMAP_AFTER_INIT void StorageManagement::enumerate_disk_partitions()
|
||||
{
|
||||
VERIFY(!m_storage_devices.is_empty());
|
||||
size_t device_index = 0;
|
||||
for (auto& device : m_storage_devices) {
|
||||
auto partition_table_or_error = try_to_initialize_partition_table(device);
|
||||
if (partition_table_or_error.is_error())
|
||||
|
@ -180,7 +179,6 @@ UNMAP_AFTER_INIT void StorageManagement::enumerate_disk_partitions()
|
|||
auto disk_partition = DiskPartition::create(device, generate_partition_minor_number(), partition_metadata.value());
|
||||
device.add_partition(disk_partition);
|
||||
}
|
||||
device_index++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -940,12 +940,10 @@ Vector<CodeComprehension::TokenInfo> CppComprehensionEngine::get_tokens_info(Str
|
|||
auto const& document = *document_ptr;
|
||||
|
||||
Vector<CodeComprehension::TokenInfo> tokens_info;
|
||||
size_t i = 0;
|
||||
for (auto const& token : document.preprocessor().unprocessed_tokens()) {
|
||||
|
||||
tokens_info.append({ get_token_semantic_type(document, token),
|
||||
token.start().line, token.start().column, token.end().line, token.end().column });
|
||||
++i;
|
||||
dbgln_if(CPP_LANGUAGE_SERVER_DEBUG, "{}: {}", token.text(), CodeComprehension::TokenInfo::type_to_string(tokens_info.last().type));
|
||||
}
|
||||
return tokens_info;
|
||||
|
|
|
@ -213,9 +213,7 @@ void AESCipher::encrypt_block(AESCipherBlock const& in, AESCipherBlock& out)
|
|||
r = dec_key.rounds() >> 1;
|
||||
|
||||
// apply the first |r - 1| rounds
|
||||
auto i { 0 };
|
||||
for (;;) {
|
||||
++i;
|
||||
// clang-format off
|
||||
t0 = AESTables::Encode0[(s0 >> 24) ] ^
|
||||
AESTables::Encode1[(s1 >> 16) & 0xff] ^
|
||||
|
@ -237,7 +235,6 @@ void AESCipher::encrypt_block(AESCipherBlock const& in, AESCipherBlock& out)
|
|||
|
||||
round_keys += 8;
|
||||
--r;
|
||||
++i;
|
||||
if (r == 0)
|
||||
break;
|
||||
|
||||
|
|
|
@ -79,7 +79,6 @@ public:
|
|||
if (dtd_start > offsetof(Definitions::ExtensionBlock, checksum) - sizeof(Definitions::DetailedTiming))
|
||||
return Error::from_string_literal("CEA 861 extension block has invalid DTD list");
|
||||
|
||||
size_t dtd_index = 0;
|
||||
for (size_t offset = dtd_start; offset <= offsetof(Definitions::ExtensionBlock, checksum) - sizeof(Definitions::DetailedTiming); offset += sizeof(Definitions::DetailedTiming)) {
|
||||
auto& dtd = *(Definitions::DetailedTiming const*)((u8 const*)m_block + offset);
|
||||
if (m_edid.read_host(&dtd.pixel_clock) == 0)
|
||||
|
@ -88,8 +87,6 @@ public:
|
|||
IterationDecision decision = callback(Parser::DetailedTiming(m_edid, &dtd));
|
||||
if (decision != IterationDecision::Continue)
|
||||
return decision;
|
||||
|
||||
dtd_index++;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
}
|
||||
|
|
|
@ -415,7 +415,9 @@ template<class Parser>
|
|||
bool Matcher<Parser>::execute(MatchInput const& input, MatchState& state, size_t& operations) const
|
||||
{
|
||||
BumpAllocatedLinkedList<MatchState> states_to_try_next;
|
||||
#if REGEX_DEBUG
|
||||
size_t recursion_level = 0;
|
||||
#endif
|
||||
|
||||
auto& bytecode = m_pattern->parser_result.bytecode;
|
||||
|
||||
|
@ -483,7 +485,9 @@ bool Matcher<Parser>::execute(MatchInput const& input, MatchState& state, size_t
|
|||
states_to_try_next.last().initiating_fork = state.instruction_position - opcode.size();
|
||||
}
|
||||
state.instruction_position = state.fork_at_position;
|
||||
#if REGEX_DEBUG
|
||||
++recursion_level;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
case ExecutionResult::Continue:
|
||||
|
@ -501,7 +505,9 @@ bool Matcher<Parser>::execute(MatchInput const& input, MatchState& state, size_t
|
|||
return false;
|
||||
}
|
||||
state = states_to_try_next.take_last();
|
||||
#if REGEX_DEBUG
|
||||
++recursion_level;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,11 +39,9 @@ ssize_t TLSv12::handle_certificate(ReadonlyBytes buffer)
|
|||
}
|
||||
size_t size = certificate_total_length;
|
||||
|
||||
size_t index = 0;
|
||||
bool valid_certificate = false;
|
||||
|
||||
while (size > 0) {
|
||||
++index;
|
||||
if (buffer.size() - res < 3) {
|
||||
dbgln_if(TLS_DEBUG, "not enough data for certificate length");
|
||||
return (i8)Error::NeedMoreData;
|
||||
|
@ -58,14 +56,12 @@ ssize_t TLSv12::handle_certificate(ReadonlyBytes buffer)
|
|||
|
||||
auto res_cert = res;
|
||||
auto remaining = certificate_size;
|
||||
size_t certificates_in_chain = 0;
|
||||
|
||||
do {
|
||||
if (remaining <= 3) {
|
||||
dbgln("Ran out of data");
|
||||
break;
|
||||
}
|
||||
++certificates_in_chain;
|
||||
if (buffer.size() < (size_t)res_cert + 3) {
|
||||
dbgln("not enough data to read cert size ({} < {})", buffer.size(), res_cert + 3);
|
||||
break;
|
||||
|
|
|
@ -1512,7 +1512,6 @@ void Terminal::set_size(u16 columns, u16 rows)
|
|||
if (buffer[i].length() != columns)
|
||||
lines_to_reevaluate.enqueue(i);
|
||||
}
|
||||
size_t rows_inserted = 0;
|
||||
while (!lines_to_reevaluate.is_empty()) {
|
||||
auto index = lines_to_reevaluate.dequeue();
|
||||
auto is_at_seam = index + 1 == buffer.size();
|
||||
|
@ -1524,7 +1523,6 @@ void Terminal::set_size(u16 columns, u16 rows)
|
|||
auto current_cursor = cursor_on_line(index);
|
||||
// Split the line into two (or more)
|
||||
++index;
|
||||
++rows_inserted;
|
||||
buffer.insert(index, make<Line>(0));
|
||||
VERIFY(buffer[index].length() == 0);
|
||||
line.rewrap(columns, &buffer[index], current_cursor, false);
|
||||
|
|
|
@ -76,14 +76,12 @@ void Mixer::mix()
|
|||
|
||||
m_main_volume.advance_time();
|
||||
|
||||
int active_queues = 0;
|
||||
// Mix the buffers together into the output
|
||||
for (auto& queue : active_mix_queues) {
|
||||
if (!queue->client()) {
|
||||
queue->clear();
|
||||
continue;
|
||||
}
|
||||
++active_queues;
|
||||
queue->volume().advance_time();
|
||||
|
||||
for (auto& mixed_sample : mixed_buffer) {
|
||||
|
|
Loading…
Reference in a new issue