From 6a3749cbfc0061bc5aec25790add9bd06f386d87 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 23 Nov 2019 14:02:06 +0000 Subject: [PATCH] rsa: Move load_err earlier Code motion. We're going to want to use this for public keys. Signed-off-by: Ian Jackson --- rsa.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/rsa.c b/rsa.c index 9642036..6ff8f78 100644 --- a/rsa.c +++ b/rsa.c @@ -61,6 +61,16 @@ struct load_ctx { } u; }; +static void load_err(struct load_ctx *l, + const struct cloc *maybe_loc, FILE *maybe_f, + bool_t unsup, const char *fmt, ...) +{ + va_list al; + va_start(al,fmt); + l->verror(l, maybe_loc ? maybe_loc : l->loc, maybe_f,unsup,fmt,al); + va_end(al); +} + FORMAT(printf,5,0) static void verror_tryload(struct load_ctx *l, const struct cloc *loc, FILE *maybe_f, bool_t unsup, @@ -384,16 +394,6 @@ static list_t *rsapub_apply(closure_t *self, struct cloc loc, dict_t *context, return new_closure(&st->cl); } -static void load_err(struct load_ctx *l, - const struct cloc *maybe_loc, FILE *maybe_f, - bool_t unsup, const char *fmt, ...) -{ - va_list al; - va_start(al,fmt); - l->verror(l, maybe_loc ? maybe_loc : l->loc, maybe_f,unsup,fmt,al); - va_end(al); -} - #define LDFATAL(...) ({ load_err(l,0,0,0,__VA_ARGS__); goto error_out; }) #define LDUNSUP(...) ({ load_err(l,0,0,1,__VA_ARGS__); goto error_out; }) #define LDFATAL_FILE(...) ({ load_err(l,0,f,0,__VA_ARGS__); goto error_out; }) -- 2.30.2