X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Ftable_gen.c;h=6fe5cd55c1758fae2efc7c5a7d15c777038bfab4;hb=refs%2Fheads%2Fupstream-ssl;hp=e5554f9b9f48967228d08353e27898e2fd35dbe5;hpb=f0e781287d8c6210e5fa26668208df7830061aa3;p=ircu2.10.12-pk.git diff --git a/ircd/table_gen.c b/ircd/table_gen.c index e5554f9..6fe5cd5 100644 --- a/ircd/table_gen.c +++ b/ircd/table_gen.c @@ -29,11 +29,11 @@ * macros actually used by the server instead DO work and have been tested * on platforms where0 char is both signed or unsigned, this is true as long * as the macros are set properly and without any need to rebuild - * the tables (wich as said an admin should NEVER do, tables need to be rebuilt + * the tables (which as said an admin should NEVER do, tables need to be rebuilt * only when one wants to really change the results or when one has to * compile on architectures where a char is NOT eight bits [?!], yes * it all is supposed to work in that case too... but I can't test it - * because I've not found a machine in the world where this happes). + * because I've not found a machine in the world where this happens). * * NEVER -f[un]signed-char on gcc since that does NOT fix the named macros * and you end up in a non-ANSI environment where CHAR_MIN and CHAR_MAX @@ -41,6 +41,7 @@ * both admins and coders. * */ +#include "config.h" #include "ircd_chattr.h" #include @@ -97,8 +98,8 @@ static void makeTables(void) moveMacro(NTL_GRAPH, NTL_PRINT); markString(NTL_PRINT, " "); - markRange(NTL_IRCCH, 0, UCHAR_MAX); - unMarkString(NTL_IRCCH, "\007\040\054\240"); + markRange(NTL_IRCCH, '\041', (char) UCHAR_MAX); + unMarkString(NTL_IRCCH, "\054\240"); markRange(NTL_IRCCL, '\300', '\326'); markRange(NTL_IRCCL, '\330', '\336'); @@ -109,6 +110,9 @@ static void makeTables(void) moveMacro(NTL_DIGIT, NTL_IRCIP); markString(NTL_IRCIP, "."); + moveMacro(NTL_DIGIT, NTL_IRCIP6); + markString(NTL_IRCIP6, ":.ABCDEFabcdef"); + moveMacro(NTL_DIGIT | NTL_ALPHA, NTL_IRCNK); markString(NTL_IRCNK, "-_`"); @@ -119,7 +123,7 @@ static void makeTables(void) markRange(NTL_IRCUI, '\xd8', '\xde'); markString(NTL_IRCUI, ".-_^'`~"); markString(NTL_EOL, "\n\r"); - markString(NTL_CHPFX, "#&+"); + markString(NTL_CHPFX, "#&"); markString(NTL_KTIME, " ,-0123456789"); /* And finally let's take care of the toLower/toUpper stuff */ @@ -266,28 +270,28 @@ static void dumphb(char *tbl, int beg) { int i, j, k; char *p = &tbl[beg - CHAR_MIN]; - char c; + unsigned char c; for (i = 0; i <= SCHAR_MAX; i += ROWSIZE) { k = i + ROWSIZE - 1; if (k > SCHAR_MAX) k = SCHAR_MAX; - c = (char)(beg + i); + c = (unsigned char)(beg + i); printf("/*"); if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf(" '%c'", c); else - printf(" x%02x", ((int)((unsigned char)c))); + printf(" x%02x", ((int)c)); - c = (char)(beg + k); + c = (unsigned char)(beg + k); printf("-"); if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf("'%c'", c); else - printf("x%02x", ((int)((unsigned char)c))); + printf("x%02x", ((int)c)); printf(" */"); for (j = i; j <= k; j++) @@ -297,7 +301,7 @@ static void dumphb(char *tbl, int beg) && (c != '\'')) printf(" '%c'", c); else - printf(" '\\x%02x'", ((int)((unsigned char)c))); + printf(" '\\x%02x'", ((int)c)); if (j < SCHAR_MAX) printf(","); } @@ -309,28 +313,28 @@ static void dumphw(int *tbl, int beg) { int i, j, k; int *p = &tbl[beg - CHAR_MIN]; - char c; + unsigned char c; for (i = 0; i <= SCHAR_MAX; i += ROWSIZE) { k = i + ROWSIZE - 1; if (k > SCHAR_MAX) k = SCHAR_MAX; - c = (char)(beg + i); + c = (unsigned char)(beg + i); printf("/*"); if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf(" '%c'", c); else - printf(" x%02x", ((int)((unsigned char)c))); + printf(" x%02x", ((int)c)); - c = (char)(beg + k); + c = (unsigned char)(beg + k); printf("-"); if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf("'%c'", c); else - printf("x%02x", ((int)((unsigned char)c))); + printf("x%02x", ((int)c)); printf(" */"); for (j = i; j <= k; j++)