1
0
Fork 0

Format code according to conventions (#16322)

This commit is contained in:
QMK Bot 2022-02-12 10:29:31 -08:00 committed by GitHub
parent afcdd7079c
commit 63646e8906
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
345 changed files with 4916 additions and 3229 deletions

View file

@ -20,7 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// bit population - return number of on-bit
__attribute__((noinline)) uint8_t bitpop(uint8_t bits) {
uint8_t c;
for (c = 0; bits; c++) bits &= bits - 1;
for (c = 0; bits; c++)
bits &= bits - 1;
return c;
/*
const uint8_t bit_count[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 };
@ -30,13 +31,15 @@ __attribute__((noinline)) uint8_t bitpop(uint8_t bits) {
uint8_t bitpop16(uint16_t bits) {
uint8_t c;
for (c = 0; bits; c++) bits &= bits - 1;
for (c = 0; bits; c++)
bits &= bits - 1;
return c;
}
uint8_t bitpop32(uint32_t bits) {
uint8_t c;
for (c = 0; bits; c++) bits &= bits - 1;
for (c = 0; bits; c++)
bits &= bits - 1;
return c;
}