ARRAY_SIZE macro must handle expressions

X may be an expression. It must be evaluated before dereferencing.
Don't cast ARRAY_SIZE result to int.

Casting a size_t to an int is, uhm, yeah...
We have an ARRAY_SIZE macro, use it.
Squelch signed/unsigned comparison warning.
Merge pull request #5146 from t-nelson/array_size

ARRAY_SIZE fixes and mass deployment