cast length as CFIndex #warning fix