Skip to content
Commit da195a0a authored by Martin Walch's avatar Martin Walch Committed by Albert Astals Cid
Browse files

Fix some warnings from Kapman

Make single parameter constructors explicit
krazy2 complained:

    Check for C++ ctors that should be declared 'explicit' [explicit]...
    OOPS! 7 issues found!

    gameview.h: line# 40 (1)
    ghostitem.h: line# 43 (1)
    characteritem.h: line# 47 (1)
    kapmanparser.h: line# 47 (1)
    kapmanitem.h: line# 55 (1)
    gamescene.h: line# 83 (1)
    elementitem.h: line# 47 (1)

Fix it by making them explicit.

This is a minor change in a public API and I guess it could potentially
break code that uses those constructors implicitely, but as Kapman
compiles fine, there seems not to be any such code in Kapman itself
and I doubt that there is any other project that uses classes of Kapman.

    Fix doxygen for void setRotationFlag(bool rotate) in kapmanitem.h

It accidentally read

    @param 0 or 1

instead of

    @param rotate 0 or 1

Trivial fix. Silences two warnings from doxygen log.

    Fix gcc warning -Wunused-but-set-variable: remove bool halfTurnRequired

gcc reported this warning:
ghost.cpp: In member function 'virtual void Ghost::updateMove()':
ghost.cpp:71:7: warning: variable 'halfTurnRequired' set but not
used [-Wunused-but-set-variable]

This is due to a bool variable "halfTurnRequired" which has a value
assigned in five places, but is never read nor returned.

When looking through the commit history, this seems to have never been
in use at all. I guess in the first place it was meant to replace

    if (directionsList.size() == 0) {

with

    if (halfTurnRequired) {

but I do not think it is worth it. So, just remove it completely.

(Also fix a typo in a comment: turnning -> turning)

REVIEW: 120072
parent bfdfbae9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment