public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Synchronize RTEMS <sys/bitset.h> with FreeBSD
@ 2017-07-10  5:18 Sebastian Huber
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Huber @ 2017-07-10  5:18 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=1d49ce4d6b4649a3f89396de67e9c73fc88162f4

commit 1d49ce4d6b4649a3f89396de67e9c73fc88162f4
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Fri Jul 7 07:07:19 2017 +0200

    Synchronize RTEMS <sys/bitset.h> with FreeBSD
    
    Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>

Diff:
---
 newlib/libc/sys/rtems/include/sys/bitset.h | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/sys/bitset.h b/newlib/libc/sys/rtems/include/sys/bitset.h
index ec75223..4c58f1f 100644
--- a/newlib/libc/sys/rtems/include/sys/bitset.h
+++ b/newlib/libc/sys/rtems/include/sys/bitset.h
@@ -26,7 +26,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/sys/bitset.h 318781 2017-05-24 10:09:54Z kib $
+ * $FreeBSD: head/sys/sys/bitset.h 320755 2017-07-06 21:47:17Z kib $
  */
 
 #ifndef _SYS_BITSET_H_
@@ -216,6 +216,21 @@
 	__bit;								\
 })
 
+#define	BIT_FLS(_s, p) __extension__ ({					\
+	__size_t __i;							\
+	int __bit;							\
+									\
+	__bit = 0;							\
+	for (__i = __bitset_words((_s)) - 1; __i >= 0; __i--) {		\
+		if ((p)->__bits[__i] != 0) {				\
+			__bit = flsl((p)->__bits[__i]);			\
+			__bit += __i * _BITSET_BITS;			\
+			break;						\
+		}							\
+	}								\
+	__bit;								\
+})
+
 #define	BIT_COUNT(_s, p) __extension__ ({				\
 	__size_t __i;							\
 	int __count;							\


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [newlib-cygwin] Synchronize RTEMS <sys/bitset.h> with FreeBSD
@ 2017-07-12  6:08 Sebastian Huber
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Huber @ 2017-07-12  6:08 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a3617d7bde0ac1f816f9311f6d715b0b73f6ecff

commit a3617d7bde0ac1f816f9311f6d715b0b73f6ecff
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Wed Jul 12 08:03:29 2017 +0200

    Synchronize RTEMS <sys/bitset.h> with FreeBSD
    
    Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>

Diff:
---
 newlib/libc/sys/rtems/include/sys/bitset.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/sys/bitset.h b/newlib/libc/sys/rtems/include/sys/bitset.h
index 4c58f1f..931daf9 100644
--- a/newlib/libc/sys/rtems/include/sys/bitset.h
+++ b/newlib/libc/sys/rtems/include/sys/bitset.h
@@ -26,7 +26,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/sys/bitset.h 320755 2017-07-06 21:47:17Z kib $
+ * $FreeBSD: head/sys/sys/bitset.h 320893 2017-07-11 12:35:44Z kib $
  */
 
 #ifndef _SYS_BITSET_H_
@@ -221,10 +221,10 @@
 	int __bit;							\
 									\
 	__bit = 0;							\
-	for (__i = __bitset_words((_s)) - 1; __i >= 0; __i--) {		\
-		if ((p)->__bits[__i] != 0) {				\
-			__bit = flsl((p)->__bits[__i]);			\
-			__bit += __i * _BITSET_BITS;			\
+	for (__i = __bitset_words((_s)); __i > 0; __i--) {		\
+		if ((p)->__bits[__i - 1] != 0) {			\
+			__bit = flsl((p)->__bits[__i - 1]);		\
+			__bit += (__i - 1) * _BITSET_BITS;		\
 			break;						\
 		}							\
 	}								\


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-12  6:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-10  5:18 [newlib-cygwin] Synchronize RTEMS <sys/bitset.h> with FreeBSD Sebastian Huber
2017-07-12  6:08 Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).