Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:97:34: error: implicit conversion changes signedness: 'const int' to 'unsigned long' [-Werror,-Wsign-conversion]
            int newX = playerX + dx[dir];
                               ~ ^~~~~~~
/in/sokoban.hpp:98:34: error: implicit conversion changes signedness: 'const int' to 'unsigned long' [-Werror,-Wsign-conversion]
            int newY = playerY + dy[dir];
                               ~ ^~~~~~~
/in/sokoban.hpp:100:29: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (!isInBounds(newX, newY, rows, cols) || currentMap[newY][newX] == WALL) {
                 ~~~~~~~~~~ ^~~~
/in/sokoban.hpp:100:35: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (!isInBounds(newX, newY, rows, cols) || currentMap[newY][newX] == WALL) {
                 ~~~~~~~~~~       ^~~~
/in/sokoban.hpp:100:67: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (!isInBounds(newX, newY, rows, cols) || currentMap[newY][newX] == WALL) {
                                                       ~~~~~~~~~~ ^~~~
/in/sokoban.hpp:100:73: 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 (!isInBounds(newX, newY, rows, cols) || currentMap[newY][newX] == WALL) {
                                                       ~~~~~~~~~~       ^~~~
/in/sokoban.hpp:104:28: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (currentMap[newY][newX] == BOX) {
                ~~~~~~~~~~ ^~~~
/in/sokoban.hpp:104:34: 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 (currentMap[newY][newX] == BOX) {
                ~~~~~~~~~~       ^~~~
/in/sokoban.hpp:106:32: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
                size_t nextX = newX + static_cast<size_t>(dx[dir]);
                               ^~~~ ~
/in/sokoban.hpp:107:32: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
                size_t nextY = newY + static_cast<size_t>(dy[dir]);
                               ^~~~ ~
/in/sokoban.hpp:112:28: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    newMap[newY][newX] = PATH;
                    ~~~~~~ ^~~~
/in/sokoban.hpp:112:34: 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]
                    newMap[newY][newX] = PATH;
                    ~~~~~~       ^~~~
/in/sokoban.hpp:125:24: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                newMap[newY][newX] = START;
                ~~~~~~ ^~~~
/in/sokoban.hpp:125:30: 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]
                newMap[newY][newX] = START;
                ~~~~~~       ^~~~
/in/sokoban.hpp:97:32: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
            int newX = playerX + dx[dir];
                ~~~~   ~~~~~~~~^~~~~~~~~
/in/sokoban.hpp:98:32: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
            int newY = playerY + dy[dir];
                ~~~~   ~~~~~~~~^~~~~~~~~
16 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 17:06:26
Judged At
2024-11-26 17:06:26
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes