<pre style='margin:0'>
Chris Jones (cjones051073) pushed a commit to branch fls
in repository macports-legacy-support.
</pre>
<p><a href="https://github.com/macports/macports-legacy-support/commit/b30ee353387f655ab9ff9a3b12bc38fef4ce9fe5">https://github.com/macports/macports-legacy-support/commit/b30ee353387f655ab9ff9a3b12bc38fef4ce9fe5</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit b30ee353387f655ab9ff9a3b12bc38fef4ce9fe5
</span>Author: Chris Jones <jonesc@hep.phy.cam.ac.uk>
AuthorDate: Tue May 26 16:26:14 2020 +0100
<span style='display:block; white-space:pre;color:#404040;'> Add support for fls, flsl and flsll
</span>---
README.md | 2 +-
include/MacportsLegacySupport.h | 13 +++++++---
include/strings.h | 27 ++++++++++++++++++---
src/strings.c | 47 ++++++++++++++++++++++++++++++++---
test/test_ffsl.c | 27 ++++++++++++++++-----
test/test_flsl.c | 54 +++++++++++++++++++++++++++++++++++++++++
6 files changed, 154 insertions(+), 16 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/README.md b/README.md
</span><span style='display:block; white-space:pre;color:#808080;'>index c92c7c1..51f6a7d 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/README.md
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/README.md
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -69,7 +69,7 @@ Wrapped headers are:
</span> </tr>
<tr>
<td><code>strings.h</code></td>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- <td>Adds <code>ffsl</code>(OSX10.4) and <code>ffsll</code>(macOS10.8) functions</td>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <td>Adds <code>fls,flsl,ffsl</code>(OSX10.4) and <code>flsll,ffsll</code>(macOS10.8) functions</td>
</span> <td>OSX10.4(8)</td>
</tr>
<tr>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/include/MacportsLegacySupport.h b/include/MacportsLegacySupport.h
</span><span style='display:block; white-space:pre;color:#808080;'>index 0a582aa..fc7c370 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/include/MacportsLegacySupport.h
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/include/MacportsLegacySupport.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -119,10 +119,17 @@
</span> /* cossin */
#define __MP_LEGACY_SUPPORT_COSSIN__ (__APPLE__ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090)
<span style='display:block; white-space:pre;background:#e0ffe0;'>+/* ffsl */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MP_LEGACY_SUPPORT_FFSL__ (__APPLE__ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050)
</span> /* ffsll */
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#define __MP_LEGACY_SUPPORT_FFSLL__ (__APPLE__ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MP_LEGACY_SUPPORT_FFSLL__ (__APPLE__ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* fls */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MP_LEGACY_SUPPORT_FLS__ (__APPLE__ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* flsl */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MP_LEGACY_SUPPORT_FLSL__ (__APPLE__ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* flsll */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MP_LEGACY_SUPPORT_FLSLL__ (__APPLE__ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090)
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-/* ffsl */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#define __MP_LEGACY_SUPPORT_FFSL__ (__APPLE__ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050)
</span>
#endif /* _MACPORTS_LEGACYSUPPORTDEFS_H_ */
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/include/strings.h b/include/strings.h
</span><span style='display:block; white-space:pre;color:#808080;'>index 932c4dc..667ed3d 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/include/strings.h
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/include/strings.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -24,6 +24,13 @@
</span> /* Include the primary system string.h */
#include_next <strings.h>
<span style='display:block; white-space:pre;background:#e0ffe0;'>+/* ffsl */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MP_LEGACY_SUPPORT_FFSL__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+__MP__BEGIN_DECLS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern int ffsl(long int);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+__MP__END_DECLS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> /* ffsll */
#if __MP_LEGACY_SUPPORT_FFSLL__
__MP__BEGIN_DECLS
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -31,10 +38,24 @@ extern int ffsll(long long int);
</span> __MP__END_DECLS
#endif
<span style='display:block; white-space:pre;background:#ffe0e0;'>-/* ffsl */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#if __MP_LEGACY_SUPPORT_FFSL__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* fls */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MP_LEGACY_SUPPORT_FLS__
</span> __MP__BEGIN_DECLS
<span style='display:block; white-space:pre;background:#ffe0e0;'>-extern int ffsl(long int);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern int fls(int);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+__MP__END_DECLS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* flsl */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MP_LEGACY_SUPPORT_FLSL__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+__MP__BEGIN_DECLS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern int flsl(long int);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+__MP__END_DECLS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* flsll */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MP_LEGACY_SUPPORT_FLSLL__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+__MP__BEGIN_DECLS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+extern int flsll(long long int);
</span> __MP__END_DECLS
#endif
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/strings.c b/src/strings.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 3aacbdb..ff408a9 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/strings.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/strings.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,5 +1,7 @@
</span>
/*-
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ * SPDX-License-Identifier: BSD-3-Clause
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span> * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -31,6 +33,19 @@
</span> // MP support header
#include "MacportsLegacySupport.h"
<span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MP_LEGACY_SUPPORT_FFSL__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int ffsl(long mask)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int bit = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (mask != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (bit = 1; !(mask & 1); bit++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mask = (unsigned long)mask >> 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (bit);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> #if __MP_LEGACY_SUPPORT_FFSLL__
int ffsll(long long mask)
{
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -44,15 +59,41 @@ int ffsll(long long mask)
</span> }
#endif
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#if __MP_LEGACY_SUPPORT_FFSL__
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-int ffsl(long mask)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MP_LEGACY_SUPPORT_FLS__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int fls(int mask)
</span> {
int bit = 0;
if (mask != 0) {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- for (bit = 1; !(mask & 1); bit++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (bit = 1; mask != 1; bit++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mask = (unsigned int)mask >> 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (bit);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MP_LEGACY_SUPPORT_FLSL__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int flsl(long mask)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int bit = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (mask != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (bit = 1; mask != 1; bit++) {
</span> mask = (unsigned long)mask >> 1;
}
}
return (bit);
}
#endif
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MP_LEGACY_SUPPORT_FLSLL__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int flsll(long long mask)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int bit = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (mask != 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (bit = 1; mask != 1; bit++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mask = (unsigned long long)mask >> 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (bit);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/test/test_ffsl.c b/test/test_ffsl.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 4c0a16a..9e503cf 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/test/test_ffsl.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/test/test_ffsl.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -20,18 +20,33 @@
</span>
int main() {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int offset = 4;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf( "testing ffsl :-\n" );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for ( int i = 0; i <= 8*sizeof(int)-offset; i+=offset ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int ii = i+offset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ long int test = ( i>0 ? 1UL << (i-1) : 0 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test |= ( ii>0 ? 1UL << (ii-1) : 0 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int j = ffs(test);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf( " Set bits %i,%i - Found bit %i\n", i, ii, j );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> printf( "testing ffsl :-\n" );
<span style='display:block; white-space:pre;background:#ffe0e0;'>- for ( int i = 0; i <= 32; ++i ) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const long int test = ( i>0 ? 1UL << (i-1) : 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for ( int i = 0; i <= 8*sizeof(long int)-offset; i+=offset ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int ii = i+offset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ long int test = ( i>0 ? 1UL << (i-1) : 0 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test |= ( ii>0 ? 1UL << (ii-1) : 0 );
</span> const int j = ffsl(test);
<span style='display:block; white-space:pre;background:#ffe0e0;'>- printf( " Set bit %i - Found bit %i\n", i, j );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf( " Set bits %i,%i - Found bit %i\n", i, ii, j );
</span> }
printf( "testing ffsll :-\n" );
<span style='display:block; white-space:pre;background:#ffe0e0;'>- for ( int i = 0; i <= 64; ++i ) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const long long int test = ( i>0 ? 1UL << (i-1) : 0 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for ( int i = 0; i <= 8*sizeof(long long int)-offset; i+=offset ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int ii = i+offset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ long long int test = ( i>0 ? 1UL << (i-1) : 0 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test |= ( ii>0 ? 1UL << (ii-1) : 0 );
</span> const int j = ffsll(test);
<span style='display:block; white-space:pre;background:#ffe0e0;'>- printf( " Set bit %i - Found bit %i\n", i, j );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf( " Set bits %i,%i - Found bit %i\n", i, ii, j );
</span> }
return 0;
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/test/test_flsl.c b/test/test_flsl.c
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..4efa35c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/test/test_flsl.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,54 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Copyright (c) 2020 Chris Jones
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * Permission to use, copy, modify, and distribute this software for any
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * purpose with or without fee is hereby granted, provided that the above
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * copyright notice and this permission notice appear in all copies.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <stdio.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include <strings.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int main() {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int offset = 4;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf( "testing fls :-\n" );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for ( int i = 0; i <= 8*sizeof(int)-offset; i+=offset ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int ii = i+offset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int test = ( i>0 ? 1UL << (i-1) : 0 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test |= ( ii>0 ? 1UL << (ii-1) : 0 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int j = fls(test);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf( " Set bits %i,%i - Found bit %i\n", i, ii, j );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf( "testing flsl :-\n" );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for ( int i = 0; i <= 8*sizeof(long int)-offset; i+=offset ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int ii = i+offset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ long int test = ( i>0 ? 1UL << (i-1) : 0 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test |= ( ii>0 ? 1UL << (ii-1) : 0 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int j = flsl(test);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf( " Set bits %i,%i - Found bit %i\n", i, ii, j );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf( "testing flsll :-\n" );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for ( int i = 0; i <= 8*sizeof(long long int)-offset; i+=offset ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int ii = i+offset;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ long long int test = ( i>0 ? 1UL << (i-1) : 0 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test |= ( ii>0 ? 1UL << (ii-1) : 0 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int j = flsll(test);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf( " Set bits %i,%i - Found bit %i\n", i, ii, j );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span></pre><pre style='margin:0'>
</pre>