Index: head/sys/sys/qmath.h =================================================================== --- head/sys/sys/qmath.h +++ head/sys/sys/qmath.h @@ -267,7 +267,7 @@ /* Left shift an integral value to align with the int bits of 'q'. */ #define Q_SHL(q, iv) \ - (Q_LTZ(iv) ? -(Q_ABS(iv) << Q_NFBITS(q)) : \ + (Q_LTZ(iv) ? -(int64_t)(Q_ABS(iv) << Q_NFBITS(q)) : \ Q_TC(q, iv) << Q_NFBITS(q)) /* Calculate the relative fractional precision between 'a' and 'b' in bits. */ Index: head/tests/sys/sys/qmath_test.c =================================================================== --- head/tests/sys/sys/qmath_test.c +++ head/tests/sys/sys/qmath_test.c @@ -208,7 +208,9 @@ { s64q_t a_s64q, b_s64q, r_s64q; double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; +#ifdef notyet int64_t a_int, b_int; +#endif int error; srandomdev(); @@ -231,8 +233,6 @@ * test with equal precision. */ Q_SCVAL(b_s64q, Q_GCVAL(a_s64q)); - a_int = Q_GIVAL(a_s64q); - b_int = Q_GIVAL(b_s64q); /* QQ testing. */ a_dbl = Q_Q2D(a_s64q); @@ -247,6 +247,9 @@ r_dbl = a_dbl * b_dbl; #ifdef notyet + a_int = Q_GIVAL(a_s64q); + b_int = Q_GIVAL(b_s64q); + maxe_dbl = fabs(((1.0 / Q_NFBITS(a_s64q)) * (double)b_int) + ((1.0 / Q_NFBITS(b_s64q)) * (double)a_int)); #else @@ -270,7 +273,6 @@ { s64q_t a_s64q, b_s64q, r_s64q; double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; - int64_t a_int, b_int; int error; srandomdev(); @@ -283,8 +285,6 @@ * test with equal precision. */ Q_SCVAL(b_s64q, Q_GCVAL(a_s64q)); - a_int = Q_GIVAL(a_s64q); - b_int = Q_GIVAL(b_s64q); /* QQ testing. */ a_dbl = Q_Q2D(a_s64q); @@ -318,7 +318,6 @@ { s64q_t a_s64q, b_s64q, r_s64q; double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; - int64_t a_int, b_int; int error; srandomdev(); @@ -331,8 +330,6 @@ * test with equal precision. */ Q_SCVAL(b_s64q, Q_GCVAL(a_s64q)); - a_int = Q_GIVAL(a_s64q); - b_int = Q_GIVAL(b_s64q); /* QQ testing. */ a_dbl = Q_Q2D(a_s64q); @@ -369,7 +366,6 @@ { s64q_t a_s64q, b_s64q, r_s64q; double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; - int64_t a_int, b_int; int error; srandomdev(); @@ -382,8 +378,6 @@ * test with equal precision. */ Q_SCVAL(b_s64q, Q_GCVAL(a_s64q)); - a_int = Q_GIVAL(a_s64q); - b_int = Q_GIVAL(b_s64q); /* QQ testing. */ a_dbl = Q_Q2D(a_s64q);