diff options
-rw-r--r-- | eqn.c | 1 | ||||
-rw-r--r-- | html.c | 3 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | mandoc.c | 2 | ||||
-rw-r--r-- | mdoc_validate.c | 3 | ||||
-rw-r--r-- | out.c | 3 | ||||
-rw-r--r-- | roff.c | 8 | ||||
-rw-r--r-- | tbl_data.c | 6 | ||||
-rw-r--r-- | tbl_opts.c | 2 | ||||
-rw-r--r-- | term.c | 2 |
10 files changed, 18 insertions, 14 deletions
@@ -65,6 +65,7 @@ eqn_alloc(int pos, int line) return(p); } +/* ARGSUSED */ void eqn_end(struct eqn_node *e) { @@ -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) { @@ -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; @@ -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 18634276..3f845317 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -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); } @@ -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; @@ -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) { @@ -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]) @@ -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; } @@ -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; |