Module Name:    src
Committed By:   jruoho
Date:           Tue Jun  8 08:51:09 UTC 2010

Modified Files:
        src/distrib/sets/lists/comp: mi
        src/share/man/man3: Makefile
Added Files:
        src/share/man/man3: ilog2.3

Log Message:
Document ilog2() from <sys/bitops.h>.


To generate a diff of this commit:
cvs rdiff -u -r1.1459 -r1.1460 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.54 -r1.55 src/share/man/man3/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3/ilog2.3

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1459 src/distrib/sets/lists/comp/mi:1.1460
--- src/distrib/sets/lists/comp/mi:1.1459	Tue Jun  8 05:40:26 2010
+++ src/distrib/sets/lists/comp/mi	Tue Jun  8 08:51:08 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1459 2010/06/08 05:40:26 jruoho Exp $
+#	$NetBSD: mi,v 1.1460 2010/06/08 08:51:08 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6175,6 +6175,7 @@
 ./usr/share/man/cat3/if_indextoname.0		comp-c-catman		.cat
 ./usr/share/man/cat3/if_nameindex.0		comp-c-catman		.cat
 ./usr/share/man/cat3/if_nametoindex.0		comp-c-catman		.cat
+./usr/share/man/cat3/ilog2.0			comp-c-catman		.cat
 ./usr/share/man/cat3/ilogb.0			comp-c-catman		.cat
 ./usr/share/man/cat3/ilogbf.0			comp-c-catman		.cat
 ./usr/share/man/cat3/imaxabs.0			comp-c-catman		.cat
@@ -12046,6 +12047,7 @@
 ./usr/share/man/html3/if_indextoname.html	comp-c-htmlman		html
 ./usr/share/man/html3/if_nameindex.html		comp-c-htmlman		html
 ./usr/share/man/html3/if_nametoindex.html	comp-c-htmlman		html
+./usr/share/man/html3/ilog2.html		comp-c-htmlman		html
 ./usr/share/man/html3/ilogb.html		comp-c-htmlman		html
 ./usr/share/man/html3/ilogbf.html		comp-c-htmlman		html
 ./usr/share/man/html3/imaxabs.html		comp-c-htmlman		html
@@ -17835,6 +17837,7 @@
 ./usr/share/man/man3/if_indextoname.3		comp-c-man		.man
 ./usr/share/man/man3/if_nameindex.3		comp-c-man		.man
 ./usr/share/man/man3/if_nametoindex.3		comp-c-man		.man
+./usr/share/man/man3/ilog2.3			comp-c-man		.man
 ./usr/share/man/man3/ilogb.3			comp-c-man		.man
 ./usr/share/man/man3/ilogbf.3			comp-c-man		.man
 ./usr/share/man/man3/imaxabs.3			comp-c-man		.man

Index: src/share/man/man3/Makefile
diff -u src/share/man/man3/Makefile:1.54 src/share/man/man3/Makefile:1.55
--- src/share/man/man3/Makefile:1.54	Wed May 19 06:28:53 2010
+++ src/share/man/man3/Makefile	Tue Jun  8 08:51:09 2010
@@ -1,10 +1,11 @@
-#	$NetBSD: Makefile,v 1.54 2010/05/19 06:28:53 jruoho Exp $
+#	$NetBSD: Makefile,v 1.55 2010/06/08 08:51:09 jruoho Exp $
 #	@(#)Makefile	8.2 (Berkeley) 12/13/93
 
 MAN=	_DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
 	__arraycount.3 assert.3 bits.3 bitstring.3 dirent.3 dlfcn.3 end.3 \
-	fast_divide32.3 ffs32.3 gcq.3 intro.3 inttypes.3 iso646.3 offsetof.3 \
-	queue.3 rb.3 sigevent.3 \
+	fast_divide32.3 ffs32.3 gcq.3 \
+	ilog2.3 intro.3 inttypes.3 iso646.3 \
+	offsetof.3 queue.3 rb.3 sigevent.3 \
 	stdarg.3 stdbool.3 stddef.3 stdint.3 stdlib.3 sysexits.3 \
 	tgmath.3 timeradd.3 timeval.3 tree.3 types.3 varargs.3
 

Added files:

Index: src/share/man/man3/ilog2.3
diff -u /dev/null src/share/man/man3/ilog2.3:1.1
--- /dev/null	Tue Jun  8 08:51:09 2010
+++ src/share/man/man3/ilog2.3	Tue Jun  8 08:51:09 2010
@@ -0,0 +1,63 @@
+.\" $NetBSD: ilog2.3,v 1.1 2010/06/08 08:51:09 jruoho Exp $ $
+.\"
+.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Jukka Ruohonen.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd June 8, 2010
+.Os
+.Dt ILOG2 3
+.Sh NAME
+.Nm ilog2
+.Nd integer logarithm
+.Sh SYNOPSIS
+.In sys/bitops.h
+.Ft size
+.Fn ilog2 "size x"
+.Sh DESCRIPTION
+The
+.Fn ilog2
+macro returns an integer (binary) logarithm of
+.Fa x .
+It is the logarithm for base 2; the binary logarithm of
+.Fa x
+is the power to which the number 2 must be raised to obtain the value
+.Fa x .
+.Pp
+The type of the input parameter should be either
+.Vt uint32_t
+or
+.Vt uint64_t .
+.Sh ERRORS
+A value \-1 is returned on error.
+.Sh SEE ALSO
+.Xr log2 3 ,
+.Xr imax 9
+.Sh HISTORY
+The
+.Fn ilog2
+macro first appeared in
+.Nx 5.0 .

Reply via email to