Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:18:17: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
    grid.resize(rows);
         ~~~~~~ ^~~~
/in/sokoban.hpp:20:37: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        std::getline(std::cin, grid[i]);
                               ~~~~ ^
/in/sokoban.hpp:57:23: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    if (grid[r][c] == 'S') {
                        ~~~~ ^
/in/sokoban.hpp:57:26: 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]
                    if (grid[r][c] == 'S') {
                        ~~~~    ^
/in/sokoban.hpp:60:30: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    } else if (grid[r][c] == 'B') {
                               ~~~~ ^
/in/sokoban.hpp:60:33: 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]
                    } else if (grid[r][c] == 'B') {
                               ~~~~    ^
/in/sokoban.hpp:62:30: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    } else if (grid[r][c] == 'T') {
                               ~~~~ ^
/in/sokoban.hpp:62:33: 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]
                    } else if (grid[r][c] == 'T') {
                               ~~~~    ^
/in/sokoban.hpp:87:33: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    int nx = x + moves[i].first;
                                 ~~~~~ ^
/in/sokoban.hpp:88:33: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    int ny = y + moves[i].second;
                                 ~~~~~ ^
/in/sokoban.hpp:90:71: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    if (nx < 0 || nx >= rows || ny < 0 || ny >= cols || grid[nx][ny] == '#') {
                                                                        ~~~~ ^~
/in/sokoban.hpp:90:75: 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]
                    if (nx < 0 || nx >= rows || ny < 0 || ny >= cols || grid[nx][ny] == '#') {
                                                                        ~~~~     ^~
/in/sokoban.hpp:98:46: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                            int box_nx = nx + moves[i].first;
                                              ~~~~~ ^
/in/sokoban.hpp:99:46: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                            int box_ny = ny + moves[i].second;
                                              ~~~~~ ^
/in/sokoban.hpp:101:95: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                            if (box_nx < 0 || box_nx >= rows || box_ny < 0 || box_ny >= cols || grid[box_nx][box_ny] != '.') {
                                                                                                ~~~~ ^~~~~~
/in/sokoban.hpp:101:103: 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]
                            if (box_nx < 0 || box_nx >= rows || box_ny < 0 || box_ny >= cols || grid[box_nx][box_ny] != '.') {
                                                                                                ~~~~         ^~~~~~
/in/sokoban.hpp:119:62: 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]
                    q.emplace(nx, ny, next_boxes, path + directions[i]);
                                                         ~~~~~~~~~~ ^
/in/sokoban.hpp:46:18: error: implicit conversion loses integer precision: 'std::vector::size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
        int rows = grid.size();
            ~~~~   ~~~~~^~~~~~
/in/sokoban.hpp:47:25: error: implicit conversion loses integer precision: 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
            int cols = grid[0].size();
                ~~~~   ~~~~~~~~^~~~~~
19 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-27 22:46:42
Judged At
2024-11-27 22:46:42
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes