Skip to content

Commit

Permalink
Use NEG_CAST
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Bodrato committed May 6, 2018
1 parent f9f7507 commit f70425f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mpf/fits_s.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ FUNCTION (mpf_srcptr f) __GMP_NOTHROW
else
return 0;

return fl <= (fs >= 0 ? (mp_limb_t) MAXIMUM : - (mp_limb_t) MINIMUM);
return fl <= (fs >= 0 ? (mp_limb_t) MAXIMUM : NEG_CAST (mp_limb_t, MINIMUM));
}
2 changes: 1 addition & 1 deletion mpn/generic/get_d.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ mpn_get_d (mp_srcptr up, mp_size_t size, mp_size_t sign, long exp)
else
{
weight = 0.5;
uexp = 1 - (unsigned long) (exp + 1);
uexp = NEG_CAST (unsigned long, exp);
}
#if 1
/* Square-and-multiply exponentiation. */
Expand Down
2 changes: 1 addition & 1 deletion scanf/doscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ gmpscan (const struct gmp_doscan_funs_t *funs, void *data,
if (exp >= 0)
mpf_mul_2exp (f, f, (unsigned long) exp);
else
mpf_div_2exp (f, f, - (unsigned long) exp);
mpf_div_2exp (f, f, NEG_CAST (unsigned long, exp));
}
}
break;
Expand Down

0 comments on commit f70425f

Please sign in to comment.