Set the cap->ptr cast operation to the right type.