Game Development Community

Unused variable in console.cc

by Fyodor -bank- Osokin · in Torque Game Engine · 07/22/2007 (6:40 am) · 4 replies

If you go /engine/console/console.cc (.cpp) you will fnid there declaration:
static S32 printLevel = 10;
and console variable assignment:
addVariable("Con::printLevel", TypeS32, &printLevel);
but, this variable is not used at all. Why it exists in engine? :) It's safe to remove it to keep code "clean".

#1
07/22/2007 (7:43 am)
There are tons of unused variables like this around. They are most likely leftovers from the Tribes II source, and in your case some verbose setting for the console messages.

It's safe to remove it.
#2
08/04/2007 (1:06 pm)
Maybe a page in the TDN wiki should be added for listing these things (if there really are tons)?

I know of at least two:
(TGEA) platform/platformMemory.cpp:

U32 gInsertCount = 0;
U32 gRemoveCount = 0;


they are never used

-kornman00
#3
08/04/2007 (1:58 pm)
Define tons ;)

Those variables won't kill or make your game. It's just cleanup.
#4
08/04/2007 (2:39 pm)
Scores :P

Still, a tidy game engine is a happy game engine (executable) :)

(I've seen even VC++'s compiler on full optimization, still include totally unreferenced data :|)