From: Nicholas Nethercote Date: Thu, 22 Dec 2005 19:50:45 +0000 (+0000) Subject: Add comment about log2(). X-Git-Tag: svn/VALGRIND_3_2_0~467 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1eb0c46b9fe2e7ea98cc2a4c56c6cfd029f20566;p=thirdparty%2Fvalgrind.git Add comment about log2(). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5408 --- diff --git a/coregrind/m_libcbase.c b/coregrind/m_libcbase.c index 4a53095227..cd620cc973 100644 --- a/coregrind/m_libcbase.c +++ b/coregrind/m_libcbase.c @@ -413,6 +413,7 @@ Int VG_(memcmp) ( const void* s1, const void* s2, SizeT n ) Misc useful functions ------------------------------------------------------------------ */ +/* Returns the base-2 logarithm of x. Returns -1 if x is not a power of two. */ Int VG_(log2) ( Int x ) { Int i; diff --git a/include/pub_tool_libcbase.h b/include/pub_tool_libcbase.h index cc1a55e371..f9d0eeec5f 100644 --- a/include/pub_tool_libcbase.h +++ b/include/pub_tool_libcbase.h @@ -111,7 +111,7 @@ extern Int VG_(memcmp) ( const void* s1, const void* s2, SizeT n ); extern void VG_(ssort)( void* base, SizeT nmemb, SizeT size, Int (*compar)(void*, void*) ); -/* Returns the base-2 logarithm of x. */ +/* Returns the base-2 logarithm of x. Returns -1 if x is not a power of two. */ extern Int VG_(log2) ( Int x ); // A pseudo-random number generator returning a random UInt. If pSeed