remove all const to non const cast and fix all associated warning.