From 7a388e8066a94775e3e744188e51ed86ed289c50 Mon Sep 17 00:00:00 2001 From: Andrew Sidwell Date: Mon, 11 Aug 2008 04:13:22 +0000 Subject: - Add N_ELEMENTS() macro globally rather than using sizeof(x) / sizeof(x[0]) everywhere - In anticipation of interning tag names, make the big map of name->type store them in lowercase - Take advantage of the previous change to optimise away many calls to strlen svn path=/trunk/hubbub/; revision=5010 --- src/utils/utils.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/utils') diff --git a/src/utils/utils.h b/src/utils/utils.h index a1e0230..d22a0eb 100644 --- a/src/utils/utils.h +++ b/src/utils/utils.h @@ -25,4 +25,7 @@ #define UNUSED(x) ((x)=(x)) #endif +/* Useful for iterating over arrays */ +#define N_ELEMENTS(x) sizeof((x)) / sizeof((x)[0]) + #endif -- cgit v1.2.3