Skip to content

Rusanov Anton, homework - #22

Open
c4llery wants to merge 3 commits into
DafeMipt213:mainfrom
c4llery:main
Open

Rusanov Anton, homework#22
c4llery wants to merge 3 commits into
DafeMipt213:mainfrom
c4llery:main

Conversation

@c4llery

@c4llery c4llery commented Jan 13, 2024

Copy link
Copy Markdown

No description provided.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 25 out of 91. Check the log or trigger a new build to see more.

Comment thread task_01/src/test.cpp
@@ -1,8 +1,90 @@

#include <gtest/gtest.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]

#include <gtest/gtest.h>
         ^

void Graph::countIncoming() {
for (auto& elem : nodes) {
for (size_t j = 0; j < elem.second.out.size(); ++j) {
size_t cur_number = nodes[elem.first].out[j];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warning: variable 'cur_number' of type 'size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]

Suggested change
size_t cur_number = nodes[elem.first].out[j];
size_t const cur_number = nodes[elem.first].out[j];

for (auto& elem : graph.nodes)
if (elem.second.in == 0) zeros.push(elem.first);
while (zeros.size() != 0) {
size_t x = zeros.front();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warning: variable 'x' of type 'size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]

Suggested change
size_t x = zeros.front();
size_t const x = zeros.front();

#pragma once
#include <unordered_map>
#include <vector>
struct Node {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warning: constructor does not initialize these fields: id [cppcoreguidelines-pro-type-member-init]

task_01/src/topology_sort.hpp:4:

-   size_t id;
+   size_t id{};

#include <unordered_map>
#include <vector>
struct Node {
size_t id;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]

Suggested change
size_t id;
std::size_t id;
Additional context

/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h:297: 'std::size_t' declared here

  typedef __SIZE_TYPE__ 	size_t;
                         ^

Comment thread task_02/src/test.cpp
@@ -1,6 +1,41 @@

#include <gtest/gtest.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]

#include <gtest/gtest.h>
         ^

Comment thread task_04/src/dijkstra.hpp
#include <unordered_map>
#include <vector>
struct Edge {
size_t weight;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]

Suggested change
size_t weight;
std::size_t weight;
Additional context

/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h:297: 'std::size_t' declared here

  typedef __SIZE_TYPE__ 	size_t;
                         ^

Comment thread task_04/src/dijkstra.hpp
#include <vector>
struct Edge {
size_t weight;
size_t index_to;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]

Suggested change
size_t index_to;
std::size_t index_to;
Additional context

/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h:297: 'std::size_t' declared here

  typedef __SIZE_TYPE__ 	size_t;
                         ^

Comment thread task_04/src/dijkstra.hpp
struct Edge {
size_t weight;
size_t index_to;
Edge(size_t index_to, size_t weight) : weight(weight), index_to(index_to) {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]

Suggested change
Edge(size_t index_to, size_t weight) : weight(weight), index_to(index_to) {}
Edge(std::size_t index_to, size_t weight) : weight(weight), index_to(index_to) {}
Additional context

/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h:297: 'std::size_t' declared here

  typedef __SIZE_TYPE__ 	size_t;
                         ^

Comment thread task_04/src/dijkstra.hpp
struct Edge {
size_t weight;
size_t index_to;
Edge(size_t index_to, size_t weight) : weight(weight), index_to(index_to) {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

warning: unknown type name 'size_t'; did you mean 'std::size_t'? [clang-diagnostic-error]

Suggested change
Edge(size_t index_to, size_t weight) : weight(weight), index_to(index_to) {}
Edge(size_t index_to, std::size_t weight) : weight(weight), index_to(index_to) {}
Additional context

/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h:297: 'std::size_t' declared here

  typedef __SIZE_TYPE__ 	size_t;
                         ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants