mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +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
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()
|
UNMAP_AFTER_INIT void StorageManagement::enumerate_disk_partitions()
|
||||||
{
|
{
|
||||||
VERIFY(!m_storage_devices.is_empty());
|
VERIFY(!m_storage_devices.is_empty());
|
||||||
size_t device_index = 0;
|
|
||||||
for (auto& device : m_storage_devices) {
|
for (auto& device : m_storage_devices) {
|
||||||
auto partition_table_or_error = try_to_initialize_partition_table(device);
|
auto partition_table_or_error = try_to_initialize_partition_table(device);
|
||||||
if (partition_table_or_error.is_error())
|
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());
|
auto disk_partition = DiskPartition::create(device, generate_partition_minor_number(), partition_metadata.value());
|
||||||
device.add_partition(disk_partition);
|
device.add_partition(disk_partition);
|
||||||
}
|
}
|
||||||
device_index++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -940,12 +940,10 @@ Vector<CodeComprehension::TokenInfo> CppComprehensionEngine::get_tokens_info(Str
|
||||||
auto const& document = *document_ptr;
|
auto const& document = *document_ptr;
|
||||||
|
|
||||||
Vector<CodeComprehension::TokenInfo> tokens_info;
|
Vector<CodeComprehension::TokenInfo> tokens_info;
|
||||||
size_t i = 0;
|
|
||||||
for (auto const& token : document.preprocessor().unprocessed_tokens()) {
|
for (auto const& token : document.preprocessor().unprocessed_tokens()) {
|
||||||
|
|
||||||
tokens_info.append({ get_token_semantic_type(document, token),
|
tokens_info.append({ get_token_semantic_type(document, token),
|
||||||
token.start().line, token.start().column, token.end().line, token.end().column });
|
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));
|
dbgln_if(CPP_LANGUAGE_SERVER_DEBUG, "{}: {}", token.text(), CodeComprehension::TokenInfo::type_to_string(tokens_info.last().type));
|
||||||
}
|
}
|
||||||
return tokens_info;
|
return tokens_info;
|
||||||
|
|
|
@ -213,9 +213,7 @@ void AESCipher::encrypt_block(AESCipherBlock const& in, AESCipherBlock& out)
|
||||||
r = dec_key.rounds() >> 1;
|
r = dec_key.rounds() >> 1;
|
||||||
|
|
||||||
// apply the first |r - 1| rounds
|
// apply the first |r - 1| rounds
|
||||||
auto i { 0 };
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
++i;
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
t0 = AESTables::Encode0[(s0 >> 24) ] ^
|
t0 = AESTables::Encode0[(s0 >> 24) ] ^
|
||||||
AESTables::Encode1[(s1 >> 16) & 0xff] ^
|
AESTables::Encode1[(s1 >> 16) & 0xff] ^
|
||||||
|
@ -237,7 +235,6 @@ void AESCipher::encrypt_block(AESCipherBlock const& in, AESCipherBlock& out)
|
||||||
|
|
||||||
round_keys += 8;
|
round_keys += 8;
|
||||||
--r;
|
--r;
|
||||||
++i;
|
|
||||||
if (r == 0)
|
if (r == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,6 @@ public:
|
||||||
if (dtd_start > offsetof(Definitions::ExtensionBlock, checksum) - sizeof(Definitions::DetailedTiming))
|
if (dtd_start > offsetof(Definitions::ExtensionBlock, checksum) - sizeof(Definitions::DetailedTiming))
|
||||||
return Error::from_string_literal("CEA 861 extension block has invalid DTD list");
|
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)) {
|
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);
|
auto& dtd = *(Definitions::DetailedTiming const*)((u8 const*)m_block + offset);
|
||||||
if (m_edid.read_host(&dtd.pixel_clock) == 0)
|
if (m_edid.read_host(&dtd.pixel_clock) == 0)
|
||||||
|
@ -88,8 +87,6 @@ public:
|
||||||
IterationDecision decision = callback(Parser::DetailedTiming(m_edid, &dtd));
|
IterationDecision decision = callback(Parser::DetailedTiming(m_edid, &dtd));
|
||||||
if (decision != IterationDecision::Continue)
|
if (decision != IterationDecision::Continue)
|
||||||
return decision;
|
return decision;
|
||||||
|
|
||||||
dtd_index++;
|
|
||||||
}
|
}
|
||||||
return IterationDecision::Continue;
|
return IterationDecision::Continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -415,7 +415,9 @@ template<class Parser>
|
||||||
bool Matcher<Parser>::execute(MatchInput const& input, MatchState& state, size_t& operations) const
|
bool Matcher<Parser>::execute(MatchInput const& input, MatchState& state, size_t& operations) const
|
||||||
{
|
{
|
||||||
BumpAllocatedLinkedList<MatchState> states_to_try_next;
|
BumpAllocatedLinkedList<MatchState> states_to_try_next;
|
||||||
|
#if REGEX_DEBUG
|
||||||
size_t recursion_level = 0;
|
size_t recursion_level = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
auto& bytecode = m_pattern->parser_result.bytecode;
|
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();
|
states_to_try_next.last().initiating_fork = state.instruction_position - opcode.size();
|
||||||
}
|
}
|
||||||
state.instruction_position = state.fork_at_position;
|
state.instruction_position = state.fork_at_position;
|
||||||
|
#if REGEX_DEBUG
|
||||||
++recursion_level;
|
++recursion_level;
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case ExecutionResult::Continue:
|
case ExecutionResult::Continue:
|
||||||
|
@ -501,7 +505,9 @@ bool Matcher<Parser>::execute(MatchInput const& input, MatchState& state, size_t
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
state = states_to_try_next.take_last();
|
state = states_to_try_next.take_last();
|
||||||
|
#if REGEX_DEBUG
|
||||||
++recursion_level;
|
++recursion_level;
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,11 +39,9 @@ ssize_t TLSv12::handle_certificate(ReadonlyBytes buffer)
|
||||||
}
|
}
|
||||||
size_t size = certificate_total_length;
|
size_t size = certificate_total_length;
|
||||||
|
|
||||||
size_t index = 0;
|
|
||||||
bool valid_certificate = false;
|
bool valid_certificate = false;
|
||||||
|
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
++index;
|
|
||||||
if (buffer.size() - res < 3) {
|
if (buffer.size() - res < 3) {
|
||||||
dbgln_if(TLS_DEBUG, "not enough data for certificate length");
|
dbgln_if(TLS_DEBUG, "not enough data for certificate length");
|
||||||
return (i8)Error::NeedMoreData;
|
return (i8)Error::NeedMoreData;
|
||||||
|
@ -58,14 +56,12 @@ ssize_t TLSv12::handle_certificate(ReadonlyBytes buffer)
|
||||||
|
|
||||||
auto res_cert = res;
|
auto res_cert = res;
|
||||||
auto remaining = certificate_size;
|
auto remaining = certificate_size;
|
||||||
size_t certificates_in_chain = 0;
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (remaining <= 3) {
|
if (remaining <= 3) {
|
||||||
dbgln("Ran out of data");
|
dbgln("Ran out of data");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
++certificates_in_chain;
|
|
||||||
if (buffer.size() < (size_t)res_cert + 3) {
|
if (buffer.size() < (size_t)res_cert + 3) {
|
||||||
dbgln("not enough data to read cert size ({} < {})", buffer.size(), res_cert + 3);
|
dbgln("not enough data to read cert size ({} < {})", buffer.size(), res_cert + 3);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1512,7 +1512,6 @@ void Terminal::set_size(u16 columns, u16 rows)
|
||||||
if (buffer[i].length() != columns)
|
if (buffer[i].length() != columns)
|
||||||
lines_to_reevaluate.enqueue(i);
|
lines_to_reevaluate.enqueue(i);
|
||||||
}
|
}
|
||||||
size_t rows_inserted = 0;
|
|
||||||
while (!lines_to_reevaluate.is_empty()) {
|
while (!lines_to_reevaluate.is_empty()) {
|
||||||
auto index = lines_to_reevaluate.dequeue();
|
auto index = lines_to_reevaluate.dequeue();
|
||||||
auto is_at_seam = index + 1 == buffer.size();
|
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);
|
auto current_cursor = cursor_on_line(index);
|
||||||
// Split the line into two (or more)
|
// Split the line into two (or more)
|
||||||
++index;
|
++index;
|
||||||
++rows_inserted;
|
|
||||||
buffer.insert(index, make<Line>(0));
|
buffer.insert(index, make<Line>(0));
|
||||||
VERIFY(buffer[index].length() == 0);
|
VERIFY(buffer[index].length() == 0);
|
||||||
line.rewrap(columns, &buffer[index], current_cursor, false);
|
line.rewrap(columns, &buffer[index], current_cursor, false);
|
||||||
|
|
|
@ -76,14 +76,12 @@ void Mixer::mix()
|
||||||
|
|
||||||
m_main_volume.advance_time();
|
m_main_volume.advance_time();
|
||||||
|
|
||||||
int active_queues = 0;
|
|
||||||
// Mix the buffers together into the output
|
// Mix the buffers together into the output
|
||||||
for (auto& queue : active_mix_queues) {
|
for (auto& queue : active_mix_queues) {
|
||||||
if (!queue->client()) {
|
if (!queue->client()) {
|
||||||
queue->clear();
|
queue->clear();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
++active_queues;
|
|
||||||
queue->volume().advance_time();
|
queue->volume().advance_time();
|
||||||
|
|
||||||
for (auto& mixed_sample : mixed_buffer) {
|
for (auto& mixed_sample : mixed_buffer) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue