Skip to content

Commit

Permalink
cleanup: fix all clangd warnings
Browse files Browse the repository at this point in the history
The bulk of the warnings issued are because of unused includes, but some
are because of dead files leftover from #2246. Also, `subplans_table.h`
had a `using` directive, which caused symbol pollution.
  • Loading branch information
Riolku committed Nov 3, 2023
1 parent 7e8c9c6 commit d3a62a8
Show file tree
Hide file tree
Showing 463 changed files with 692 additions and 3,047 deletions.
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ option(ENABLE_WERROR "Treat all warnings as errors" FALSE)
if(ENABLE_WERROR)
set(CMAKE_COMPILE_WARNING_AS_ERROR TRUE)
endif()

# Detect OS and architecture, copied from DuckDB
set(OS_NAME "unknown")
set(OS_ARCH "amd64")
Expand All @@ -39,7 +38,6 @@ if(UNIX AND NOT APPLE)
set(OS_NAME "linux") # sorry BSD
endif()


if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
Expand Down Expand Up @@ -182,17 +180,17 @@ add_definitions(-DKUZU_STORAGE_VERSION="${CMAKE_PROJECT_VERSION}")
include_directories(src/include)
include_directories(third_party/antlr4_cypher/include)
include_directories(third_party/antlr4_runtime/src)
include_directories(third_party/spdlog)
include_directories(third_party/fast_float/include)
include_directories(third_party/miniparquet/src)
include_directories(third_party/miniz)
include_directories(third_party/nlohmann_json)
include_directories(third_party/pyparse)
include_directories(third_party/utf8proc/include)
include_directories(third_party/pybind11/include)
include_directories(third_party/pyparse)
include_directories(third_party/re2/include)
include_directories(third_party/serd/include)
include_directories(third_party/miniparquet/src)
include_directories(third_party/fast_float/include)
include_directories(third_party/spdlog)
include_directories(third_party/utf8proc/include)
include_directories(third_party/zstd/include)
include_directories(third_party/miniz)

add_subdirectory(third_party)
add_subdirectory(src)
Expand Down
4 changes: 3 additions & 1 deletion examples/c/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>

#include "c_api/kuzu.h"

Expand Down Expand Up @@ -32,7 +34,7 @@ int main() {
int64_t age = kuzu_value_get_int64(value);
kuzu_value_destroy(value);

printf("name: %s, age: %lld \n", name, age);
printf("name: %s, age: %" PRIi64 " \n", name, age);
free(name);
kuzu_flat_tuple_destroy(tuple);
}
Expand Down
11 changes: 9 additions & 2 deletions src/binder/bind/bind_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "common/enums/table_type.h"
#include "common/exception/binder.h"
#include "common/exception/message.h"
#include "common/exception/not_implemented.h"
#include "common/string_format.h"
#include "parser/copy.h"
#include "storage/storage_manager.h"
Expand Down Expand Up @@ -111,7 +112,9 @@ std::unique_ptr<BoundStatement> Binder::bindCopyFromClause(const Statement& stat
}
}
default:
// LCOV_EXCL_START
throw NotImplementedException("bindCopyFromClause");
// LCOV_EXCL_END
}
}

Expand Down Expand Up @@ -240,7 +243,9 @@ expression_vector Binder::bindExpectedNodeFileColumns(
}
} break;
default: {
throw NotImplementedException{"Binder::bindCopyNodeFileColumns"};
// LCOV_EXCL_START
throw NotImplementedException("Binder::bindCopyNodeFileColumns");
// LCOV_EXCL_END
}
}
// Detect columns from file.
Expand Down Expand Up @@ -299,7 +304,9 @@ expression_vector Binder::bindExpectedRelFileColumns(
}
} break;
default: {
throw NotImplementedException{"Binder::bindCopyRelColumns"};
// LCOV_EXCL_START
throw NotImplementedException("Binder::bindCopyRelColumns");
// LCOV_EXCL_END
}
}
// Detect columns from file.
Expand Down
3 changes: 3 additions & 0 deletions src/binder/bind/bind_ddl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "catalog/rel_table_group_schema.h"
#include "catalog/rel_table_schema.h"
#include "common/exception/binder.h"
#include "common/exception/not_implemented.h"
#include "common/string_format.h"
#include "common/string_utils.h"
#include "parser/ddl/alter.h"
Expand Down Expand Up @@ -277,7 +278,9 @@ std::unique_ptr<BoundStatement> Binder::bindAlter(const parser::Statement& state
return bindRenameProperty(statement);
}
default:
// LCOV_EXCL_START
throw NotImplementedException("Binder::bindAlter");
// LCOV_EXCL_END
}
}

Expand Down
1 change: 0 additions & 1 deletion src/binder/bind/bind_file_scan.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "binder/binder.h"
#include "binder/copy/bound_file_scan_info.h"
#include "binder/expression/literal_expression.h"
#include "common/exception/binder.h"
#include "common/exception/copy.h"
Expand Down
5 changes: 1 addition & 4 deletions src/binder/bind/bind_graph_pattern.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#include <set>

