]> sourceware.org Git - newlib-cygwin.git/commitdiff
Synchronize RTEMS <sys/bitset.h> with FreeBSD
authorSebastian Huber <sebastian.huber@embedded-brains.de>
Wed, 12 Jul 2017 06:03:29 +0000 (08:03 +0200)
committerSebastian Huber <sebastian.huber@embedded-brains.de>
Wed, 12 Jul 2017 06:04:45 +0000 (08:04 +0200)
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
newlib/libc/sys/rtems/include/sys/bitset.h

index 4c58f1fb7b32a437bd4d990ff4fb0ff95841472f..931daf9004c32b4c21bcd9c7ffdcf3cc8fd002d3 100644 (file)
@@ -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_
        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;                                          \
                }                                                       \
        }                                                               \
This page took 0.032922 seconds and 5 git commands to generate.