From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id 72443384F015; Fri, 24 Jun 2022 05:42:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 72443384F015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] bitset: expand bit index type to `long` X-Act-Checkin: newlib-cygwin X-Git-Author: D Scott Phillips X-Git-Refname: refs/heads/master X-Git-Oldrev: 4c5b7bec977b31bf626bcbe3012ee5e7a5956cc8 X-Git-Newrev: 9d50b446899810ca22daf98cbb309510073f1bd0 Message-Id: <20220624054234.72443384F015@sourceware.org> Date: Fri, 24 Jun 2022 05:42:34 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2022 05:42:34 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D9d50b446899= 810ca22daf98cbb309510073f1bd0 commit 9d50b446899810ca22daf98cbb309510073f1bd0 Author: D Scott Phillips Date: Mon Sep 21 22:19:12 2020 +0000 bitset: expand bit index type to `long` =20 An upcoming patch to use the bitset macros for tracking vm page dump information could conceivably need more than INT_MAX bits. Expand the bit type to long so that the extra range is available on 64-bit platforms where it would most likely be needed. =20 CPUSET_COUNT and DOMAINSET_COUNT are also modified to remain of type `int`. =20 Reviewed by: kib, markj Approved by: scottl (implicit) MFC after: 1 week Sponsored by: Ampere Computing, Inc. Differential Revision: https://reviews.freebsd.org/D26190 Diff: --- newlib/libc/sys/rtems/include/sys/bitset.h | 7 +++---- newlib/libc/sys/rtems/include/sys/cpuset.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/newlib/libc/sys/rtems/include/sys/bitset.h b/newlib/libc/sys/r= tems/include/sys/bitset.h index 2e00dab7b..3f263acd0 100644 --- a/newlib/libc/sys/rtems/include/sys/bitset.h +++ b/newlib/libc/sys/rtems/include/sys/bitset.h @@ -216,8 +216,7 @@ */ #define BIT_FFS_AT(_s, p, start) __extension__ ({ \ __size_t __i; \ - long __mask; \ - int __bit; \ + long __bit, __mask; \ \ __mask =3D ~0UL << ((start) % _BITSET_BITS); \ __bit =3D 0; \ @@ -238,7 +237,7 @@ =20 #define BIT_FLS(_s, p) __extension__ ({ \ __size_t __i; \ - int __bit; \ + long __bit; \ \ __bit =3D 0; \ for (__i =3D __bitset_words((_s)); __i > 0; __i--) { \ @@ -253,7 +252,7 @@ =20 #define BIT_COUNT(_s, p) __extension__ ({ \ __size_t __i; \ - int __count; \ + long __count; \ \ __count =3D 0; \ for (__i =3D 0; __i < __bitset_words((_s)); __i++) \ diff --git a/newlib/libc/sys/rtems/include/sys/cpuset.h b/newlib/libc/sys/r= tems/include/sys/cpuset.h index a8af67bac..7958e3b1a 100644 --- a/newlib/libc/sys/rtems/include/sys/cpuset.h +++ b/newlib/libc/sys/rtems/include/sys/cpuset.h @@ -191,7 +191,7 @@ static __inline void CPU_ANDNOT(cpu_set_t *destset, con= st cpu_set_t *srcset1, =20 static __inline int CPU_COUNT_S(size_t setsize, const cpu_set_t *set) { - return BIT_COUNT(_cpu_set_bits(setsize), set); + return (int)BIT_COUNT(_cpu_set_bits(setsize), set); } =20 static __inline int CPU_COUNT(const cpu_set_t *set)