#include "binder/binder.h"
#include "binder/expression/expression_util.h"
#include "binder/expression/function_expression.h"
#include "binder/expression/path_expression.h"
#include "binder/expression/property_expression.h"
#include "catalog/node_table_schema.h"
#include "catalog/rdf_graph_schema.h"
#include "catalog/rel_table_group_schema.h"
#include "catalog/rel_table_schema.h"
#include "common/exception/binder.h"
#include "common/exception/not_implemented.h"
#include "common/string_format.h"
#include "function/cast/functions/cast_string_to_functions.h"
#include "main/client_context.h"
Expand Down
2 changes: 0 additions & 2 deletions src/binder/bind/bind_query.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "binder/binder.h"
#include "binder/query/return_with_clause/bound_return_clause.h"
#include "binder/query/return_with_clause/bound_with_clause.h"
#include "parser/query/return_with_clause/return_clause.h"
#include "parser/query/return_with_clause/with_clause.h"

using namespace kuzu::parser;

Expand Down
2 changes: 2 additions & 0 deletions src/binder/bind/bind_reading_clause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
#include "binder/query/reading_clause/bound_unwind_clause.h"
#include "common/exception/binder.h"
#include "common/string_format.h"
#include "common/string_utils.h"
#include "function/table_functions/bind_input.h"
#include "parser/expression/parsed_function_expression.h"
#include "parser/expression/parsed_literal_expression.h"
#include "parser/query/reading_clause/in_query_call_clause.h"
#include "parser/query/reading_clause/load_from.h"
#include "parser/query/reading_clause/match_clause.h"
#include "parser/query/reading_clause/unwind_clause.h"
#include "processor/operator/persistent/reader/csv/serial_csv_reader.h"
#include "processor/operator/persistent/reader/npy_reader.h"
Expand Down
2 changes: 2 additions & 0 deletions src/binder/bind/bind_updating_clause.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#include "binder/binder.h"
#include "binder/expression/expression_util.h"
#include "binder/expression/property_expression.h"
#include "binder/query/updating_clause/bound_delete_clause.h"
#include "binder/query/updating_clause/bound_insert_clause.h"
#include "binder/query/updating_clause/bound_merge_clause.h"
#include "binder/query/updating_clause/bound_set_clause.h"
#include "catalog/node_table_schema.h"
#include "common/exception/binder.h"
#include "common/exception/not_implemented.h"
#include "common/string_format.h"
#include "parser/query/updating_clause/delete_clause.h"
#include "parser/query/updating_clause/insert_clause.h"
Expand Down
2 changes: 1 addition & 1 deletion src/binder/bind_expression/bind_function_expression.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "binder/binder.h"
#include "binder/expression/expression_util.h"
#include "binder/expression/function_expression.h"
#include "binder/expression/literal_expression.h"
#include "binder/expression/property_expression.h"
#include "binder/expression_binder.h"
#include "common/exception/binder.h"
#include "common/exception/not_implemented.h"
Expand Down
2 changes: 2 additions & 0 deletions src/binder/bind_expression/bind_property_expression.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "binder/expression/expression_util.h"
#include "binder/expression/property_expression.h"
#include "binder/expression/rel_expression.h"
#include "binder/expression_binder.h"
#include "catalog/table_schema.h"
#include "common/exception/binder.h"
#include "common/string_format.h"
#include "parser/expression/parsed_property_expression.h"
Expand Down
2 changes: 0 additions & 2 deletions src/binder/binder.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "binder/binder.h"

#include "binder/bound_statement_rewriter.h"
#include "binder/expression/variable_expression.h"
#include "catalog/rel_table_schema.h"
#include "common/exception/binder.h"
#include "common/exception/not_implemented.h"
#include "common/string_format.h"
Expand Down
1 change: 1 addition & 0 deletions src/binder/expression_binder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "binder/expression_visitor.h"
#include "common/exception/binder.h"
#include "common/exception/not_implemented.h"
#include "common/string_format.h"
#include "expression_evaluator/expression_evaluator_utils.h"
#include "function/cast/vector_cast_functions.h"

Expand Down
1 change: 1 addition & 0 deletions src/binder/rewriter/with_clause_projection_rewriter.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "binder/rewriter/with_clause_projection_rewriter.h"

#include "binder/expression/property_expression.h"
#include "binder/visitor/property_collector.h"

using namespace kuzu::common;
Expand Down
3 changes: 0 additions & 3 deletions src/c_api/connection.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#include "binder/bound_statement_result.h"
#include "c_api/helpers.h"
#include "c_api/kuzu.h"
#include "common/exception/exception.h"
#include "main/kuzu.h"
#include "planner/operator/logical_plan.h"

namespace kuzu {
namespace common {
Expand Down
2 changes: 0 additions & 2 deletions src/c_api/data_type.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "c_api/kuzu.h"
#include "common/types/types.h"
#include "main/kuzu.h"

using namespace kuzu::main;
using namespace kuzu::common;

kuzu_logical_type* kuzu_data_type_create(
Expand Down
5 changes: 2 additions & 3 deletions src/c_api/prepared_statement.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include "binder/bound_statement.h"
#include "main/prepared_statement.h"

#include "c_api/helpers.h"
#include "c_api/kuzu.h"
#include "common/types/value/value.h"
#include "main/kuzu.h"
#include "planner/operator/logical_plan.h"

using namespace kuzu::common;
using namespace kuzu::main;
Expand Down
3 changes: 2 additions & 1 deletion src/c_api/query_result.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "main/query_result.h"

#include "c_api/helpers.h"
#include "c_api/kuzu.h"
#include "main/kuzu.h"

using namespace kuzu::main;
using namespace kuzu::common;
Expand Down
3 changes: 2 additions & 1 deletion src/c_api/query_summary.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "main/query_summary.h"

#include <cstdlib>

#include "c_api/kuzu.h"
#include "json.hpp"

using namespace kuzu::main;

Expand Down
2 changes: 0 additions & 2 deletions src/c_api/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
#include "common/types/value/recursive_rel.h"
#include "common/types/value/rel.h"
#include "function/cast/functions/cast_string_to_functions.h"
#include "main/kuzu.h"

using namespace kuzu::common;
using namespace kuzu::main;

kuzu_value* kuzu_value_create_null() {
auto* c_value = (kuzu_value*)calloc(1, sizeof(kuzu_value));
Expand Down
5 changes: 3 additions & 2 deletions src/catalog/catalog_content.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "catalog/rel_table_group_schema.h"
#include "catalog/rel_table_schema.h"
#include "common/exception/catalog.h"
#include "common/exception/not_implemented.h"
#include "common/exception/runtime.h"
#include "common/serializer/buffered_file.h"
#include "common/serializer/deserializer.h"
Expand Down Expand Up @@ -216,9 +217,9 @@ ExpressionType CatalogContent::getFunctionType(const std::string& name) const {
return FUNCTION;
case function::FunctionType::AGGREGATE:
return AGGREGATE_FUNCTION;
// LCOV_EXCL_START
default:
throw NotImplementedException{"CatalogContent::getFunctionType"};
// LCOV_EXCL_START
throw NotImplementedException("CatalogContent::getFunctionType");
// LCOV_EXCL_END
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/common/arrow/arrow_converter.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "common/arrow/arrow_converter.h"

#include <cstring>

#include "common/arrow/arrow_row_batch.h"
#include "common/exception/internal.h"

Expand Down
3 changes: 3 additions & 0 deletions src/common/arrow/arrow_row_batch.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "common/arrow/arrow_row_batch.h"

#include <cstring>

#include "common/exception/runtime.h"
#include "common/types/value/node.h"
#include "common/types/value/rel.h"
#include "common/types/value/value.h"
Expand Down
1 change: 0 additions & 1 deletion src/common/logging_level_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "common/exception/conversion.h"
#include "common/string_format.h"
#include "common/string_utils.h"
#include "common/utils.h"

namespace kuzu {
namespace common {
Expand Down
2 changes: 0 additions & 2 deletions src/common/profiler.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "common/profiler.h"

#include <cassert>

namespace kuzu {
namespace common {

Expand Down
1 change: 1 addition & 0 deletions src/common/string_utils.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "common/string_utils.h"

#include <sstream>
#include <vector>

namespace kuzu {
Expand Down
1 change: 0 additions & 1 deletion src/common/task_system/task_scheduler.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "common/task_system/task_scheduler.h"

#include "common/constants.h"
#include "spdlog/spdlog.h"

using namespace kuzu::common;

Expand Down
1 change: 0 additions & 1 deletion src/common/type_utils.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "common/type_utils.h"

#include "common/exception/conversion.h"
#include "common/exception/runtime.h"
#include "common/types/blob.h"
#include "common/vector/value_vector.h"
Expand Down
1 change: 0 additions & 1 deletion src/common/types/date_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "common/string_utils.h"
#include "common/types/cast_helpers.h"
#include "common/types/timestamp_t.h"
#include "common/utils.h"

namespace kuzu {
namespace common {
Expand Down
3 changes: 2 additions & 1 deletion src/common/types/dtime_t.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include "common/types/dtime_t.h"

#include <memory>

#include "common/exception/conversion.h"
#include "common/string_format.h"
#include "common/types/cast_helpers.h"
#include "common/types/date_t.h"
#include "common/utils.h"

namespace kuzu {
namespace common {
Expand Down
2 changes: 0 additions & 2 deletions src/common/types/int128_t.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#include "common/types/int128_t.h"

#include <cmath>
#include <limits>

#include "common/exception/overflow.h"
#include "common/types/ku_string.h"
#include "function/cast/functions/numeric_limits.h"

namespace kuzu::common {
Expand Down
2 changes: 2 additions & 0 deletions src/common/types/ku_list.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "common/types/ku_list.h"

#include <cstring>

#include "storage/storage_utils.h"

namespace kuzu {
Expand Down
2 changes: 1 addition & 1 deletion src/common/types/types.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "common/types/types.h"

#include <stdexcept>
#include <cmath>

#include "common/constants.h"
#include "common/exception/binder.h"
Expand Down
Loading

0 comments on commit d3a62a8

Please sign in to comment.