TrinityCore/TrinityCore — pull request #5870 by Elron103 (2012-03-24 17:27:07+00:00)
Title: Core: Fix warnings

Hey there,

compiling a new TrinityCore version, I noticed several compiler warnings.

## Versions
* TrinityCore: https://github.com/TrinityCore/TrinityCore/commit/be871b2e350870462fd576ba85e27c7bdac8cdbc + several custom modifications
* CMake for Windows: 2.8.6
* Compiler: Microsoft Visual Studio C++ Express 2008

## Description / Fix Explanation
The most important compile warnings have been introduced in revision:
https://github.com/TrinityCore/TrinityCore/commit/72675d55d821e0648c53d53d78a1690276103c8c

The variable "uint16 index = 0;" is passed to a function, which expects an uint8 variable. This causes the compile warning:

11>..\..\..\..\src\server\game\Entities\Player\Player.cpp(18482) : warning C4244: 'argument' : conversion from 'uint16' to 'const uint8', possible loss of data

It is safe to change the variable type to uint8 because the maximum value of index will be 62. The if ... else structure of the code keeps the maximum number that low.

There are several other warnings, which are mostly caused by a conversion of floats => ints or times => ints. It is always safe to force the conversion there.

As it seems, the warnings are not fixed until now.

Original source: #4818