From 731faad67c4845f4700d707e5dbf1f8695c74d47 Mon Sep 17 00:00:00 2001 From: mkaruza Date: Mon, 16 Dec 2024 09:00:04 +0100 Subject: [PATCH] Remove unused attribute and instead don't name unused input argument --- src/catalog/pgduckdb_table.cpp | 8 +++----- src/scan/postgres_scan.cpp | 16 +++++++--------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/catalog/pgduckdb_table.cpp b/src/catalog/pgduckdb_table.cpp index 6c348699..61cc0619 100644 --- a/src/catalog/pgduckdb_table.cpp +++ b/src/catalog/pgduckdb_table.cpp @@ -56,20 +56,18 @@ PostgresTable::GetTableCardinality(Relation rel) { } duckdb::unique_ptr -PostgresTable::GetStatistics(__attribute__((unused)) duckdb::ClientContext &context, - __attribute__((unused)) duckdb::column_t column_id) { +PostgresTable::GetStatistics(duckdb::ClientContext &, duckdb::column_t) { throw duckdb::NotImplementedException("GetStatistics not supported yet"); } duckdb::TableFunction -PostgresTable::GetScanFunction(__attribute__((unused)) duckdb::ClientContext &context, - duckdb::unique_ptr &bind_data) { +PostgresTable::GetScanFunction(duckdb::ClientContext &, duckdb::unique_ptr &bind_data) { bind_data = duckdb::make_uniq(rel, cardinality, snapshot); return PostgresScanTableFunction(); } duckdb::TableStorageInfo -PostgresTable::GetStorageInfo(__attribute__((unused)) duckdb::ClientContext &context) { +PostgresTable::GetStorageInfo(duckdb::ClientContext &) { throw duckdb::NotImplementedException("GetStorageInfo not supported yet"); } diff --git a/src/scan/postgres_scan.cpp b/src/scan/postgres_scan.cpp index 4c390d78..2c058cba 100644 --- a/src/scan/postgres_scan.cpp +++ b/src/scan/postgres_scan.cpp @@ -116,7 +116,8 @@ PostgresScanGlobalState::ConstructFullyQualifiedTableName() { quote_identifier(get_rel_name(rel->rd_rel->oid))); } -PostgresScanGlobalState::PostgresScanGlobalState(Snapshot _snapshot, Relation _rel, duckdb::TableFunctionInitInput &input) +PostgresScanGlobalState::PostgresScanGlobalState(Snapshot _snapshot, Relation _rel, + duckdb::TableFunctionInitInput &input) : snapshot(_snapshot), rel(_rel), table_tuple_desc(RelationGetDescr(rel)), count_tuples_only(false), total_row_count(0) { ConstructTableScanQuery(input); @@ -166,16 +167,14 @@ PostgresScanTableFunction::PostgresScanTableFunction() } duckdb::unique_ptr -PostgresScanTableFunction::PostgresScanInitGlobal(__attribute__((unused)) duckdb::ClientContext &context, - duckdb::TableFunctionInitInput &input) { +PostgresScanTableFunction::PostgresScanInitGlobal(duckdb::ClientContext &, duckdb::TableFunctionInitInput &input) { auto &bind_data = input.bind_data->CastNoConst(); auto global_state = duckdb::make_uniq(bind_data.snapshot, bind_data.rel, input); return global_state; } duckdb::unique_ptr -PostgresScanTableFunction::PostgresScanInitLocal(__attribute__((unused)) duckdb::ExecutionContext &context, - __attribute__((unused)) duckdb::TableFunctionInitInput &input, +PostgresScanTableFunction::PostgresScanInitLocal(duckdb::ExecutionContext &, duckdb::TableFunctionInitInput &, duckdb::GlobalTableFunctionState *gstate) { auto global_state = reinterpret_cast(gstate); return duckdb::make_uniq(global_state); @@ -189,8 +188,8 @@ SetOutputCardinality(duckdb::DataChunk &output, PostgresScanLocalState &local_st } void -PostgresScanTableFunction::PostgresScanFunction(__attribute__((unused)) duckdb::ClientContext &context, - duckdb::TableFunctionInput &data, duckdb::DataChunk &output) { +PostgresScanTableFunction::PostgresScanFunction(duckdb::ClientContext &, duckdb::TableFunctionInput &data, + duckdb::DataChunk &output) { auto &local_state = data.local_state->Cast(); /* We have exhausted table scan */ @@ -221,8 +220,7 @@ PostgresScanTableFunction::PostgresScanFunction(__attribute__((unused)) duckdb:: } duckdb::unique_ptr -PostgresScanTableFunction::PostgresScanCardinality(__attribute__((unused)) duckdb::ClientContext &context, - const duckdb::FunctionData *data) { +PostgresScanTableFunction::PostgresScanCardinality(duckdb::ClientContext &, const duckdb::FunctionData *data) { auto &bind_data = data->Cast(); return duckdb::make_uniq(bind_data.cardinality, bind_data.cardinality); }