Module Name:    src
Committed By:   martin
Date:           Tue Mar 13 11:42:59 UTC 2018

Modified Files:
        src/sys/sys [netbsd-8]: bitops.h

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.8.1 src/sys/sys/bitops.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/bitops.h
diff -u src/sys/sys/bitops.h:1.12 src/sys/sys/bitops.h:1.12.8.1
--- src/sys/sys/bitops.h:1.12	Thu Jan 12 19:03:09 2017
+++ src/sys/sys/bitops.h	Tue Mar 13 11:42:59 2018
@@ -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 @@ fast_remainder32(uint32_t _v, uint32_t _
 #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))
 

Reply via email to