The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: sanna on July 16, 2009, 10:17:49 AM

Title: Repeated warning on unused variable sp
Post by: sanna on July 16, 2009, 10:17:49 AM
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.
Title: Re: Repeated warning on unused variable sp
Post by: Dwachs on July 16, 2009, 10:42:36 AM
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..
Title: Re: Repeated warning on unused variable sp
Post by: prissi on July 16, 2009, 01:56:58 PM
There is no save way; even more since different compilers on different architektures spit different warnings.