libc/stdc_has_single_bit.c: fix gcc warning (-Wparentheses)

gcc14 is concerned that the operator precedence between - and & might
be confusing.  Throw in some redundant parentheses to make it shut up.
The LLVM build was fine before this change.

Reported by:	Martin Filla <freebsd@sysctl.cz>
Approved by:	markj (mentor)
MFC after:	1 month
Fixes:		6296500a85
Differential Revision:	https://reviews.freebsd.org/D54057
This commit is contained in:
Robert Clausecker
2025-12-03 19:36:27 +01:00
parent 853e0440c9
commit 3d71ce92ea
+5 -5
View File
@@ -10,29 +10,29 @@
bool
stdc_has_single_bit_uc(unsigned char x)
{
return (x != 0 && (x & x - 1) == 0);
return (x != 0 && (x & (x - 1)) == 0);
}
bool
stdc_has_single_bit_us(unsigned short x)
{
return (x != 0 && (x & x - 1) == 0);
return (x != 0 && (x & (x - 1)) == 0);
}
bool
stdc_has_single_bit_ui(unsigned int x)
{
return (x != 0 && (x & x - 1) == 0);
return (x != 0 && (x & (x - 1)) == 0);
}
bool
stdc_has_single_bit_ul(unsigned long x)
{
return (x != 0 && (x & x - 1) == 0);
return (x != 0 && (x & (x - 1)) == 0);
}
bool
stdc_has_single_bit_ull(unsigned long long x)
{
return (x != 0 && (x & x - 1) == 0);
return (x != 0 && (x & (x - 1)) == 0);
}