Charles Levert <[EMAIL PROTECTED]> writes:

> I have checked that this will hold for CHAR_BIT
> up to 1023.  Custom tools used for checking
> this available upon request (part analytical,
> part experimental).

Can you please put a comment to this effect in the source code, where
it's less likely to get lost?  It would help to document as much as
you can, as long as it's concise.

> +#if CHAR_BIT < 4
> +#error "CHAR_BIT is smaller than 4; yeah, right!"
> +#else
> +#define DEPTH_SIZE (CHAR_BIT + CHAR_BIT/2)
> +#endif

Please change the name from DEPTH_SIZE to DEPTH_BOUND (since it's
an upper bound), and please avoid the #else.  Also, please indent
the preprocessing directive, and please use a clearer diagnostic.
Finally, please use the GNU coding style for spacing within expressions.

Something like this, perhaps:


/* Upper bound for depth of trie.  This bound is valid for CHAR_BIT >= 4 and
   exact for CHAR_BIT in { 4..11, 13, 15, 17, 19 }.  For details, please
   see grep-internals.texi.  */
#if CHAR_BIT < 4
# error "configuration error: impossible CHAR_BIT"
#endif
#define DEPTH_BOUND (CHAR_BIT + CHAR_BIT / 2)


Reply via email to