提交 8d371d4b 编写于 作者: A aliguori

Define fls() in terms of clz32().

As suggested by Laurent Desnogues.
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5872 c046a42c-6fe2-441c-8c8c-71466251a162
上级 f46f15bc
......@@ -22,6 +22,7 @@
* THE SOFTWARE.
*/
#include "qemu-common.h"
#include "host-utils.h"
void pstrcpy(char *buf, int buf_size, const char *str)
{
......@@ -98,11 +99,5 @@ time_t mktimegm(struct tm *tm)
int fls(int i)
{
int bit;
for (bit=31; bit >= 0; bit--)
if (i & (1 << bit))
return bit+1;
return 0;
return 32 - clz32(i);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册