Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:97:58: error: implicit conversion changes signedness: 'const int' to 'unsigned long' [-Werror,-Wsign-conversion]
            hash =  static_cast <size_t>(hash * 31 + box.first * cols + box.second);
                                                     ~~~~^~~~~ ~
/in/sokoban.hpp:97:77: error: implicit conversion changes signedness: 'const int' to 'unsigned long' [-Werror,-Wsign-conversion]
            hash =  static_cast <size_t>(hash * 31 + box.first * cols + box.second);
                                                                      ~ ~~~~^~~~~~
/in/sokoban.hpp:124:45: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            int new_px = current.px + dir_x[d];
                                      ~~~~~ ^
/in/sokoban.hpp:125:45: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            int new_py = current.py + dir_y[d];
                                      ~~~~~ ^
/in/sokoban.hpp:138:48: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                int new_box_x = new_px + dir_x[d];
                                         ~~~~~ ^
/in/sokoban.hpp:139:48: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                int new_box_y = new_py + dir_y[d];
                                         ~~~~~ ^
/in/sokoban.hpp:150:85: 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]
            State new_state{new_px, new_py, new_box_positions, current.path + moves[d]};
                                                                              ~~~~~ ^
/in/sokoban.hpp:66:28: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
                player_x = r;
                         ~ ^
/in/sokoban.hpp:67:28: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
                player_y = c;
                         ~ ^
9 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 23:11:39
Judged At
2024-11-27 23:11:39
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes