[Kde-games-devel] Review Request 120169: Fix lots of warnings
Martin Walch
walch.martin at web.de
Sat Sep 13 13:18:19 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120169/
-----------------------------------------------------------
(Updated Sept. 13, 2014, 1:18 p.m.)
Status
------
This change has been marked as submitted.
Review request for KDE Games.
Repository: kblocks
Description
-------
krazy2 complains:
> 5. Check for code that should be considered crashy. [crashy]...
> ./KBlocksWin.cpp: line#242 (1)
Fix as described in http://blogs.kde.org/node/3919
> 11. Check for C++ ctors that should be declared 'explicit' [explicit]
> ./KBlocksPieceGenerator.h: line#16 (1)
> ./KBlocksGameMessage.h: line#18 (1)
> ./KBlocksGameLogic.h: line#29 (1)
> ./KBlocksAppThread.h: line#19 (1)
> ./KBlocksPiece.h: line#90 (1)
> ./AI/PlannerInterface.h: line#21 (1)
> ./AI/KBlocksAIPlayer.h: line#30 (1)
> ./AI/KBlocksAIPlanner.h: line#24 (1)
> ./AI/KBlocksAIPlannerExtend.h: line#25,51 (2)
Fix all by putting "explicit" in front of the constructor, except for KBlocksPiece.h:90, which is sort of a copy constructor (just ignoring it, not suppressing the krazy2 warning).
> 15. Check for proper include directives [includes]...
> ./GamePlayerInterface.h: missing or improper include guard in header
cosmetic change: GAMEPLAYINTERFACE_H -> GAMEPLAYERINTERFACE_H
> ./KBlocksConfigManager.cpp: include own header first line#18
Moved up.
> ./main.cpp: duplicate includes line#31,38(KBlocksPlayNetwork.h)
Second occurrence removed.
> ./KBlocksPieceGenerator.cpp: include own header first line#13
Moved up.
> 23. Check for postfix usage of ++ and -- [postfixop]...
> ./KBlocksNetServer.cpp: line#262 (1)
> ./KBlocksNetPlayer.cpp: line#121 (1)
> ./KBlocksGameRecorder.cpp: line#53,66 (2)
Easy fix as all are standalone expressions. So just replace.
> 30. Check for spelling errors [spelling]... 2 issues found
> ./AI/KBlocksAIPlanner.cpp: line#53[coloumn],78[coloumn] (2)
Trivial fix as both occurrences are in code comments.
gcc complains at AI/KBlocksAILog.cpp:80:
> warning: ignoring return value of 'int system(const char*)'
This is part of a function "clrscr()". Does not seem to have ever been
in use anywhere. Drop that function.
Diffs
-----
AI/KBlocksAILog.h 4de71f8
AI/KBlocksAILog.cpp 1988b3f
AI/KBlocksAIPlanner.h 9e72980
AI/KBlocksAIPlanner.cpp 625a868
AI/KBlocksAIPlannerExtend.h 019b57f
AI/KBlocksAIPlayer.h af7683f
KBlocksPieceGenerator.cpp 736e867
KBlocksWin.cpp 4156ef0
main.cpp 04aae7e
AI/PlannerInterface.h b3e57be
GamePlayerInterface.h ebbbe9b
KBlocksAppThread.h 405a7fd
KBlocksConfigManager.cpp e4d726d
KBlocksGameLogic.h b63bc43
KBlocksGameMessage.h bd763d9
KBlocksGameRecorder.cpp f3a6229
KBlocksNetPlayer.cpp 0bc00f4
KBlocksNetServer.cpp 5842d3c
KBlocksPieceGenerator.h 41da247
Diff: https://git.reviewboard.kde.org/r/120169/diff/
Testing
-------
* compiles fine
* those krazy2 warnings that this patch addresses are gone (and no new warnings introduced)
* gcc warning about return value is gone
* runs fine
Thanks,
Martin Walch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20140913/1fd14e0e/attachment.html>
More information about the kde-games-devel
mailing list