diff options
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | action.c | 8 | ||||
-rw-r--r-- | argv.c | 6 | ||||
-rw-r--r-- | macro.c | 15 | ||||
-rw-r--r-- | term.c | 5 | ||||
-rw-r--r-- | validate.c | 13 |
6 files changed, 31 insertions, 21 deletions
@@ -128,6 +128,9 @@ lint: $(LLNS) clean: rm -f $(CLEAN) +cleanlint: + rm -f $(LNS) $(LLNS) + dist: mdocml-$(VERSION).tar.gz port: mdocml-oport-$(VERSION).tar.gz @@ -141,7 +144,7 @@ installwww: www install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/mdocml.tar.gz -regress:: +regress: mdoclint @for f in $(FAIL); do \ echo "./mdoclint $$f" ; \ ./mdoclint $$f 2>/dev/null || continue ; exit 1 ; done @@ -285,8 +285,8 @@ static int post_bl(struct mdoc *mdoc) { struct mdoc_block *bl; - size_t i, width; - int tok; + size_t width; + int tok, i; char buf[32]; if (MDOC_BLOCK != mdoc->last->type) @@ -294,11 +294,11 @@ post_bl(struct mdoc *mdoc) bl = &mdoc->last->data.block; - for (i = 0; i < bl->argc; i++) + for (i = 0; i < (int)bl->argc; i++) if (MDOC_Width == bl->argv[i].arg) break; - if (i == bl->argc) + if (i == (int)bl->argc) return(1); assert(1 == bl->argv[i].sz); @@ -372,7 +372,7 @@ args(struct mdoc *mdoc, int line, p++; if (0 != *p) *(p - 1) = 0; - *pos += p - *v; + *pos += (int)(p - *v); } if (p && 0 == *p) @@ -393,7 +393,7 @@ args(struct mdoc *mdoc, int line, if (p > *v && ' ' == *(p - 1)) if ( ! pwarn(mdoc, line, *pos, WTAILWS)) return(0); - *pos += p - *v; + *pos += (int)(p - *v); return(ARGS_WORD); } @@ -647,7 +647,7 @@ argv_multi(struct mdoc *mdoc, int line, return(0); } else if (ARGS_EOLN == c) break; - v->value[v->sz] = p; + v->value[(int)v->sz] = p; } if (0 < v->sz && v->sz < MDOC_LINEARG_MAX) @@ -750,7 +750,8 @@ macro_text(MACRO_PROT_ARGS) return(perr(mdoc, line, ppos, EARGVLIM)); } - c = mdoc_elem_alloc(mdoc, line, ppos, tok, argc, argv); + c = mdoc_elem_alloc(mdoc, line, ppos, + tok, (size_t)argc, argv); if (0 == c) { mdoc_argv_free(argc, argv); @@ -802,8 +803,8 @@ macro_text(MACRO_PROT_ARGS) } lastpunct = 1; } else if (lastpunct) { - c = mdoc_elem_alloc(mdoc, line, - ppos, tok, argc, argv); + c = mdoc_elem_alloc(mdoc, line, ppos, + tok, (size_t)argc, argv); if (0 == c) { mdoc_argv_free(argc, argv); return(0); @@ -1225,7 +1226,9 @@ macro_constant_delimited(MACRO_PROT_ARGS) return(perr(mdoc, line, ppos, EARGVLIM)); } - c = mdoc_elem_alloc(mdoc, line, ppos, tok, argc, argv); + c = mdoc_elem_alloc(mdoc, line, ppos, + tok, (size_t)argc, argv); + mdoc_argv_free(argc, argv); if (0 == c) @@ -1316,7 +1319,9 @@ macro_constant(MACRO_PROT_ARGS) return(perr(mdoc, line, ppos, EARGVLIM)); } - c = mdoc_elem_alloc(mdoc, line, ppos, tok, argc, argv); + c = mdoc_elem_alloc(mdoc, line, ppos, + tok, (size_t)argc, argv); + mdoc_argv_free(argc, argv); if (0 == c) @@ -277,7 +277,8 @@ const struct termact *termacts = __termacts; static size_t arg_width(const struct mdoc_arg *arg) { - size_t len, i, v; + size_t v; + int i, len; assert(*arg->value); if (0 == strcmp(*arg->value, "indent")) @@ -285,7 +286,7 @@ arg_width(const struct mdoc_arg *arg) if (0 == strcmp(*arg->value, "indent-two")) return(INDENT * 2); - len = strlen(*arg->value); + len = (int)strlen(*arg->value); assert(len > 0); for (i = 0; i < len - 1; i++) @@ -52,7 +52,7 @@ static int check_msec(PRE_ARGS, int, enum mdoc_msec *); static int check_stdarg(PRE_ARGS); static int check_text(struct mdoc *, - size_t, size_t, const char *); + int, int, const char *); static int err_child_lt(struct mdoc *, const char *, int); static int warn_child_lt(struct mdoc *, const char *, int); @@ -278,7 +278,8 @@ mdoc_valid_pre(struct mdoc *mdoc, { v_pre *p; struct mdoc_arg *argv; - size_t argc, i, j, line, pos; + size_t argc; + int line, pos, i, j; const char *tp; if (MDOC_TEXT == node->type) { @@ -296,10 +297,10 @@ mdoc_valid_pre(struct mdoc *mdoc, node->data.block.argc : node->data.elem.argc; - for (i = 0; i < argc; i++) { + for (i = 0; i < (int)argc; i++) { if (0 == argv[i].sz) continue; - for (j = 0; j < argv[i].sz; j++) { + for (j = 0; j < (int)argv[i].sz; j++) { tp = argv[i].value[j]; line = argv[i].line; pos = argv[i].pos; @@ -476,7 +477,7 @@ check_msec(PRE_ARGS, int sz, enum mdoc_msec *msecs) static int -check_text(struct mdoc *mdoc, size_t line, size_t pos, const char *p) +check_text(struct mdoc *mdoc, int line, int pos, const char *p) { size_t c; @@ -489,7 +490,7 @@ check_text(struct mdoc *mdoc, size_t line, size_t pos, const char *p) if ('\\' != *p) continue; if ((c = mdoc_isescape(p))) { - p += (c - 1); + p += (int)c - 1; continue; } return(mdoc_perr(mdoc, line, pos, |