mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
Use ARRAY_SIZE all over the tree
Roundhouse kick replacing the various (sizeof(foo)/sizeof(foo[0])) with the ARRAY_SIZE macro from dix.h when possible. A semantic patch for coccinelle has been used first. Additionally, a few macros have been inlined as they had only one or two users. Signed-off-by: Daniel Martin <consume.noise@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
committed by
Adam Jackson
parent
15a32ee5d1
commit
d5379b350f
@@ -1427,7 +1427,7 @@ include_bit_test_macros(void)
|
||||
uint8_t mask[9] = { 0 };
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(mask) / sizeof(mask[0]); i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(mask); i++) {
|
||||
assert(BitIsOn(mask, i) == 0);
|
||||
SetBit(mask, i);
|
||||
assert(BitIsOn(mask, i) == 1);
|
||||
|
||||
Reference in New Issue
Block a user