The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=8a67a1a9646ef516fe84ecfa7ec3467b15b9e0cc

commit 8a67a1a9646ef516fe84ecfa7ec3467b15b9e0cc
Author:     John Baldwin <j...@freebsd.org>
AuthorDate: 2022-02-01 17:45:11 +0000
Commit:     John Baldwin <j...@freebsd.org>
CommitDate: 2022-02-01 17:45:11 +0000

    <sys/bitstring.h>: Cast _BITSTR_BITS to int in a ternary operator.
    
    This fixes a -Wsign-compare error reported by GCC due to the two
    results of the ternary operator having differing signedness.
    
    Reviewed by:    dougm, rlibby
    Differential Revision:  https://reviews.freebsd.org/D34122
---
 sys/sys/bitstring.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/sys/bitstring.h b/sys/sys/bitstring.h
index 13d87ce418ea..e579f0dece13 100644
--- a/sys/sys/bitstring.h
+++ b/sys/sys/bitstring.h
@@ -304,7 +304,7 @@ bit_ff_area_at(bitstr_t *_bitstr, int _start, int _nbits, 
int _size,
        }
 
        _mask = _match ? _BITSTR_MASK : 0;
-       _maxshft = _bit_idx(_size - 1) == 0 ? _size : _BITSTR_BITS;
+       _maxshft = _bit_idx(_size - 1) == 0 ? _size : (int)_BITSTR_BITS;
        _value = 0;
        _curbitstr = _bitstr + _bit_idx(_start);
        _test = ~(_BITSTR_MASK << _bit_offset(_start));

Reply via email to