deactivated unused variable 'mode'
removed unused definition of REPLACEMENT_IN_PROGRESS
Fixed warning for const-ptr cast

Made target variable a const pointer too. Had to change a the function definition and implementation of
VirtualTrainFromTemplateVehicle(TemplateVehicle*)
to
VirtualTrainFromTemplateVehicle(const TemplateVehicle*).
Removed two unused variables

Those where probably just used for debugging from gdb.
Removed unused variable

Also removed its computation as it didn't add anything else.
Fixed variable type mismatch

(And removed an unused computation)
Reapplied a removed line from commit 977495

Otherwise, a clean make would not have worked out successfully.
But the header file was no good place for the variable declaration.
Fixed variable type mismatch
Moved declaration back: REPLACEMENT_IN_PROGRESS

and split it up in two in order to suppress the annoying 'no used' warning.
The actual use of this thing (vehicle.cpp:984) should be determined more closely...
Reverted all changes on REPLACEMENT_IN_PROGRESS

Splitting it didn't even work...
Will have to look at this later on.
Fixed several variable type mismatches

Those where 4 symmetrical cases in the same file where a looping variable was of type int while it was compared against a uint in the loop condition.
Removed unused variables

Two instances of an unused Command function return value.
Removed decl & uses of REPLACEMENT_IN_PROGRESS

There seemed to be no functional use of this value.