hash: use config.h settings for endian.
[ccan] / ccan / tally / tally.c
index b89b0600ac301d0f5d088cb5a31176c841e1c8c3..0d0190795557b60ccfe8d73138dfda2baf99477d 100644 (file)
@@ -322,7 +322,7 @@ ssize_t tally_total(const struct tally *tally, ssize_t *overflow)
        }
 
        /* If result is negative, make sure we can represent it. */
-       if (tally->total[1] & (1 << (SIZET_BITS-1))) {
+       if (tally->total[1] & ((size_t)1 << (SIZET_BITS-1))) {
                /* Must have only underflowed once, and must be able to
                 * represent result at ssize_t. */
                if ((~tally->total[1])+1 != 0