From d96e722b0cd7f43d88875e8a34170dc607222f10 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 24 Apr 2012 16:17:36 -0700 Subject: [PATCH] huffman: quiet int64 -> int conversion warning children_ is bounded by max_nodes_ and protected with IsFull checks Change-Id: Iac1eb03c5030568140352174c1265a938fc28d97 --- src/utils/huffman.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/huffman.c b/src/utils/huffman.c index 0950839c..c5b322d3 100644 --- a/src/utils/huffman.c +++ b/src/utils/huffman.c @@ -35,7 +35,8 @@ static int IsFull(const HuffmanTree* const tree) { static void AssignChildren(HuffmanTree* const tree, HuffmanTreeNode* const node) { HuffmanTreeNode* const children = tree->root_ + tree->num_nodes_; - node->children_ = children - node; + node->children_ = (int)(children - node); + assert(children - node == (int)(children - node)); tree->num_nodes_ += 2; TreeNodeInit(children + 0); TreeNodeInit(children + 1);