mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-21 20:26:45 +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:
parent
15a32ee5d1
commit
d5379b350f
44 changed files with 66 additions and 105 deletions
|
|
@ -372,8 +372,7 @@ XIGetKnownProperty(const char *name)
|
|||
if (!name)
|
||||
return None;
|
||||
|
||||
for (i = 0; i < (sizeof(dev_properties) / sizeof(struct dev_properties));
|
||||
i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(dev_properties); i++) {
|
||||
if (strcmp(name, dev_properties[i].name) == 0) {
|
||||
if (dev_properties[i].type == None) {
|
||||
dev_properties[i].type =
|
||||
|
|
@ -393,8 +392,7 @@ XIResetProperties(void)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < (sizeof(dev_properties) / sizeof(struct dev_properties));
|
||||
i++)
|
||||
for (i = 0; i < ARRAY_SIZE(dev_properties); i++)
|
||||
dev_properties[i].type = None;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue