Source-Changes-HG archive

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

[src/trunk]: src/sys/sys PR/53081: Fix size of the shift to depend on the typ...



details:   https://anonhg.NetBSD.org/src/rev/b9e6e676e891
branches:  trunk
changeset: 831042:b9e6e676e891
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Mar 08 20:32:32 2018 +0000

description:
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 d91893178359 -r b9e6e676e891 sys/sys/bitops.h
--- a/sys/sys/bitops.h  Thu Mar 08 18:48:25 2018 +0000
+++ b/sys/sys/bitops.h  Thu Mar 08 20:32:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bitops.h,v 1.13 2018/03/08 10:06:18 mrg Exp $  */
+/*     $NetBSD: bitops.h,v 1.14 2018/03/08 20:32:32 christos 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) \
-    (1ul << ((__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