Commit 4b9f7ce4 authored by Geoff Simmons's avatar Geoff Simmons

Fix whitespace.

parent 4dc50186
...@@ -43,13 +43,13 @@ ...@@ -43,13 +43,13 @@
#include "vre2/vre2set.h" #include "vre2/vre2set.h"
#define ERR(ctx, msg) \ #define ERR(ctx, msg) \
errmsg((ctx), "vmod re2 error: " msg) errmsg((ctx), "vmod re2 error: " msg)
#define VERR(ctx, fmt, ...) \ #define VERR(ctx, fmt, ...) \
errmsg((ctx), "vmod re2 error: " fmt, __VA_ARGS__) errmsg((ctx), "vmod re2 error: " fmt, __VA_ARGS__)
#define VERRNOMEM(ctx, fmt, ...) \ #define VERRNOMEM(ctx, fmt, ...) \
VERR((ctx), fmt ", out of space", __VA_ARGS__) VERR((ctx), fmt ", out of space", __VA_ARGS__)
#define INIT(ctx) (((ctx)->method & VCL_MET_INIT) != 0) #define INIT(ctx) (((ctx)->method & VCL_MET_INIT) != 0)
...@@ -93,22 +93,22 @@ static const char * const rewrite_name[] = { ...@@ -93,22 +93,22 @@ static const char * const rewrite_name[] = {
static void static void
errmsg(VRT_CTX, const char *fmt, ...) errmsg(VRT_CTX, const char *fmt, ...)
{ {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
if (ctx->vsl) if (ctx->vsl)
VSLbv(ctx->vsl, SLT_VCL_Error, fmt, args); VSLbv(ctx->vsl, SLT_VCL_Error, fmt, args);
else else
VSLv(SLT_VCL_Error, 0, fmt, args); VSLv(SLT_VCL_Error, 0, fmt, args);
va_end(args); va_end(args);
if (ctx->method == VCL_MET_INIT) { if (ctx->method == VCL_MET_INIT) {
AN(ctx->msg); AN(ctx->msg);
va_start(args, fmt); va_start(args, fmt);
VSB_vprintf(ctx->msg, fmt, args); VSB_vprintf(ctx->msg, fmt, args);
va_end(args); va_end(args);
VRT_handling(ctx, VCL_RET_FAIL); VRT_handling(ctx, VCL_RET_FAIL);
} }
} }
static void static void
...@@ -225,19 +225,19 @@ static VCL_STRING ...@@ -225,19 +225,19 @@ static VCL_STRING
namedref(VRT_CTX, vre2 * restrict vre2, VCL_STRING name, VCL_STRING fallback, namedref(VRT_CTX, vre2 * restrict vre2, VCL_STRING name, VCL_STRING fallback,
void * const restrict groups, const int ngroups) void * const restrict groups, const int ngroups)
{ {
int refnum; int refnum;
const char *err; const char *err;
if ((err = vre2_get_group(vre2, name, &refnum)) != NULL) { if ((err = vre2_get_group(vre2, name, &refnum)) != NULL) {
VERR(ctx, ERR_PREFIX "%s", name, fallback, err); VERR(ctx, ERR_PREFIX "%s", name, fallback, err);
return fallback; return fallback;
} }
if (refnum == -1) { if (refnum == -1) {
VERR(ctx, ERR_PREFIX "no such named group", name, fallback); VERR(ctx, ERR_PREFIX "no such named group", name, fallback);
return fallback; return fallback;
} }
assert(refnum > 0 && refnum <= ngroups); assert(refnum > 0 && refnum <= ngroups);
return backref(ctx, refnum, fallback, groups, ngroups); return backref(ctx, refnum, fallback, groups, ngroups);
} }
#undef ERR_PREFIX #undef ERR_PREFIX
...@@ -453,7 +453,7 @@ vmod_regex_namedref(VRT_CTX, struct vmod_re2_regex *re, VCL_STRING name, ...@@ -453,7 +453,7 @@ vmod_regex_namedref(VRT_CTX, struct vmod_re2_regex *re, VCL_STRING name,
if (re->never_capture) { if (re->never_capture) {
VERR(ctx, ERR_PREFIX "never_capture is true for object %s", VERR(ctx, ERR_PREFIX "never_capture is true for object %s",
re->vcl_name, name, fallback, re->vcl_name); re->vcl_name, name, fallback, re->vcl_name);
return fallback; return fallback;
} }
...@@ -466,7 +466,7 @@ vmod_regex_namedref(VRT_CTX, struct vmod_re2_regex *re, VCL_STRING name, ...@@ -466,7 +466,7 @@ vmod_regex_namedref(VRT_CTX, struct vmod_re2_regex *re, VCL_STRING name,
} }
WS_Contains(ctx->ws, task->priv, sizeof(*task_match)); WS_Contains(ctx->ws, task->priv, sizeof(*task_match));
CAST_OBJ(task_match, task->priv, TASK_MATCH_MAGIC); CAST_OBJ(task_match, task->priv, TASK_MATCH_MAGIC);
return namedref(ctx, re->vre2, name, fallback, task_match->groups, return namedref(ctx, re->vre2, name, fallback, task_match->groups,
re->ngroups); re->ngroups);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment