printf(3) expects that %*s having an int parameter, which generates

warning on 64-bit platforms.  Explicitly cast these values to int
to work around this issue, as these values are tend to be small.

Spotted by:	ia64 tinderbox
This commit is contained in:
Xin LI 2005-03-14 04:33:13 +00:00
parent 42331ebecc
commit 257eeb8e0b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=143549

View File

@ -813,18 +813,18 @@ status_one_geom(struct ggeom *gp, size_t name_len, size_t status_len)
name = pp->lg_name;
else
name = gp->lg_name;
printf("%*s", name_len, name);
printf("%*s", (int)name_len, name);
LIST_FOREACH(conf, &gp->lg_config, lg_config) {
if (strcasecmp(conf->lg_name, "state") == 0) {
printf(" %*s", status_len, conf->lg_val);
printf(" %*s", (int)status_len, conf->lg_val);
break;
}
}
if (conf == NULL)
printf(" %*s", status_len, "N/A");
printf(" %*s", (int)status_len, "N/A");
LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) {
if (cp != LIST_FIRST(&gp->lg_consumer))
printf("%*s %*s", name_len, "", status_len, "");
printf("%*s %*s", (int)name_len, "", (int)status_len, "");
if (status_one_consumer(cp) && !newline)
newline = 1;
}
@ -890,7 +890,7 @@ std_status(struct gctl_req *req, unsigned flags __unused)
if (n == 0)
goto end;
}
printf("%*s %*s %s\n", name_len, "Name", status_len, "Status",
printf("%*s %*s %s\n", (int)name_len, "Name", (int)status_len, "Status",
"Components");
if (*nargs > 0) {
int i;