From: Monty Date: Thu, 18 Jul 2002 01:41:59 +0000 (+0000) Subject: Not really a bugfix, but 'correct' the confusing ilog2 which looks broken X-Git-Tag: v1.3.3~698 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e03bb0404b577bafe9c8bc5233c1cc9eb58ce68e;p=platform%2Fupstream%2Flibvorbis.git Not really a bugfix, but 'correct' the confusing ilog2 which looks broken svn path=/trunk/vorbis/; revision=3653 --- diff --git a/lib/floor1.c b/lib/floor1.c index 8451ebc..338d02e 100644 --- a/lib/floor1.c +++ b/lib/floor1.c @@ -11,7 +11,7 @@ ******************************************************************** function: floor backend 1 implementation - last mod: $Id: floor1.c,v 1.23 2002/07/11 06:40:48 xiphmont Exp $ + last mod: $Id: floor1.c,v 1.24 2002/07/18 01:41:59 xiphmont Exp $ ********************************************************************/ @@ -95,7 +95,8 @@ static int ilog(unsigned int v){ static int ilog2(unsigned int v){ int ret=0; - while(v>1){ + if(v)--v; + while(v){ ret++; v>>=1; }