Fix -Wcast-qual pulled by -Werror of gcc-4.7

Pointed out by A. Mallet.
Synchronize.