Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/sys Pull up following revision(s) (requested by mrg i...



details:   https://anonhg.NetBSD.org/src/rev/c26fbe98a37b
branches:  netbsd-8
changeset: 434727:c26fbe98a37b
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Mar 13 11:42:59 2018 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #621):
        sys/sys/bitops.h: revision 1.13
        sys/sys/bitops.h: revision 1.14
use 1ul for a left shift that may be greater than int sized.
noticed by martin.
fixes PR#53081.

PR/53081: Fix size of the shift to depend on the type of the bitmap so that
we get the correct width.

diffstat:

 sys/sys/bitops.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 5abbb92a2430 -r c26fbe98a37b sys/sys/bitops.h
--- a/sys/sys/bitops.h  Tue Mar 13 11:15:15 2018 +0000
+++ b/sys/sys/bitops.h  Tue Mar 13 11:42:59 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bitops.h,v 1.12 2017/01/12 19:03:09 christos Exp $     */
+/*     $NetBSD: bitops.h,v 1.12.8.1 2018/03/13 11:42:59 martin Exp $   */
 
 /*-
  * Copyright (c) 2007, 2010 The NetBSD Foundation, Inc.
@@ -304,7 +304,7 @@
 #define __BITMAP_SIZE(__t, __n) \
     (((__n) + (__BITMAP_BITS(__t) - 1)) / __BITMAP_BITS(__t))
 #define __BITMAP_BIT(__n, __v) \
-    (1 << ((__n) & __BITMAP_MASK(*(__v)->_b)))
+    ((__typeof__((__v)->_b[0]))1 << ((__n) & __BITMAP_MASK(*(__v)->_b)))
 #define __BITMAP_WORD(__n, __v) \
     ((__n) >> __BITMAP_SHIFT(*(__v)->_b))
 



Home | Main Index | Thread Index | Old Index