From ea750887d0d1dfad81d0f7e066c720defe06e08a Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 16 Sep 2009 20:49:06 +0000 Subject: Lintifications. --- man_hash.c | 6 +++--- mdoc_action.c | 4 ++-- mdoc_hash.c | 6 +++--- mdoc_macro.c | 28 ++++++++++++++-------------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/man_hash.c b/man_hash.c index 115a9981..276320cb 100644 --- a/man_hash.c +++ b/man_hash.c @@ -1,4 +1,4 @@ -/* $Id: man_hash.c,v 1.12 2009/09/16 14:40:56 kristaps Exp $ */ +/* $Id: man_hash.c,v 1.13 2009/09/16 20:49:06 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -22,7 +22,7 @@ #include "libman.h" -static unsigned char table[26 * 6]; +static u_char table[26 * 6]; void @@ -42,7 +42,7 @@ man_hash_init(void) for (j = 0; j < 6; j++) if (UCHAR_MAX == table[x + j]) { - table[x + j] = i; + table[x + j] = (u_char)i; break; } assert(j < 6); diff --git a/mdoc_action.c b/mdoc_action.c index 005f39ce..d162373c 100644 --- a/mdoc_action.c +++ b/mdoc_action.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_action.c,v 1.36 2009/09/16 14:40:56 kristaps Exp $ */ +/* $Id: mdoc_action.c,v 1.37 2009/09/16 20:49:06 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -53,7 +53,7 @@ static int post_tilde(POST_ARGS); static int pre_bd(PRE_ARGS); static int pre_dl(PRE_ARGS); -const struct actions mdoc_actions[MDOC_MAX] = { +static const struct actions mdoc_actions[MDOC_MAX] = { { NULL, NULL }, /* Ap */ { NULL, post_dd }, /* Dd */ { NULL, post_dt }, /* Dt */ diff --git a/mdoc_hash.c b/mdoc_hash.c index 7f033f4e..757437c0 100644 --- a/mdoc_hash.c +++ b/mdoc_hash.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_hash.c,v 1.9 2009/09/16 14:40:56 kristaps Exp $ */ +/* $Id: mdoc_hash.c,v 1.10 2009/09/16 20:49:06 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -25,7 +25,7 @@ #include "libmdoc.h" -static unsigned char table[27 * 12]; +static u_char table[27 * 12]; void @@ -46,7 +46,7 @@ mdoc_hash_init(void) for (j = 0; j < 12; j++) if (UCHAR_MAX == table[major + j]) { - table[major + j] = i; + table[major + j] = (u_char)i; break; } diff --git a/mdoc_macro.c b/mdoc_macro.c index 0a54bc77..63d5ef83 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.34 2009/09/16 14:40:56 kristaps Exp $ */ +/* $Id: mdoc_macro.c,v 1.35 2009/09/16 20:49:06 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -46,8 +46,8 @@ static int rew_sub(enum mdoc_type, struct mdoc *, static int rew_last(struct mdoc *, const struct mdoc_node *); static int append_delims(struct mdoc *, int, int *, char *); -static int lookup(struct mdoc *, int, const char *); -static int lookup_raw(struct mdoc *, const char *); +static int lookup(int, const char *); +static int lookup_raw(const char *); static int swarn(struct mdoc *, enum mdoc_type, int, int, const struct mdoc_node *); @@ -258,12 +258,12 @@ mdoc_macroend(struct mdoc *m) * Look up a macro from within a subsequent context. */ static int -lookup(struct mdoc *mdoc, int from, const char *p) +lookup(int from, const char *p) { if ( ! (MDOC_PARSED & mdoc_macros[from].flags)) return(MDOC_MAX); - return(lookup_raw(mdoc, p)); + return(lookup_raw(p)); } @@ -271,7 +271,7 @@ lookup(struct mdoc *mdoc, int from, const char *p) * Lookup a macro following the initial line macro. */ static int -lookup_raw(struct mdoc *mdoc, const char *p) +lookup_raw(const char *p) { int res; @@ -669,7 +669,7 @@ blk_exp_close(MACRO_PROT_ARGS) if (ARGS_EOLN == c) break; - if (MDOC_MAX != (c = lookup(m, tok, p))) { + if (MDOC_MAX != (c = lookup(tok, p))) { if ( ! flushed) { if ( ! rew_sub(MDOC_BLOCK, m, tok, line, ppos)) return(0); @@ -753,7 +753,7 @@ in_line(MACRO_PROT_ARGS) /* Quoted words shouldn't be looked-up. */ - c = ARGS_QWORD == w ? MDOC_MAX : lookup(m, tok, p); + c = ARGS_QWORD == w ? MDOC_MAX : lookup(tok, p); /* * In this case, we've located a submacro and must @@ -932,7 +932,7 @@ blk_full(MACRO_PROT_ARGS) continue; } - if (MDOC_MAX == (c = lookup(m, tok, p))) { + if (MDOC_MAX == (c = lookup(tok, p))) { if ( ! mdoc_word_alloc(m, line, lastarg, p)) return(0); continue; @@ -995,7 +995,7 @@ blk_part_imp(MACRO_PROT_ARGS) if (ARGS_EOLN == c) break; - if (MDOC_MAX == (c = lookup(m, tok, p))) { + if (MDOC_MAX == (c = lookup(tok, p))) { if ( ! mdoc_word_alloc(m, line, la, p)) return(0); continue; @@ -1098,7 +1098,7 @@ blk_part_exp(MACRO_PROT_ARGS) if (ARGS_EOLN == c) break; - if (MDOC_MAX != (c = lookup(m, tok, p))) { + if (MDOC_MAX != (c = lookup(tok, p))) { if ( ! flushed) { if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos)) return(0); @@ -1209,7 +1209,7 @@ in_line_argn(MACRO_PROT_ARGS) if (ARGS_EOLN == c) break; - if (MDOC_MAX != (c = lookup(m, tok, p))) { + if (MDOC_MAX != (c = lookup(tok, p))) { if ( ! flushed && ! rew_elem(m, tok)) return(0); flushed = 1; @@ -1284,7 +1284,7 @@ in_line_eoln(MACRO_PROT_ARGS) if (ARGS_EOLN == w) break; - c = ARGS_QWORD == w ? MDOC_MAX : lookup(m, tok, p); + c = ARGS_QWORD == w ? MDOC_MAX : lookup(tok, p); if (MDOC_MAX != c) { if ( ! rew_elem(m, tok)) @@ -1333,7 +1333,7 @@ phrase(struct mdoc *m, int line, int ppos, char *buf) if (ARGS_EOLN == w) break; - c = ARGS_QWORD == w ? MDOC_MAX : lookup_raw(m, p); + c = ARGS_QWORD == w ? MDOC_MAX : lookup_raw(p); if (MDOC_MAX != c) { if ( ! mdoc_macro(m, c, line, la, &pos, buf)) -- cgit v1.2.3-56-ge451