diff options
-rw-r--r-- | eqn.c | 3 | ||||
-rw-r--r-- | html.c | 5 | ||||
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | mandoc.c | 4 | ||||
-rw-r--r-- | mdoc_validate.c | 5 | ||||
-rw-r--r-- | out.c | 5 | ||||
-rw-r--r-- | roff.c | 10 | ||||
-rw-r--r-- | tbl_data.c | 8 | ||||
-rw-r--r-- | tbl_opts.c | 4 | ||||
-rw-r--r-- | term.c | 4 |
10 files changed, 28 insertions, 24 deletions
@@ -1,4 +1,4 @@ -/* $Id: eqn.c,v 1.2 2011/02/09 09:05:52 kristaps Exp $ */ +/* $Id: eqn.c,v 1.3 2011/03/15 16:23:51 kristaps Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -65,6 +65,7 @@ eqn_alloc(int pos, int line) return(p); } +/* ARGSUSED */ void eqn_end(struct eqn_node *e) { @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.126 2011/01/30 16:05:37 schwarze Exp $ */ +/* $Id: html.c,v 1.127 2011/03/15 16:23:51 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -214,7 +214,7 @@ print_gen_head(struct html *h) } } - +/* ARGSUSED */ static void print_num(struct html *h, const char *p, size_t len) { @@ -225,7 +225,6 @@ print_num(struct html *h, const char *p, size_t len) putchar((int)*rhs); } - static void print_spec(struct html *h, enum roffdeco d, const char *p, size_t len) { @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.149 2011/03/15 16:15:37 kristaps Exp $ */ +/* $Id: main.c,v 1.150 2011/03/15 16:23:51 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -806,7 +806,7 @@ rerun: pos = 0; continue; case (ROFF_APPEND): - pos = strlen(ln.buf); + pos = (int)strlen(ln.buf); continue; case (ROFF_RERUN): goto rerun; @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.38 2011/03/15 03:03:54 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.39 2011/03/15 16:23:51 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -354,7 +354,7 @@ mandoc_getarg(char **cpp, mandocmsg msg, void *data, int ln, int *pos) while (' ' == *cp) cp++; } - *pos += (cp - start) + (quoted ? 1 : 0); + *pos += (int)(cp - start) + (quoted ? 1 : 0); *cpp = cp; if ('\0' == *cp && msg && (white || ' ' == cp[-1])) diff --git a/mdoc_validate.c b/mdoc_validate.c index 58677062..c4e7130f 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.158 2011/03/07 01:35:51 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.159 2011/03/15 16:23:51 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -2127,7 +2127,8 @@ post_bx(POST_ARGS) n = mdoc->last->child; if (n && NULL != (n = n->next)) - *n->string = toupper((unsigned char)*n->string); + *n->string = (char)toupper + ((unsigned char)*n->string); return(1); } @@ -1,4 +1,4 @@ -/* $Id: out.c,v 1.37 2011/01/30 16:05:37 schwarze Exp $ */ +/* $Id: out.c,v 1.38 2011/03/15 16:23:51 kristaps Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -431,7 +431,8 @@ tblcalc(struct rofftbl *tbl, const struct tbl_span *sp) */ assert(NULL == tbl->cols); - tbl->cols = calloc(sp->tbl->cols, sizeof(struct roffcol)); + tbl->cols = calloc + ((size_t)sp->tbl->cols, sizeof(struct roffcol)); hp = sp->head; @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.126 2011/02/09 09:05:52 kristaps Exp $ */ +/* $Id: roff.c,v 1.127 2011/03/15 16:23:51 kristaps Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -600,7 +600,7 @@ roff_parse(struct roff *r, const char *buf, int *pos) t = (r->current_string = roff_getstrn(r, mac, maclen)) ? ROFF_USERDEF : roff_hash_find(mac, maclen); - *pos += maclen; + *pos += (int)maclen; while (buf[*pos] && ' ' == buf[*pos]) (*pos)++; @@ -1137,7 +1137,7 @@ roff_rm(ROFF_ARGS) cp = *bufp + pos; while ('\0' != *cp) { - name = roff_getname(r, &cp, ln, cp - *bufp); + name = roff_getname(r, &cp, ln, (int)(cp - *bufp)); if ('\0' != *name) roff_setstr(r, name, NULL, 0); } @@ -1372,7 +1372,7 @@ roff_setstr(struct roff *r, const char *name, const char *string, * One additional byte for the '\n' in multiline mode, * and one for the terminating '\0'. */ - newch = strlen(string) + (multiline ? 2 : 1); + newch = strlen(string) + (multiline ? 2u : 1u); if (NULL == n->string) { n->string = mandoc_malloc(newch); *n->string = '\0'; @@ -1383,7 +1383,7 @@ roff_setstr(struct roff *r, const char *name, const char *string, } /* Skip existing content in the destination buffer. */ - c = n->string + oldch; + c = n->string + (int)oldch; /* Append new content to the destination buffer. */ while (*string) { @@ -1,4 +1,4 @@ -/* $Id: tbl_data.c,v 1.22 2011/02/06 22:02:58 kristaps Exp $ */ +/* $Id: tbl_data.c,v 1.23 2011/03/15 16:23:51 kristaps Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -106,8 +106,10 @@ data(struct tbl_node *tbl, struct tbl_span *dp, return(0); } - dat->string = mandoc_malloc(*pos - sv + 1); - memcpy(dat->string, &p[sv], *pos - sv); + assert(*pos - sv >= 0); + + dat->string = mandoc_malloc((size_t)(*pos - sv + 1)); + memcpy(dat->string, &p[sv], (size_t)(*pos - sv)); dat->string[*pos - sv] = '\0'; if (p[*pos]) @@ -1,4 +1,4 @@ -/* $Id: tbl_opts.c,v 1.8 2011/01/09 05:38:23 joerg Exp $ */ +/* $Id: tbl_opts.c,v 1.9 2011/03/15 16:23:51 kristaps Exp $ */ /* * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -188,7 +188,7 @@ again: /* /* Copy up to first non-alpha character. */ for (sv = *pos, i = 0; i < KEY_MAXNAME; i++, (*pos)++) { - buf[i] = tolower((unsigned char)p[*pos]); + buf[i] = (char)tolower((unsigned char)p[*pos]); if ( ! isalpha((unsigned char)buf[i])) break; } @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.177 2011/01/30 16:05:37 schwarze Exp $ */ +/* $Id: term.c,v 1.178 2011/03/15 16:23:51 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -514,7 +514,7 @@ term_word(struct termp *p, const char *word) if ((ssz = strcspn(word, "\\")) > 0) encode(p, word, ssz); - word += ssz; + word += (int)ssz; if ('\\' != *word) continue; |