Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:330:26: error: implicit conversion loses integer precision: 'std::vector::size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
    int cols = matrix[0].size();
        ~~~~   ~~~~~~~~~~^~~~~~
/in/sokoban.hpp:331:13: error: comparison of integers of different signs: 'int' and 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
    if (row == matrix.size()) {
        ~~~ ^  ~~~~~~~~~~~~~
/in/sokoban.hpp:358:32: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
    vector<int> currentIndices(rows);
                ~~~~~~~~~~~~~~ ^~~~
/in/sokoban.hpp:356:23: error: implicit conversion loses integer precision: 'std::vector::size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
    int rows = matrix.size();
        ~~~~   ~~~~~~~^~~~~~
/in/sokoban.hpp:381:36: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
    vector<vector<int>> costMatrix(num_boxes, vector<int>(num_targets, 0));
                        ~~~~~~~~~~ ^~~~~~~~~
/in/sokoban.hpp:381:59: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
    vector<vector<int>> costMatrix(num_boxes, vector<int>(num_targets, 0));
                                              ~~~~~~      ^~~~~~~~~~~
/in/sokoban.hpp:384:28: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            Node box(boxes[index_box].first, boxes[index_box].second);
                     ~~~~~ ^~~~~~~~~
/in/sokoban.hpp:384:52: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            Node box(boxes[index_box].first, boxes[index_box].second);
                                             ~~~~~ ^~~~~~~~~
/in/sokoban.hpp:386:31: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            Node goal(targets[index_target].first, targets[index_target].second);
                      ~~~~~~~ ^~~~~~~~~~~~
/in/sokoban.hpp:386:60: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            Node goal(targets[index_target].first, targets[index_target].second);
                                                   ~~~~~~~ ^~~~~~~~~~~~
/in/sokoban.hpp:387:24: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            costMatrix[index_box][index_target] = aStar_num(grid, std::make_shared<Node>(box), std::make_shared<Node>(man), std::make_shared<Node>(goal));
            ~~~~~~~~~~ ^~~~~~~~~
/in/sokoban.hpp:387:35: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            costMatrix[index_box][index_target] = aStar_num(grid, std::make_shared<Node>(box), std::make_shared<Node>(man), std::make_shared<Node>(goal));
            ~~~~~~~~~~            ^~~~~~~~~~~~
/in/sokoban.hpp:396:36: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        for(int i = 0; i < matches[index_match].indices.size(); ++i){
                           ~~~~~~~ ^~~~~~~~~~~
/in/sokoban.hpp:397:45: error: implicit conversion changes signedness: '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type' (aka 'int') to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            targets_match.push_back(targets[matches[index_match].indices[i]]);
                                    ~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/sokoban.hpp:397:53: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            targets_match.push_back(targets[matches[index_match].indices[i]]);
                                            ~~~~~~~ ^~~~~~~~~~~
/in/sokoban.hpp:397:74: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            targets_match.push_back(targets[matches[index_match].indices[i]]);
                                            ~~~~~~~                      ^
/in/sokoban.hpp:403:62: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            auto goal = std::make_shared<Node>(targets_match[index_box].first, targets_match[index_box].second);
                                               ~~~~~~~~~~~~~ ^~~~~~~~~
/in/sokoban.hpp:403:94: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            auto goal = std::make_shared<Node>(targets_match[index_box].first, targets_match[index_box].second);
                                                                               ~~~~~~~~~~~~~ ^~~~~~~~~
/in/sokoban.hpp:404:53: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            auto box = std::make_shared<Node>(boxes[index_box].first, boxes[index_box].second);
                                              ~~~~~ ^~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
/in/Compile/Makefile:16: recipe for target 'main' failed
make: *** [main] Error 1

Information

Submit By
Type
Submission
Homework
Project3
Language
C++
Submit At
2024-11-24 17:39:05
Judged At
2024-11-24 17:39:05
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes