X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftally%2Ftally.c;h=0d0190795557b60ccfe8d73138dfda2baf99477d;hb=65c7607d7828bbb212dbbb8d82cd0bb0c5581faf;hp=b89b0600ac301d0f5d088cb5a31176c841e1c8c3;hpb=57d7208e55ede91db60bbedc52a4d73f05fff543;p=ccan-lca-2011.git diff --git a/ccan/tally/tally.c b/ccan/tally/tally.c index b89b060..0d01907 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