diff options
author | Daniel Martin <consume.noise@gmail.com> | 2017-10-27 16:11:56 +0200 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2017-10-30 13:45:20 -0400 |
commit | d5379b350fb63e42e604361c21ad9832b4c791b9 (patch) | |
tree | 9ff0602258e2d4afb74561614810fb8a8e0e1860 /hw/kdrive | |
parent | 15a32ee5d1fffa171bb05af9a0e5b472e4af1488 (diff) |
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>
Diffstat (limited to 'hw/kdrive')
-rw-r--r-- | hw/kdrive/src/kdrive.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index 30e0ced70..82dcf4ae7 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -66,8 +66,6 @@ KdDepths kdDepths[] = { {32, 32} }; -#define NUM_KD_DEPTHS (sizeof (kdDepths) / sizeof (kdDepths[0])) - #define KD_DEFAULT_BUTTONS 5 DevPrivateKeyRec kdScreenPrivateKeyRec; @@ -886,7 +884,7 @@ KdSetPixmapFormats(ScreenInfo * pScreenInfo) /* * Fill in additional formats */ - for (i = 0; i < NUM_KD_DEPTHS; i++) + for (i = 0; i < ARRAY_SIZE(kdDepths); i++) if (!depthToBpp[kdDepths[i].depth]) depthToBpp[kdDepths[i].depth] = kdDepths[i].bpp; |