Record Detail

Compile Error

/in/simulation.cpp: In function 'int CheckCreatureSpecies(const string&, const world_t&)':
/in/simulation.cpp:49:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int i = 0; i < world.numSpecies; i++) {
                    ~~^~~~~~~~~~~~~~~~~~
/in/simulation.cpp: In function 'int CheckHeight(int)':
/in/simulation.cpp:70:15: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if(height > MAXHEIGHT || height < 1) {
        ~~~~~~~^~~~~~~~~~~
/in/simulation.cpp: In function 'int CheckWidth(int)':
/in/simulation.cpp:78:14: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if(width > MAXWIDTH || width < 1) {
        ~~~~~~^~~~~~~~~~
/in/simulation.cpp: In function 'bool CheckInsideGrid(int, int, const world_t&)':
/in/simulation.cpp:86:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if(row < 0 || row >= world.grid.height || col < 0 || col >= world.grid.width) {
                   ~~~~^~~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:86:62: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if(row < 0 || row >= world.grid.height || col < 0 || col >= world.grid.width) {
                                                          ~~~~^~~~~~~~~~~~~~~~~~~
/in/simulation.cpp: In function 'void readSpeciesPrograms(const string&, const string&, world_t&)':
/in/simulation.cpp:149:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for (int i = 0; i < world.numSpecies; ++i) {
                     ~~^~~~~~~~~~~~~~~~~~
/in/simulation.cpp: In function 'creature_t* getCreature(const grid_t&, point_t)':
/in/simulation.cpp:330:38: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (location.r < 0 || location.r >= grid.height || location.c < 0 || location.c >= grid.width) {
                           ~~~~~~~~~~~^~~~~~~~~~~~~~
/in/simulation.cpp:330:85: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (location.r < 0 || location.r >= grid.height || location.c < 0 || location.c >= grid.width) {
                                                                          ~~~~~~~~~~~^~~~~~~~~~~~~
/in/simulation.cpp: In function 'void moveForward(creature_t&, world_t&)':
/in/simulation.cpp:348:45: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (newLocation.r >= 0 && newLocation.r < world.grid.height && newLocation.c >= 0 && newLocation.c < world.grid.width &&
                               ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:348:104: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (newLocation.r >= 0 && newLocation.r < world.grid.height && newLocation.c >= 0 && newLocation.c < world.grid.width &&
                                                                                          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/in/simulation.cpp: In function 'void Infect(creature_t&, world_t&)':
/in/simulation.cpp:372:51: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (targetLocation.r >= 0 && targetLocation.r < world.grid.height && targetLocation.c >= 0 && targetLocation.c < world.grid.width) {
                                  ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:372:116: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (targetLocation.r >= 0 && targetLocation.r < world.grid.height && targetLocation.c >= 0 && targetLocation.c < world.grid.width) {
                                                                                                   ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/in/simulation.cpp: In function 'void printOneRound(int, bool, world_t&)':
/in/simulation.cpp:560:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int j = 0; j < world.numCreatures; j++){
                    ~~^~~~~~~~~~~~~~~~~~~~
/in/simulation.cpp: In function 'void printGrid(const grid_t&)':
/in/simulation.cpp:575:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for (int r = 0; r < grid.height; ++r) {
                     ~~^~~~~~~~~~~~~
/in/simulation.cpp:576:27: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for (int c = 0; c < grid.width; ++c) {
                         ~~^~~~~~~~~~~~
/in/simulation.cpp:594:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
             if (c < grid.width) {
                 ~~^~~~~~~~~~~~
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 3
Language
C++
Submit At
2024-11-14 23:28:11
Judged At
2024-11-14 23:28:11
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes