Use int instead of size_t (%*s needs int).
MFC after: 1 week
This commit is contained in:
parent
159b454819
commit
da80913d35
@ -755,11 +755,11 @@ std_status_available(void)
|
||||
}
|
||||
|
||||
static void
|
||||
status_update_len(struct ggeom *gp, size_t *name_len, size_t *status_len)
|
||||
status_update_len(struct ggeom *gp, int *name_len, int *status_len)
|
||||
{
|
||||
struct gprovider *pp;
|
||||
struct gconfig *conf;
|
||||
size_t len;
|
||||
int len;
|
||||
|
||||
assert(gp != NULL);
|
||||
assert(name_len != NULL);
|
||||
@ -800,7 +800,7 @@ status_one_consumer(struct gconsumer *cp)
|
||||
}
|
||||
|
||||
static void
|
||||
status_one_geom(struct ggeom *gp, size_t name_len, size_t status_len)
|
||||
status_one_geom(struct ggeom *gp, int name_len, int status_len)
|
||||
{
|
||||
struct gprovider *pp;
|
||||
struct gconsumer *cp;
|
||||
@ -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", (int)name_len, name);
|
||||
printf("%*s", name_len, name);
|
||||
LIST_FOREACH(conf, &gp->lg_config, lg_config) {
|
||||
if (strcasecmp(conf->lg_name, "state") == 0) {
|
||||
printf(" %*s", (int)status_len, conf->lg_val);
|
||||
printf(" %*s", status_len, conf->lg_val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (conf == NULL)
|
||||
printf(" %*s", (int)status_len, "N/A");
|
||||
printf(" %*s", status_len, "N/A");
|
||||
LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) {
|
||||
if (cp != LIST_FIRST(&gp->lg_consumer))
|
||||
printf("%*s %*s", (int)name_len, "", (int)status_len, "");
|
||||
printf("%*s %*s", name_len, "", status_len, "");
|
||||
if (status_one_consumer(cp) && !newline)
|
||||
newline = 1;
|
||||
}
|
||||
@ -838,7 +838,7 @@ std_status(struct gctl_req *req, unsigned flags __unused)
|
||||
struct gmesh mesh;
|
||||
struct gclass *classp;
|
||||
struct ggeom *gp;
|
||||
size_t name_len, status_len;
|
||||
int name_len, status_len;
|
||||
int error, *nargs;
|
||||
|
||||
error = geom_gettree(&mesh);
|
||||
@ -890,7 +890,7 @@ std_status(struct gctl_req *req, unsigned flags __unused)
|
||||
if (n == 0)
|
||||
goto end;
|
||||
}
|
||||
printf("%*s %*s %s\n", (int)name_len, "Name", (int)status_len, "Status",
|
||||
printf("%*s %*s %s\n", name_len, "Name", status_len, "Status",
|
||||
"Components");
|
||||
if (*nargs > 0) {
|
||||
int i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user