Skip to content

Commit 0015f2b

Browse files
committed
job-list: remove unnecessary variable args
Problem: Several helper functions take variable arguments, which are unnecessary. Remove the variable args to these helper functions.
1 parent f3537d1 commit 0015f2b

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

src/modules/job-list/test/match.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,19 @@ struct match_ctx mctx = { .h = NULL,
2727
.max_comparisons = 0 };
2828

2929
static void list_constraint_create_corner_case (const char *str,
30-
const char *fmt,
31-
...)
30+
const char *msg)
3231
{
3332
struct list_constraint *c;
34-
char buf[1024];
3533
flux_error_t error;
3634
json_error_t jerror;
3735
json_t *jc;
38-
va_list ap;
3936

4037
if (!(jc = json_loads (str, 0, &jerror)))
4138
BAIL_OUT ("json constraint invalid: %s", jerror.text);
4239

43-
va_start (ap, fmt);
44-
vsnprintf(buf, sizeof (buf), fmt, ap);
45-
va_end (ap);
46-
4740
c = list_constraint_create (&mctx, jc, &error);
4841

49-
ok (c == NULL, "list_constraint_create fails on %s", buf);
42+
ok (c == NULL, "list_constraint_create fails on %s", msg);
5043
diag ("error: %s", error.text);
5144
json_decref (jc);
5245
}

src/modules/job-list/test/state_match.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,18 @@
2020
#include "ccan/str/str.h"
2121

2222
static void state_constraint_create_corner_case (const char *str,
23-
const char *fmt,
24-
...)
23+
const char *msg)
2524
{
2625
struct state_constraint *c;
27-
char buf[1024];
2826
flux_error_t error;
2927
json_error_t jerror;
3028
json_t *jc;
31-
va_list ap;
3229

3330
if (!(jc = json_loads (str, 0, &jerror)))
3431
BAIL_OUT ("json constraint invalid: %s", jerror.text);
3532

36-
va_start (ap, fmt);
37-
vsnprintf(buf, sizeof (buf), fmt, ap);
38-
va_end (ap);
39-
4033
c = state_constraint_create (jc, &error);
41-
ok (c == NULL, "state_constraint_create fails on %s", buf);
34+
ok (c == NULL, "state_constraint_create fails on %s", msg);
4235
diag ("error: %s", error.text);
4336
json_decref (jc);
4437
}

0 commit comments

Comments
 (0)