summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eqn.c1
-rw-r--r--html.c3
-rw-r--r--main.c2
-rw-r--r--mandoc.c2
-rw-r--r--mdoc_validate.c3
-rw-r--r--out.c3
-rw-r--r--roff.c8
-rw-r--r--tbl_data.c6
-rw-r--r--tbl_opts.c2
-rw-r--r--term.c2
10 files changed, 18 insertions, 14 deletions
diff --git a/eqn.c b/eqn.c
index 908d919d..41f22968 100644
--- a/eqn.c
+++ b/eqn.c
@@ -65,6 +65,7 @@ eqn_alloc(int pos, int line)
return(p);
}
+/* ARGSUSED */
void
eqn_end(struct eqn_node *e)
{
diff --git a/html.c b/html.c
index af9fdb1a..ce801013 100644
--- a/html.c
+++ b/html.c
@@ -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)
{
diff --git a/main.c b/main.c
index 2faa0edf..a5fc12d8 100644
--- a/main.c
+++ b/main.c
@@ -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;
diff --git a/mandoc.c b/mandoc.c
index 3151d34b..e4c5ca6f 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -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);
}
diff --git a/out.c b/out.c
index be54abcd..44cc0eae 100644
--- a/out.c
+++ b/out.c
@@ -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;
diff --git a/roff.c b/roff.c
index 0eff6973..7290e4df 100644
--- a/roff.c
+++ b/roff.c
@@ -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) {
diff --git a/tbl_data.c b/tbl_data.c
index e125a6e9..6d86e4c0 100644
--- a/tbl_data.c
+++ b/tbl_data.c
@@ -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])
diff --git a/tbl_opts.c b/tbl_opts.c
index 28b658f7..c8c2f71e 100644
--- a/tbl_opts.c
+++ b/tbl_opts.c
@@ -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;
}
diff --git a/term.c b/term.c
index 0ffdedd7..6b48196b 100644
--- a/term.c
+++ b/term.c
@@ -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;