« Previous | Next » 

Revision 66fe09ee

ID66fe09eebb813b79e14279df11d723b433a973fb

Added by Blue Swirl over 13 years ago

Use ARRAY_SIZE macro

Replace array size calculations with ARRAY_SIZE macro.

Implemented with this Coccinelle semantic patch, adapted from
Linux kernel:
@
type T;
T[] E;
@

- (sizeof(E)/sizeof(*E))
+ ARRAY_SIZE(E)

@
type T;
T[] E;
@

- (sizeof(E)/sizeof(E[...]))
+ ARRAY_SIZE(E)

@
type T;
T[] E;
@

- (sizeof(E)/sizeof(T))
+ ARRAY_SIZE(E)

Some files (-dis.c, tests/) had to be filtered out.

Signed-off-by: Blue Swirl <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences