Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[easy] Address some compilation warnings #178

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/core/functions/scalar/local_clustering_coefficient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void LocalClusteringCoefficientFunction(DataChunk &args,

DuckPGQBitmap neighbors(v_size);

for (int32_t n = 0; n < args.size(); n++) {
for (idx_t n = 0; n < args.size(); n++) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/home/ubuntu/duckpgq-extension/src/core/functions/scalar/local_clustering_coefficient.cpp:45:25: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘duckdb::idx_t’ {aka ‘long unsigned int’} [-Wsign-compare]
   45 |   for (int32_t n = 0; n < args.size(); n++) {
      |                       ~~^~~~~~~~~~~~~

auto src_sel = vdata_src.sel->get_index(n);
if (!vdata_src.validity.RowIsValid(src_sel)) {
result_validity.SetInvalid(n);
Expand All @@ -54,15 +54,15 @@ static void LocalClusteringCoefficientFunction(DataChunk &args,
continue;
}
neighbors.reset();
for (size_t offset = v[src_node]; offset < v[src_node + 1]; offset++) {
for (int64_t offset = v[src_node]; offset < v[src_node + 1]; offset++) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

**/home/ubuntu/duckpgq-extension/src/core/functions/scalar/local_clustering_coefficient.cpp:57:46: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int64_t’ {aka ‘long int’} [-Wsign-compare]
   57 |     for (size_t offset = v[src_node]; offset < v[src_node + 1]; offset++) {
      |                                       ~~~~~~~^~~~~~~~~~~~~~~~~**

neighbors.set(e[offset]);
}

// Count connections between neighbors
int64_t count = 0;
for (size_t offset = v[src_node]; offset < v[src_node + 1]; offset++) {
for (int64_t offset = v[src_node]; offset < v[src_node + 1]; offset++) {
int64_t neighbor = e[offset];
for (size_t offset2 = v[neighbor]; offset2 < v[neighbor + 1]; offset2++) {
for (int64_t offset2 = v[neighbor]; offset2 < v[neighbor + 1]; offset2++) {
int is_connected = neighbors.test(e[offset2]);
count += is_connected; // Add 1 if connected, 0 otherwise
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/functions/scalar/weakly_connected_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static void WeaklyConnectedComponentFunction(DataChunk &args,
idx_t started_searches = 0;
while (started_searches < args.size()) {
// empty visit vectors
for (auto i = 0; i < v_size; i++) {
for (size_t i = 0; i < v_size; i++) {
seen[i] = 0;
visit1[i] = 0;
}
Expand Down Expand Up @@ -146,7 +146,7 @@ static void WeaklyConnectedComponentFunction(DataChunk &args,
continue;
}
// Update component IDs
for (int64_t i = 0; i < v_size; i++) {
for (size_t i = 0; i < v_size; i++) {
if (seen[i][lane]) {
UpdateComponentId(i, src_data[search_num], info);
}
Expand Down
1 change: 0 additions & 1 deletion src/core/parser/duckpgq_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ namespace core {

ParserExtensionParseResult duckpgq_parse(ParserExtensionInfo *info,
const std::string &query) {
auto parse_info = (DuckPGQParserExtensionInfo &)(info);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable not used anywhere.

Parser parser;
parser.ParseQuery((query[0] == '-') ? query.substr(1, query.length())
: query);
Expand Down
Loading