cast: fix compilation with GCC's -Wcast-qual