Add proper const declaration to a cast, fixes a warning