Fix compat implementation of ffs() to return 1-based bit numbers.
authorAndrzej Trznadel <Andrzej.Trznadel@intel.com>
Mon, 17 Mar 2008 22:52:08 +0000 (15:52 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 17 Mar 2008 22:52:08 +0000 (15:52 -0700)
src/mesa/main/imports.c

index 3ae56c8b0b64ba66c70ec00833945f398228b43f..7d4b120099203cf9e02e70782499800b91e3dda9 100644 (file)
@@ -560,6 +560,7 @@ _mesa_ffs(int i)
          bit++;
          i >>= 1;
       }
+      bit++;
    }
    return bit;
 #else