Your fix requires a lot of mental CPU cycles on the part of whoever reads the code. Are you sure it wouldn't have been better to do it the simple, obvious way?
double a = *(double *) dpa;
double b = *(double *) dpb;
if (a > b) return 1;
if (b < a) return -1;
return 0;