Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:279:25: error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
    for(size_t i = 0; i < row; i++) {
                      ~ ^ ~~~
/in/sokoban.hpp:318:11: error: unused variable 'box' [-Werror,-Wunused-variable]
for(auto &box : current->boxes)
          ^
/in/sokoban.hpp:331:36: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if(closed.find(&neighbours[i]) != closed.end()) continue;
                        ~~~~~~~~~~ ^
/in/sokoban.hpp:333:45: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        bool inOpen = open.find(&neighbours[i]) == open.end();
                                 ~~~~~~~~~~ ^
/in/sokoban.hpp:335:23: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if(neighbours[i].manhattanDistance < current->manhattanDistance || inOpen) {
           ~~~~~~~~~~ ^
/in/sokoban.hpp:336:24: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            neighbours[i].calculateManhattanDistance(targetPoints);
            ~~~~~~~~~~ ^
/in/sokoban.hpp:337:49: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if(inOpen) open.emplace(&neighbours[i]);
                                     ~~~~~~~~~~ ^
/in/sokoban.hpp:371:17: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if(grid[i][0] != Wall || grid[i][col - 1] != Wall) {
           ~~~~ ^
/in/sokoban.hpp:371:39: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if(grid[i][0] != Wall || grid[i][col - 1] != Wall) {
                                 ~~~~ ^
/in/sokoban.hpp:371:46: 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(grid[i][0] != Wall || grid[i][col - 1] != Wall) {
                                 ~~~~    ~~~~^~~
/in/sokoban.hpp:377:25: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            switch(grid[i][j]){
                   ~~~~ ^
/in/sokoban.hpp:377:28: 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]
            switch(grid[i][j]){
                   ~~~~    ^
/in/sokoban.hpp:399:20: 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(grid[0][i] != Wall || grid[row - 1][i] != Wall) {
           ~~~~    ^
/in/sokoban.hpp:399:43: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        if(grid[0][i] != Wall || grid[row - 1][i] != Wall) {
                                 ~~~~ ~~~~^~~
/in/sokoban.hpp:399:48: 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(grid[0][i] != Wall || grid[row - 1][i] != Wall) {
                                 ~~~~          ^
15 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 18:24:46
Judged At
2024-11-26 18:24:46
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes