base/ct.[ch]: Set the return type of `ct_pick' correctly.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 7 Jun 2021 23:28:58 +0000 (00:28 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 1 May 2022 17:54:54 +0000 (18:54 +0100)
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.

base/ct.c
base/ct.h

index 5393450..989f8d6 100644 (file)
--- 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@ --- *
index 445d889..81f49cb 100644 (file)
--- 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@ --- *
  *