]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Compile fixes for uint128 library (#3332)
authorHerwin <herwin@snt.utwente.nl>
Sat, 21 Mar 2020 16:53:31 +0000 (17:53 +0100)
committerGitHub <noreply@github.com>
Sat, 21 Mar 2020 16:53:31 +0000 (10:53 -0600)
src/lib/util/uint128.h

index 1d981cbc4914c65fc650d09ec4422d280dc2680d..dc53e27ac2d2fcfa7b1eed84cd18a9650bf5f211 100644 (file)
@@ -85,9 +85,9 @@ static uint128_t uint128_gen_mask(uint8_t bits)
  *
  * @author Jacob F. W
  */
-static uint128_t uint128_increment(uint128_t *n)
+static uint128_t uint128_increment(uint128_t n)
 {
-       uint64 t = (n.l + 1);
+       uint64_t t = (n.l + 1);
 
        n.h += ((n.l ^ t) & n.l) >> 63;
        n.l = t;
@@ -99,9 +99,9 @@ static uint128_t uint128_increment(uint128_t *n)
  *
  * @author Jacob F. W
  */
-static uint128_t uint128_decrement(uint128_t *n)
+static uint128_t uint128_decrement(uint128_t n)
 {
-       uint64 t = (n.l - 1);
+       uint64_t t = (n.l - 1);
        n.h -= ((t ^ n.l) & t) >> 63;
        n.l = t;
 
@@ -141,7 +141,7 @@ static uint128_t uint128_sub(uint128_t a, uint128_t b)
  *
  * @author Jacob F. W
  */
-static uint128_t uint128_mul64(uint64 u, uint64 v)
+static uint128_t uint128_mul64(uint64_t u, uint64_t v)
 {
        uint128_t ret;
        uint64_t u1 = (u & 0xffffffff);
@@ -166,6 +166,8 @@ static uint128_t uint128_mul64(uint64 u, uint64 v)
 
        ret.h = (u * v) + w1 + k;
        ret.l = (t << 32) + w3;
+
+       return ret;
 }
 
 /** Multiply two unsigned 128bit integers