X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftally%2Ftally.c;h=0d0190795557b60ccfe8d73138dfda2baf99477d;hp=b89b0600ac301d0f5d088cb5a31176c841e1c8c3;hb=fb9514a55b818d5d9bf929c2c2aaac37a4d68747;hpb=60b47bf5e0878f014eb1e33e7784c92e43e2fcb6 diff --git a/ccan/tally/tally.c b/ccan/tally/tally.c index b89b0600..0d019079 100644 --- a/ccan/tally/tally.c +++ b/ccan/tally/tally.c @@ -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