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
@@ -581,8 +581,6 @@ static const RESTYPE CursorRestypes[] = {
|
||||
RT_WINDOW, RT_PASSIVEGRAB, RT_CURSOR
|
||||
};
|
||||
|
||||
#define NUM_CURSOR_RESTYPES (sizeof (CursorRestypes) / sizeof (CursorRestypes[0]))
|
||||
|
||||
static Bool
|
||||
ReplaceCursorLookup(void *value, XID id, void *closure)
|
||||
{
|
||||
@@ -645,7 +643,7 @@ ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, void *closure)
|
||||
for (clientIndex = 0; clientIndex < currentMaxClients; clientIndex++) {
|
||||
if (!clients[clientIndex])
|
||||
continue;
|
||||
for (resIndex = 0; resIndex < NUM_CURSOR_RESTYPES; resIndex++) {
|
||||
for (resIndex = 0; resIndex < ARRAY_SIZE(CursorRestypes); resIndex++) {
|
||||
rcl.type = CursorRestypes[resIndex];
|
||||
/*
|
||||
* This function walks the entire client resource database
|
||||
|
||||
Reference in New Issue
Block a user