More Linux work. Convert all casts to new style, away from legacy.