Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:103:26: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    cost[i][j] = std::abs(box.x - targetPoints[j].x) + std::abs(box.y - targetPoints[j].y);
                    ~~~~ ^
/in/sokoban.hpp:103:29: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    cost[i][j] = std::abs(box.x - targetPoints[j].x) + std::abs(box.y - targetPoints[j].y);
                    ~~~~    ^
/in/sokoban.hpp:103:64: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    cost[i][j] = std::abs(box.x - targetPoints[j].x) + std::abs(box.y - targetPoints[j].y);
                                                  ~~~~~~~~~~~~ ^
/in/sokoban.hpp:103:102: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    cost[i][j] = std::abs(box.x - targetPoints[j].x) + std::abs(box.y - targetPoints[j].y);
                                                                                        ~~~~~~~~~~~~ ^
/in/sokoban.hpp:132:39: error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
                    for (int j = 0; j <= static_cast<size_t>(n); ++j) {
                                    ~ ^  ~~~~~~~~~~~~~~~~~~~~~~
/in/sokoban.hpp:233:29: error: implicit conversion loses integer precision: 'std::size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
                int xHash = std::hash<int>()(node->playerPosition.x);
                    ~~~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/sokoban.hpp:234:70: error: implicit conversion loses integer precision: 'std::size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
                int yHash = std::hash<int>()(node->playerPosition.y) << 1;
                    ~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/in/sokoban.hpp:275:14: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        grid[static_cast<int>(i)] = input;
        ~~~~ ^~~~~~~~~~~~~~~~~~~
/in/sokoban.hpp:324:36: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if(closed.find(&neighbours[static_cast<int>(i)]) != closed.end()) continue;
                        ~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~
/in/sokoban.hpp:326:45: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        bool inOpen = open.find(&neighbours[static_cast<int>(i)]) == open.end();
                                 ~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~
/in/sokoban.hpp:328:23: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if(neighbours[static_cast<int>(i)].manhattanDistance < current->manhattanDistance || inOpen) {
           ~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~
/in/sokoban.hpp:329:24: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            neighbours[static_cast<int>(i)].calculateManhattanDistance(targetPoints);
            ~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~
/in/sokoban.hpp:330:49: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if(inOpen) open.emplace(&neighbours[static_cast<int>(i)]);
                                     ~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~
/in/sokoban.hpp:370:25: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            switch(grid[i][j]){
                   ~~~~ ^
/in/sokoban.hpp:370:28: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            switch(grid[i][j]){
                   ~~~~    ^
15 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-26 20:41:48
Judged At
2024-11-26 20:41:48
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes