git: 897877ae644d - stable/13 - <sys/bitstring.h>: Cast _BITSTR_BITS to int in a ternary operator.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 11 Jul 2022 06:08:41 UTC
The branch stable/13 has been updated by dougm:
URL: https://cgit.FreeBSD.org/src/commit/?id=897877ae644d3b03a550e2ba46292620865477a3
commit 897877ae644d3b03a550e2ba46292620865477a3
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-02-01 17:45:11 +0000
Commit: Doug Moore <dougm@FreeBSD.org>
CommitDate: 2022-07-11 06:01:12 +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
(cherry picked from commit 8a67a1a9646ef516fe84ecfa7ec3467b15b9e0cc)
---
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));