const_cast input array to non-const for 10.7 compatibility