+static inline void calc_unit_vector(FT_Vector *vec) +{
- FT_Fixed len;
- len = pFT_Vector_Length(vec);
- vec->x = (vec->x << 6) / len;
- vec->y = (vec->y << 6) / len;
+}
For what it's worth, that's usually called normalisation. Given how this is used, there's probably something to be said for not modifying the input vector and just having an output variable instead.