Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:51:32: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
    size_t new_box_x = box_x + dir_x;
                             ~ ^~~~~
/in/sokoban.hpp:52:32: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
    size_t new_box_y = box_y + dir_y;
                             ~ ^~~~~
/in/sokoban.hpp:78:28: error: non-constant-expression cannot be narrowed from type 'int' to 'size_t' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
    State initial_state = {start_x, start_y, boxes};
                           ^~~~~~~
/in/sokoban.hpp:78:28: note: insert an explicit cast to silence this issue
    State initial_state = {start_x, start_y, boxes};
                           ^~~~~~~
                           static_cast<size_t>( )
/in/sokoban.hpp:78:37: error: non-constant-expression cannot be narrowed from type 'int' to 'size_t' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
    State initial_state = {start_x, start_y, boxes};
                                    ^~~~~~~
/in/sokoban.hpp:78:37: note: insert an explicit cast to silence this issue
    State initial_state = {start_x, start_y, boxes};
                                    ^~~~~~~
                                    static_cast<size_t>( )
/in/sokoban.hpp:78:28: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
    State initial_state = {start_x, start_y, boxes};
                          ~^~~~~~~
/in/sokoban.hpp:78:37: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
    State initial_state = {start_x, start_y, boxes};
                          ~         ^~~~~~~
/in/sokoban.hpp:100:80: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
            int new_player_x = current_state.player_x + direction_vectors[dir].first;  // Change to int
                                                      ~ ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/in/sokoban.hpp:100:75: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            int new_player_x = current_state.player_x + direction_vectors[dir].first;  // Change to int
                                                        ~~~~~~~~~~~~~~~~~ ^~~
/in/sokoban.hpp:101:80: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
            int new_player_y = current_state.player_y + direction_vectors[dir].second;  // Change to int
                                                      ~ ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/in/sokoban.hpp:101:75: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            int new_player_y = current_state.player_y + direction_vectors[dir].second;  // Change to int
                                                        ~~~~~~~~~~~~~~~~~ ^~~
/in/sokoban.hpp:104:38: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (!is_valid_move(grid, new_player_x, new_player_y)) continue;
                 ~~~~~~~~~~~~~       ^~~~~~~~~~~~
/in/sokoban.hpp:104:52: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (!is_valid_move(grid, new_player_x, new_player_y)) continue;
                 ~~~~~~~~~~~~~                     ^~~~~~~~~~~~
/in/sokoban.hpp:112:85: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    if (can_push_box(grid, box.first, box.second, direction_vectors[dir].first, direction_vectors[dir].second)) {
                                                                  ~~~~~~~~~~~~~~~~~ ^~~
/in/sokoban.hpp:112:115: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                    if (can_push_box(grid, box.first, box.second, direction_vectors[dir].first, direction_vectors[dir].second)) {
                                                                                                ~~~~~~~~~~~~~~~~~ ^~~
/in/sokoban.hpp:113:61: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
                        box.first += direction_vectors[dir].first;
                                  ~~ ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/in/sokoban.hpp:113:56: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                        box.first += direction_vectors[dir].first;
                                     ~~~~~~~~~~~~~~~~~ ^~~
/in/sokoban.hpp:114:62: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
                        box.second += direction_vectors[dir].second;
                                   ~~ ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/in/sokoban.hpp:114:57: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                        box.second += direction_vectors[dir].second;
                                      ~~~~~~~~~~~~~~~~~ ^~~
/in/sokoban.hpp:121:36: error: non-constant-expression cannot be narrowed from type 'int' to 'size_t' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
                State new_state = {new_player_x, new_player_y, new_boxes};
                                   ^~~~~~~~~~~~
/in/sokoban.hpp:121:36: note: insert an explicit cast to silence this issue
                State new_state = {new_player_x, new_player_y, new_boxes};
                                   ^~~~~~~~~~~~
                                   static_cast<size_t>( )
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 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 23:33:10
Judged At
2024-11-26 23:33:10
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes