From: Volker Lendecke Date: Wed, 10 Aug 2011 17:42:54 +0000 (+0200) Subject: tally: Fix a c++ warning X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=16a578430f15e1e54001a303b4e1363c33d04931;ds=sidebyside tally: Fix a c++ warning (Imported from SAMBA commit 54282e9f4eda083e70c7e56dda2bf425209add6d) --- diff --git a/ccan/tally/tally.c b/ccan/tally/tally.c index 0d493196..d3d320eb 100644 --- a/ccan/tally/tally.c +++ b/ccan/tally/tally.c @@ -31,7 +31,8 @@ struct tally *tally_new(unsigned buckets) /* Overly cautious check for overflow. */ if (sizeof(*tally) * buckets / sizeof(*tally) != buckets) return NULL; - tally = malloc(sizeof(*tally) + sizeof(tally->counts[0])*(buckets-1)); + tally = (struct tally *)malloc( + sizeof(*tally) + sizeof(tally->counts[0])*(buckets-1)); if (tally) { tally->max = ((size_t)1 << (SIZET_BITS - 1)); tally->min = ~tally->max;