Module Name:    src
Committed By:   jym
Date:           Tue May  3 21:37:00 UTC 2011

Modified Files:
        src/sys/sys: bitops.h

Log Message:
Use fls64() only for types strictly bigger than 4 bytes.

ok christos@. Will ask for a pull-up, using 64 bits ops even for 4-bytes
int's is plain overkill.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/sys/bitops.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/bitops.h
diff -u src/sys/sys/bitops.h:1.7 src/sys/sys/bitops.h:1.8
--- src/sys/sys/bitops.h:1.7	Sun Mar 21 14:28:15 2010
+++ src/sys/sys/bitops.h	Tue May  3 21:36:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bitops.h,v 1.7 2010/03/21 14:28:15 christos Exp $	*/
+/*	$NetBSD: bitops.h,v 1.8 2011/05/03 21:36:59 jym Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2010 The NetBSD Foundation, Inc.
@@ -255,7 +255,7 @@
 	_ilog2_helper(_n,  2) \
 	_ilog2_helper(_n,  1) \
 	_ilog2_helper(_n,  0) \
-	-1) : ((sizeof(_n) >= 4 ? fls64(_n) : fls32(_n)) - 1) \
+	-1) : ((sizeof(_n) > 4 ? fls64(_n) : fls32(_n)) - 1) \
 )
 
 static __inline void

Reply via email to