diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-07-26 13:59:00 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-07-26 13:59:00 +0000 |
commit | 7a3400728abf2d32ac0c2a420dfd3eb2af8a53f7 (patch) | |
tree | df28cfcd6a1e4c2167a455f71e7c17052d40505e /chars.c | |
parent | 0280c8a13656a9732da27952c02fa7c4dab7fb27 (diff) | |
download | mandoc-7a3400728abf2d32ac0c2a420dfd3eb2af8a53f7.tar.gz |
Remove asciisz from chars.in. It frees up a nice chunk of memory and at
the overhead of running strlen() for ASCII strings (yes, I benchmarked
this running mandoc_char(7) as input again and again with
hundredth-second penalties... on my slow-ass alpha).
Diffstat (limited to 'chars.c')
-rw-r--r-- | chars.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -33,7 +33,6 @@ struct ln { struct ln *next; const char *code; const char *ascii; - size_t asciisz; int unicode; int type; #define CHARS_CHAR (1 << 0) @@ -43,12 +42,12 @@ struct ln { #define LINES_MAX 370 -#define CHAR(in, ch, chsz, code) \ - { NULL, (in), (ch), (chsz), (code), CHARS_CHAR }, -#define STRING(in, ch, chsz, code) \ - { NULL, (in), (ch), (chsz), (code), CHARS_STRING }, -#define BOTH(in, ch, chsz, code) \ - { NULL, (in), (ch), (chsz), (code), CHARS_BOTH }, +#define CHAR(in, ch, code) \ + { NULL, (in), (ch), (code), CHARS_CHAR }, +#define STRING(in, ch, code) \ + { NULL, (in), (ch), (code), CHARS_STRING }, +#define BOTH(in, ch, code) \ + { NULL, (in), (ch), (code), CHARS_BOTH }, #define CHAR_TBL_START static struct ln lines[LINES_MAX] = { #define CHAR_TBL_END }; @@ -165,7 +164,7 @@ chars_spec2str(void *arg, const char *p, size_t sz, size_t *rsz) if (NULL == ln) return(NULL); - *rsz = ln->asciisz; + *rsz = strlen(ln->ascii); return(ln->ascii); } @@ -182,7 +181,7 @@ chars_res2str(void *arg, const char *p, size_t sz, size_t *rsz) if (NULL == ln) return(NULL); - *rsz = ln->asciisz; + *rsz = strlen(ln->ascii); return(ln->ascii); } |