Use c++ style casts and prevent C-style casts.

Signed-off-by: Guillaume Clement <gclement@baobob.org>