]> git.ozlabs.org Git - ccan/blobdiff - ccan/tally/tally.c
tally: Adapt bucket_min to Samba coding conventions
[ccan] / ccan / tally / tally.c
index d67112c2cf6da49017904be9ec91b49f1f11ced5..1c471c1503ec51ff57177db1d71d0ffaa5019455 100644 (file)
@@ -52,8 +52,9 @@ struct tally *tally_new(unsigned buckets)
 static unsigned bucket_of(ssize_t min, unsigned step_bits, ssize_t val)
 {
        /* Don't over-shift. */
-       if (step_bits == SIZET_BITS)
+       if (step_bits == SIZET_BITS) {
                return 0;
+       }
        assert(step_bits < SIZET_BITS);
        return (size_t)(val - min) >> step_bits;
 }
@@ -62,8 +63,9 @@ static unsigned bucket_of(ssize_t min, unsigned step_bits, ssize_t val)
 static ssize_t bucket_min(ssize_t min, unsigned step_bits, unsigned b)
 {
        /* Don't over-shift. */
-       if (step_bits == SIZET_BITS)
+       if (step_bits == SIZET_BITS) {
                return min;
+       }
        assert(step_bits < SIZET_BITS);
        return min + ((ssize_t)b << step_bits);
 }