Small change to compile on Visual Studio 2010, and remove some cast warn...

...ings. 
Please could you merge, i would much appreciate.
I'm a 44 years old french professionnal developper on C/C++/C#