Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:97:44: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
        int neighbor = box + directions[i]*MAX_ROW + directions[i+1]; 
                                          ~^~~~~~~
/in/sokoban.hpp:98:45: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
        int neighbor2 = box - directions[i]*MAX_ROW - directions[i+1];
                                           ~^~~~~~~
/in/sokoban.hpp:100:25: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if (map[neighbor/MAX_ROW][neighbor%MAX_ROW]==1 || map[neighbor2/MAX_ROW][neighbor2%MAX_ROW]==1){
            ~~~ ~~~~~~~~^~~~~~~~
/in/sokoban.hpp:100:43: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if (map[neighbor/MAX_ROW][neighbor%MAX_ROW]==1 || map[neighbor2/MAX_ROW][neighbor2%MAX_ROW]==1){
            ~~~                   ~~~~~~~~^~~~~~~~
/in/sokoban.hpp:100:72: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if (map[neighbor/MAX_ROW][neighbor%MAX_ROW]==1 || map[neighbor2/MAX_ROW][neighbor2%MAX_ROW]==1){
                                                          ~~~ ~~~~~~~~~^~~~~~~~
/in/sokoban.hpp:100:91: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if (map[neighbor/MAX_ROW][neighbor%MAX_ROW]==1 || map[neighbor2/MAX_ROW][neighbor2%MAX_ROW]==1){
                                                          ~~~                    ~~~~~~~~~^~~~~~~~
/in/sokoban.hpp:104:34: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if ((find_in(boxposition,neighbor) && is_freeze_deadlock_recursive(map,neighbor,boxposition,visited))
             ~~~~~~~             ^~~~~~~~
/in/sokoban.hpp:104:80: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if ((find_in(boxposition,neighbor) && is_freeze_deadlock_recursive(map,neighbor,boxposition,visited))
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~     ^~~~~~~~
/in/sokoban.hpp:105:37: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            || (find_in(boxposition,neighbor2) && is_freeze_deadlock_recursive(map,neighbor2,boxposition,visited))){
                ~~~~~~~             ^~~~~~~~~
/in/sokoban.hpp:105:84: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            || (find_in(boxposition,neighbor2) && is_freeze_deadlock_recursive(map,neighbor2,boxposition,visited))){
                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~     ^~~~~~~~~
/in/sokoban.hpp:97:52: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
        int neighbor = box + directions[i]*MAX_ROW + directions[i+1]; 
            ~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/in/sokoban.hpp:98:53: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
        int neighbor2 = box - directions[i]*MAX_ROW - directions[i+1];
            ~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/in/sokoban.hpp:119:35: error: implicit conversion changes signedness: 'int' to 'std::vector<unsigned long, std::allocator<unsigned long> >::value_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            boxposition.push_back(i);
                        ~~~~~~~~~ ^
/in/sokoban.hpp:124:24: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        size_t m = box / MAX_ROW;
               ~   ~~~~^~~~~~~~~
/in/sokoban.hpp:125:24: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        size_t n = box % MAX_ROW;
               ~   ~~~~^~~~~~~~~
/in/sokoban.hpp:130:46: error: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if (is_freeze_deadlock_recursive(map,box,boxposition,visited)){
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~     ^~~
/in/sokoban.hpp:118:20: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
        for (int i : Rpos){
                 ~ ^
/in/sokoban.hpp:123:18: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
    for (int box : boxposition){
             ~~~ ^
/in/sokoban.hpp:152:24: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
        size_t a = i / MAX_ROW;
                     ~ ^~~~~~~
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-27 13:23:19
Judged At
2024-11-27 13:23:19
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes