Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:133:55: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            size_t new_px_for_walk = current.player_x + dx[i];
                   ~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~^~~~~~~
/in/sokoban.hpp:134:55: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            size_t new_py_for_walk = current.player_y + dy[i];
                   ~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~^~~~~~~
/in/sokoban.hpp:147:60: error: implicit conversion changes signedness: 'const int' to 'unsigned long' [-Werror,-Wsign-conversion]
                size_t new_bx_for_walk = new_px_for_walk + dx[i];
                                                         ~ ^~~~~
/in/sokoban.hpp:148:60: error: implicit conversion changes signedness: 'const int' to 'unsigned long' [-Werror,-Wsign-conversion]
                size_t new_by_for_walk = new_py_for_walk + dy[i];
                                                         ~ ^~~~~
/in/sokoban.hpp:94:28: error: implicit conversion loses integer precision: 'std::vector<std::string>::size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
                player_x = x;
                         ~ ^
/in/sokoban.hpp:95:28: error: implicit conversion loses integer precision: 'std::vector<std::string>::size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
                player_y = y;
                         ~ ^
/in/sokoban.hpp:136:51: error: implicit conversion loses integer precision: 'std::vector<std::string>::size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
            if (!is_within_bounds(new_px, new_py, rows, cols) || !is_walkable(grid, new_px_for_walk, new_py_for_walk)) {
                 ~~~~~~~~~~~~~~~~                 ^~~~
/in/sokoban.hpp:136:57: error: implicit conversion loses integer precision: 'std::vector<std::string>::size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
            if (!is_within_bounds(new_px, new_py, rows, cols) || !is_walkable(grid, new_px_for_walk, new_py_for_walk)) {
                 ~~~~~~~~~~~~~~~~                       ^~~~
/in/sokoban.hpp:136:102: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
            if (!is_within_bounds(new_px, new_py, rows, cols) || !is_walkable(grid, new_px_for_walk, new_py_for_walk)) {
                                                                  ~~~~~~~~~~~                        ^~~~~~~~~~~~~~~
/in/sokoban.hpp:149:55: error: implicit conversion loses integer precision: 'std::vector<std::string>::size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
                if (!is_within_bounds(new_bx, new_by, rows, cols) || !is_walkable(grid, new_bx_for_walk, new_by_for_walk)) {
                     ~~~~~~~~~~~~~~~~                 ^~~~
/in/sokoban.hpp:149:61: error: implicit conversion loses integer precision: 'std::vector<std::string>::size_type' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
                if (!is_within_bounds(new_bx, new_by, rows, cols) || !is_walkable(grid, new_bx_for_walk, new_by_for_walk)) {
                     ~~~~~~~~~~~~~~~~                       ^~~~
/in/sokoban.hpp:149:106: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
                if (!is_within_bounds(new_bx, new_by, rows, cols) || !is_walkable(grid, new_bx_for_walk, new_by_for_walk)) {
                                                                      ~~~~~~~~~~~                        ^~~~~~~~~~~~~~~
/in/sokoban.hpp:193:20: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
    return answers[(int)index];
           ~~~~~~~ ^~~~~~~~~~
13 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 22:05:21
Judged At
2024-11-26 22:05:21
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes