Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Document ilog2() from <sys/bitops.h>.
details: https://anonhg.NetBSD.org/src/rev/be025a69ec39
branches: trunk
changeset: 755518:be025a69ec39
user: jruoho <jruoho%NetBSD.org@localhost>
date: Tue Jun 08 08:51:08 2010 +0000
description:
Document ilog2() from <sys/bitops.h>.
diffstat:
distrib/sets/lists/comp/mi | 5 ++-
share/man/man3/Makefile | 7 ++--
share/man/man3/ilog2.3 | 63 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+), 4 deletions(-)
diffs (118 lines):
diff -r 7ff78838291c -r be025a69ec39 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi Tue Jun 08 08:24:16 2010 +0000
+++ b/distrib/sets/lists/comp/mi Tue Jun 08 08:51:08 2010 +0000
@@ -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
diff -r 7ff78838291c -r be025a69ec39 share/man/man3/Makefile
--- a/share/man/man3/Makefile Tue Jun 08 08:24:16 2010 +0000
+++ b/share/man/man3/Makefile Tue Jun 08 08:51:08 2010 +0000
@@ -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
diff -r 7ff78838291c -r be025a69ec39 share/man/man3/ilog2.3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man3/ilog2.3 Tue Jun 08 08:51:08 2010 +0000
@@ -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 .
Home |
Main Index |
Thread Index |
Old Index