From: Mark Wooding Date: Mon, 7 Jun 2021 23:28:58 +0000 (+0100) Subject: base/ct.[ch]: Set the return type of `ct_pick' correctly. X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/commitdiff_plain/0c770f015ef72ae90079af7373b9b2c553461071?ds=sidebyside base/ct.[ch]: Set the return type of `ct_pick' correctly. This is, technically speaking, an API break. But I don't think anything actually cares, this is an improvement, and the ABI is unchanged on every platform I can think of. --- diff --git a/base/ct.c b/base/ct.c index 5393450b..989f8d6f 100644 --- a/base/ct.c +++ b/base/ct.c @@ -105,7 +105,7 @@ int ct_intle(uint32 x, uint32 y) * constant time. */ -int ct_pick(uint32 a, uint32 x0, uint32 x1) +uint32 ct_pick(uint32 a, uint32 x0, uint32 x1) { uint32 m = MASK(a); return (x0&~m) | (x1&m); } /* --- @ct_condcopy@ --- * diff --git a/base/ct.h b/base/ct.h index 445d889d..81f49cb0 100644 --- a/base/ct.h +++ b/base/ct.h @@ -72,7 +72,7 @@ extern int ct_intle(uint32 /*x*/, uint32 /*y*/); * constant time. */ -extern int ct_pick(uint32 /*a*/, uint32 /*x0*/, uint32 /*x1*/); +extern uint32 ct_pick(uint32 /*a*/, uint32 /*x0*/, uint32 /*x1*/); /* --- @ct_condcopy@ --- * *