Duncan Simpson <[EMAIL PROTECTED]> writes:
| This patch replaces a couple of 255s with (N(yytext)-1), which keeps up with
| changes in the size of yytext. As a bonus it communicates with me what the
| significance of the value to me. The macro recogniser could still be improved
| (take 1 character and look for multiple character if the catcode, aka lexcode,
| is the right thing). I think the right thing is letter, but check the nearest
| copy of the TeXbook.
| Once that has happenned the spaces can be icorporated into the main hash table.
|
| This patch does not do the last stage because MathEd scares me :-)
|
| If yytext changes into wide charcaters then the use of N macro will mean the
| patch will continue to do the right thing. The N macro is declared in several
| X11 headers, I think.
Hmm perhaps we should undef N then...
| P.S. If you I going to ive you new math_hash.C, do you want ANSI C or a C++
| class? If the latter what do you want in called?
Prefferably an C++ class. No idea what to call it.
| +#ifndef N
| +#define N(x) (sizeof(x)/sizeof(x[0]))
| +#endif /* N */
"N" is just a terrible name.
(also we already use "N_" for gettext)
A small template would be better.
template<class T> inline
size_t absolutelyNotN(T const & t)
{
return sizeof(t)/sizeof(t[0]);
}
or something.
Lgb