[xiph-cvs] cvs commit: vorbis/lib floor1.c

Monty xiphmont at xiph.org
Wed Jul 17 18:42:00 PDT 2002



xiphmont    02/07/17 18:42:00

  Modified:    lib      floor1.c
  Log:
  Not really a bugfix, but 'correct' the confusing ilog2 which looks broken

Revision  Changes    Path
1.24      +3 -2      vorbis/lib/floor1.c

Index: floor1.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/floor1.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- floor1.c	2002/07/11 06:40:48	1.23
+++ floor1.c	2002/07/18 01:41:59	1.24
@@ -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 ilog2(unsigned int v){
   int ret=0;
-  while(v>1){
+  if(v)--v;
+  while(v){
     ret++;
     v>>=1;
   }

<p><p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list