opt: handle -Wcast-qual warnings.