Discussion:
[PATCH] magic numbers
Dennis Preiser
2011-10-29 17:59:45 UTC
Permalink
Attached patch addresses this TODO:

| o try to get rid of the magic numbers like NUM_MIME_CHARSETS and use
| a sentinel in the arrays instead (match_list is a showstopper here).
| [20030203 Urs Janssen <***@tin.org>]

I've changed all 'constext *txt_' arrays, they now have NULL as the
very last array member.

config.c:match_list() and prompt.c:prompt_option_list()/prompt_list()
were adapted accordingly.

The sentinel in 'constext *txt_mime_7bit_charsets[]' has changed from ""
to NULL in order to unify things (this includes changes to the
for-loops: check for NULL instead of '\0').

opt_count in 'struct t_option' is not needed anymore. Thus, the third
field in tincfg.tbl (array size) is superflous. I have adjusted
makecfg.c and tincfg.tbl accordingly.

A separate array for the background colors is necessary now. This array
must be used in tincfg.tbl for all options where only background colors
are allowed (currently col_back and col_inverse_bg).

Dennis

Loading...