Centex swings to loss in first quarter