1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -05:00

Add functions mp_max and mp_max_into.

These are easy, and just like the existing mp_min family; I just
hadn't needed them before now.
This commit is contained in:
Simon Tatham
2019-01-29 20:02:39 +00:00
parent 715356e6d2
commit d4ad7272fd
4 changed files with 27 additions and 5 deletions

View File

@ -152,10 +152,13 @@ unsigned mp_hs_integer(mp_int *x, uintmax_t n);
unsigned mp_eq_integer(mp_int *x, uintmax_t n);
/*
* Take the minimum of two mp_ints, without using a conditional branch.
* Take the minimum or maximum of two mp_ints, without using a
* conditional branch.
*/
void mp_min_into(mp_int *r, mp_int *x, mp_int *y);
void mp_max_into(mp_int *r, mp_int *x, mp_int *y);
mp_int *mp_min(mp_int *x, mp_int *y);
mp_int *mp_max(mp_int *x, mp_int *y);
/*
* Diagnostic function. Writes out x in hex to the supplied stdio