News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

Repeated warning on unused variable sp

Started by sanna, July 16, 2009, 10:17:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sanna

When compiling the source code there is quite a lot of warnings spit out - which makes it difficult to see if there is a real problem. One of the most frequent warnings is:
bauer/../simwerkz.h:94: warning: unused parameter 'sp'
bauer/../simwerkz.h:108: warning: unused parameter 'sp'

The two lines are identical:
virtual image_id get_icon(spieler_t *sp) const { return grund_t::underground_mode==grund_t::ugm_all ? IMG_LEER : icon; }
By removing the 'sp' and changing these to:
virtual image_id get_icon(spieler_t *) const { return grund_t::underground_mode==grund_t::ugm_all ? IMG_LEER : icon; }
I am able to compile without these warning messages, and the game starts and I see no immediate ill effect to the tool bar - however I am not a coder, so there might be something I have overlooked.

Dwachs

Your change does not harm.

Does anybody knows how to get rid of such a warning with the help of a script? I dont feel like editing 100 and delete superflous parameter names..
Parsley, sage, rosemary, and maggikraut.

prissi

There is no save way; even more since different compilers on different architektures spit different warnings.