mldo
New Member
- Joined
- Jun 29, 2014
- Messages
- 36
- Reaction score
- 0
Witam, mam problem przy kompilacji TFS 0.4 trunk.r3884
Game.cpp -> [C++] game.cpp - Pastebin.com
Creature.h -> [C++] creature.h - Pastebin.com
Game.H -> [C++] Game.h - Pastebin.com
Wiecie może jak to poprawić? Jak robiłem w Dev C++ wszystko grało
Przy global save nic nie robiłem
^
game.o -MD -MP -MF .deps/game.Tpo -c -o game.o game.cpp
game.cpp: In member function 'bool Game::combatChangeHealth(CombatType_t, Creature*, Creature*, int64_t, MagicEffect_t, Color_t, bool)':
game.cpp:4279:39: error: format '%d' expects argument of type 'int', but argument 3 has type 'int64_t {aka long int}' [-Werror=format=]
sprintf(buffer, "+%d", healthChange);
^
game.cpp:4319:38: error: format '%d' expects argument of type 'int', but argument 3 has type 'int64_t {aka long int}' [-Werror=format=]
sprintf(buffer, "%d", manaDamage);
^
game.cpp:4460:34: error: format '%d' expects argument of type 'int', but argument 3 has type 'int64_t {aka long int}' [-Werror=format=]
sprintf(buffer, "%d", damage);
^
game.cpp: In member function 'bool Game::combatChangeMana(Creature*, Creature*, int64_t)':
game.cpp:4493:37: error: format '%d' expects argument of type 'int', but argument 3 has type 'int64_t {aka long int}' [-Werror=format=]
sprintf(buffer, "+%d", manaChange);
^
game.cpp:4531:34: error: format '%d' expects argument of type 'int', but argument 3 has type 'int64_t {aka long int}' [-Werror=format=]
sprintf(buffer, "%d", manaLoss);
^
game.cpp: In constructor 'Game::Game()':
game.cpp:80:31: error: iteration 2u invokes undefined behavior [-Werror=aggressive-loop-optimizations]
globalSaveMessage = false;
^
game.cpp:79:2: note: containing loop
for(int64_t i = 0; i < 3; i++)
^
In file included from game.cpp:18:0:
game.h: In member function 'void Game::globalSave()':
game.h:613:85: error: iteration 2u invokes undefined behavior [-Werror=aggressive-loop-optimizations]
void setGlobalSaveMessage(int32_t key, bool value) {globalSaveMessage[key] = value;}
^
game.cpp:6180:2: note: containing loop
for(int32_t i = 0; i < 3; i++)
^
game.cpp: In constructor 'Game::Game()':
game.cpp:80:22: error: array subscript is above array bounds [-Werror=array-bounds]
globalSaveMessage = false;
^
In file included from game.cpp:18:0:
game.h: In member function 'void Game::globalSave()':
game.h:613:76: error: array subscript is above array bounds [-Werror=array-bounds]
void setGlobalSaveMessage(int32_t key, bool value) {globalSaveMessage[key] = value;}
^
game.cpp: In member function 'void Game:repareGlobalSave()':
game.cpp:6138:30: error: array subscript is above array bounds [-Werror=array-bounds]
else if(!globalSaveMessage[2])
^
game.cpp:6140:22: error: array subscript is above array bounds [-Werror=array-bounds]
globalSaveMessage[2] = true;
^
cc1plus: all warnings being treated as errors
Makefile:541: recipe for target 'game.o' failed
Game.cpp -> [C++] game.cpp - Pastebin.com
Creature.h -> [C++] creature.h - Pastebin.com
Game.H -> [C++] Game.h - Pastebin.com
Wiecie może jak to poprawić? Jak robiłem w Dev C++ wszystko grało
Przy global save nic nie robiłem
pomimo tego przy kompilacji, nawet innego source wywala błądgame.h: In member function 'void Game::globalSave()':
Last edited: