summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--contrib/nvi/common/msg.c3
-rw-r--r--contrib/nvi/ex/ex_print.c3
-rw-r--r--contrib/nvi/ex/ex_visual.c5
-rw-r--r--contrib/nvi/vi/vs_line.c7
-rw-r--r--contrib/nvi/vi/vs_refresh.c4
-rw-r--r--usr.bin/cap_mkdb/cap_mkdb.c4
-rw-r--r--usr.bin/gencat/genlib.c6
-rw-r--r--usr.bin/mklocale/yacc.y22
-rw-r--r--usr.bin/rpcgen/rpc_sample.c2
-rw-r--r--usr.bin/rpcgen/rpc_svcout.c2
10 files changed, 32 insertions, 26 deletions
diff --git a/contrib/nvi/common/msg.c b/contrib/nvi/common/msg.c
index 2b18082..bdf5c02 100644
--- a/contrib/nvi/common/msg.c
+++ b/contrib/nvi/common/msg.c
@@ -472,7 +472,8 @@ mod_rpt(sp)
*p++ = ' ';
tlen += 2;
}
- len = snprintf(p, MAXNUM, "%lu ", sp->rptlines[cnt]);
+ len = snprintf(p, MAXNUM, "%lu ",
+ (u_long)sp->rptlines[cnt]);
p += len;
tlen += len;
t = msg_cat(sp,
diff --git a/contrib/nvi/ex/ex_print.c b/contrib/nvi/ex/ex_print.c
index 4218e08..1cc2500 100644
--- a/contrib/nvi/ex/ex_print.c
+++ b/contrib/nvi/ex/ex_print.c
@@ -122,7 +122,8 @@ ex_print(sp, cmdp, fp, tp, flags)
*/
if (LF_ISSET(E_C_HASH)) {
if (from <= 999999) {
- snprintf(buf, sizeof(buf), "%6ld ", from);
+ snprintf(buf, sizeof(buf), "%6lu ",
+ (u_long)from);
p = buf;
} else
p = "TOOBIG ";
diff --git a/contrib/nvi/ex/ex_visual.c b/contrib/nvi/ex/ex_visual.c
index 82e503d..94479439 100644
--- a/contrib/nvi/ex/ex_visual.c
+++ b/contrib/nvi/ex/ex_visual.c
@@ -81,9 +81,10 @@ ex_visual(sp, cmdp)
if (FL_ISSET(cmdp->iflags, E_C_COUNT))
len = snprintf(buf, sizeof(buf),
- "%luz%c%lu", sp->lno, pos, cmdp->count);
+ "%luz%c%lu", (u_long)sp->lno, pos, cmdp->count);
else
- len = snprintf(buf, sizeof(buf), "%luz%c", sp->lno, pos);
+ len = snprintf(buf, sizeof(buf), "%luz%c",
+ (u_long)sp->lno, pos);
(void)v_event_push(sp, NULL, buf, len, CH_NOMAP | CH_QUOTED);
/*
diff --git a/contrib/nvi/vi/vs_line.c b/contrib/nvi/vi/vs_line.c
index b439de9..b7e8e16 100644
--- a/contrib/nvi/vi/vs_line.c
+++ b/contrib/nvi/vi/vs_line.c
@@ -138,8 +138,8 @@ vs_line(sp, smp, yp, xp)
if (O_ISSET(sp, O_NUMBER)) {
cols_per_screen -= O_NUMBER_LENGTH;
if ((!dne || smp->lno == 1) && skip_cols == 0) {
- nlen = snprintf(cbuf,
- sizeof(cbuf), O_NUMBER_FMT, smp->lno);
+ nlen = snprintf(cbuf, sizeof(cbuf),
+ O_NUMBER_FMT, (u_long)smp->lno);
(void)gp->scr_addstr(sp, cbuf, nlen);
}
}
@@ -506,7 +506,8 @@ vs_number(sp)
break;
(void)gp->scr_move(sp, smp - HMAP, 0);
- len = snprintf(nbuf, sizeof(nbuf), O_NUMBER_FMT, smp->lno);
+ len = snprintf(nbuf, sizeof(nbuf),
+ O_NUMBER_FMT, (u_long)smp->lno);
(void)gp->scr_addstr(sp, nbuf, len);
}
(void)gp->scr_move(sp, oldy, oldx);
diff --git a/contrib/nvi/vi/vs_refresh.c b/contrib/nvi/vi/vs_refresh.c
index 8158760..d954c62 100644
--- a/contrib/nvi/vi/vs_refresh.c
+++ b/contrib/nvi/vi/vs_refresh.c
@@ -845,8 +845,8 @@ vs_modeline(sp)
cols = sp->cols - 1;
if (O_ISSET(sp, O_RULER)) {
vs_column(sp, &curcol);
- len =
- snprintf(buf, sizeof(buf), "%lu,%lu", sp->lno, curcol + 1);
+ len = snprintf(buf, sizeof(buf), "%lu,%lu",
+ (u_long)sp->lno, (u_long)(curcol + 1));
midpoint = (cols - ((len + 1) / 2)) / 2;
if (curlen < midpoint) {
diff --git a/usr.bin/cap_mkdb/cap_mkdb.c b/usr.bin/cap_mkdb/cap_mkdb.c
index 1e1c201..91c2222 100644
--- a/usr.bin/cap_mkdb/cap_mkdb.c
+++ b/usr.bin/cap_mkdb/cap_mkdb.c
@@ -102,7 +102,7 @@ main(argc, argv)
*/
(void)snprintf(buf, sizeof(buf), "%s.db", capname ? capname : *argv);
if ((capname = strdup(buf)) == NULL)
- err(1, "");
+ err(1, (char *)NULL);
if ((capdbp = dbopen(capname,
O_CREAT | O_TRUNC | O_RDWR, DEFFILEMODE, DB_HASH, NULL)) == NULL)
err(1, "%s", buf);
@@ -159,7 +159,7 @@ db_build(ifiles)
if (bplen <= len + 2) {
bplen += MAX(256, len + 2);
if ((data.data = realloc(data.data, bplen)) == NULL)
- err(1, "");
+ err(1, (char *)NULL);
}
/* Find the end of the name field. */
diff --git a/usr.bin/gencat/genlib.c b/usr.bin/gencat/genlib.c
index a6321cb..68cc7f4 100644
--- a/usr.bin/gencat/genlib.c
+++ b/usr.bin/gencat/genlib.c
@@ -74,7 +74,7 @@ static void warning(cptr, msg)
char *cptr;
char *msg;
{
- warnx("%s on line %d\n%s", msg, lineno, curline);
+ warnx("%s on line %ld\n%s", msg, lineno, curline);
if (cptr) {
char *tptr;
for (tptr = curline; tptr < cptr; ++tptr) putc(' ', stderr);
@@ -877,7 +877,7 @@ FILE *fp;
errx(1, "no catalog open");
for (set = cat->first; set; set = set->next) {
- fprintf(fp, "$set %d", set->setId);
+ fprintf(fp, "$set %ld", set->setId);
if (set->hconst)
fprintf(fp, " # %s", set->hconst);
fprintf(fp, "\n\n");
@@ -885,7 +885,7 @@ FILE *fp;
for (msg = set->first; msg; msg = msg->next) {
if (msg->hconst)
fprintf(fp, "# %s\n", msg->hconst);
- fprintf(fp, "%d\t%s\n", msg->msgId, msg->str);
+ fprintf(fp, "%ld\t%s\n", msg->msgId, msg->str);
}
fprintf(fp, "\n");
}
diff --git a/usr.bin/mklocale/yacc.y b/usr.bin/mklocale/yacc.y
index a54f25c..a9c2b42 100644
--- a/usr.bin/mklocale/yacc.y
+++ b/usr.bin/mklocale/yacc.y
@@ -687,15 +687,15 @@ dump_tables()
if (new_locale.encoding[0])
fprintf(stderr, "ENCODING %s\n", new_locale.encoding);
if (new_locale.variable)
- fprintf(stderr, "VARIABLE %s\n", new_locale.variable);
+ fprintf(stderr, "VARIABLE %s\n", (char *)new_locale.variable);
fprintf(stderr, "\nMAPLOWER:\n\n");
for (x = 0; x < _CACHED_RUNES; ++x) {
if (isprint(maplower.map[x]))
- fprintf(stderr, " '%c'", maplower.map[x]);
+ fprintf(stderr, " '%c'", (int)maplower.map[x]);
else if (maplower.map[x])
- fprintf(stderr, "%04x", maplower.map[x]);
+ fprintf(stderr, "%04lx", maplower.map[x]);
else
fprintf(stderr, "%4x", 0);
if ((x & 0xf) == 0xf)
@@ -712,9 +712,9 @@ dump_tables()
for (x = 0; x < _CACHED_RUNES; ++x) {
if (isprint(mapupper.map[x]))
- fprintf(stderr, " '%c'", mapupper.map[x]);
+ fprintf(stderr, " '%c'", (int)mapupper.map[x]);
else if (mapupper.map[x])
- fprintf(stderr, "%04x", mapupper.map[x]);
+ fprintf(stderr, "%04lx", mapupper.map[x]);
else
fprintf(stderr, "%4x", 0);
if ((x & 0xf) == 0xf)
@@ -735,9 +735,9 @@ dump_tables()
if (r) {
if (isprint(x))
- fprintf(stderr, " '%c': %2d", x, r & 0xff);
+ fprintf(stderr, " '%c': %2d", x, (int)(r & 0xff));
else
- fprintf(stderr, "%04x: %2d", x, r & 0xff);
+ fprintf(stderr, "%04x: %2d", x, (int)(r & 0xff));
fprintf(stderr, " %4s", (r & _A) ? "alph" : "");
fprintf(stderr, " %4s", (r & _C) ? "ctrl" : "");
@@ -761,7 +761,8 @@ dump_tables()
if (list->map && list->min + 3 < list->max) {
unsigned long r = list->map;
- fprintf(stderr, "%04x: %2d", list->min, r & 0xff);
+ fprintf(stderr, "%04lx: %2d",
+ (unsigned long)list->min, (int)(r & 0xff));
fprintf(stderr, " %4s", (r & _A) ? "alph" : "");
fprintf(stderr, " %4s", (r & _C) ? "ctrl" : "");
@@ -779,7 +780,8 @@ dump_tables()
fprintf(stderr, " %4s", (r & _Q) ? "phon" : "");
fprintf(stderr, "\n...\n");
- fprintf(stderr, "%04x: %2d", list->max, r & 0xff);
+ fprintf(stderr, "%04lx: %2d",
+ (unsigned long)list->max, (int)(r & 0xff));
fprintf(stderr, " %4s", (r & _A) ? "alph" : "");
fprintf(stderr, " %4s", (r & _C) ? "ctrl" : "");
@@ -801,7 +803,7 @@ dump_tables()
unsigned long r = ntohl(list->types[x - list->min]);
if (r) {
- fprintf(stderr, "%04x: %2d", x, r & 0xff);
+ fprintf(stderr, "%04x: %2d", x, (int)(r & 0xff));
fprintf(stderr, " %4s", (r & _A) ? "alph" : "");
fprintf(stderr, " %4s", (r & _C) ? "ctrl" : "");
diff --git a/usr.bin/rpcgen/rpc_sample.c b/usr.bin/rpcgen/rpc_sample.c
index 1de374c..e4f045f 100644
--- a/usr.bin/rpcgen/rpc_sample.c
+++ b/usr.bin/rpcgen/rpc_sample.c
@@ -221,7 +221,7 @@ write_sample_server(def)
else
f_print(fout, "char *");
/* cannot have void type */
- f_print(fout, " result;\n", proc->res_type);
+ f_print(fout, " result;\n");
}
else
f_print(fout, "\tbool_t retval;\n");
diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c
index cb26f22..62b2ab1 100644
--- a/usr.bin/rpcgen/rpc_svcout.c
+++ b/usr.bin/rpcgen/rpc_svcout.c
@@ -196,7 +196,7 @@ write_netid_register(transp)
f_print(fout, "%s\t\texit(1);\n", sp);
f_print(fout, "%s\t}\n", sp);
f_print(fout, "%s\t%s = svc_tli_create(RPC_ANYFD, nconf, 0, 0, 0);\n",
- sp, TRANSP, transp);
+ sp, TRANSP);
f_print(fout, "%s\tif (%s == NULL) {\n", sp, TRANSP);
(void) sprintf(_errbuf, "cannot create %s service.", transp);
print_err_message(tmpbuf);
OpenPOWER on IntegriCloud