Filter refactoring: indentation fix
This commit is contained in:
parent
fc8df41ec6
commit
a8740d6c09
1 changed files with 25 additions and 24 deletions
|
@ -641,37 +641,37 @@ interpret(struct filter_state *fs, struct f_inst *what)
|
||||||
res = (struct f_val) { .type = T_VOID };
|
res = (struct f_val) { .type = T_VOID };
|
||||||
|
|
||||||
for ( ; what; what = what->next) {
|
for ( ; what; what = what->next) {
|
||||||
res = (struct f_val) { .type = T_VOID };
|
res = (struct f_val) { .type = T_VOID };
|
||||||
switch(what->fi_code) {
|
switch (what->fi_code) {
|
||||||
|
|
||||||
#define runtime(fmt, ...) do { \
|
#define runtime(fmt, ...) do { \
|
||||||
if (!(fs->flags & FF_SILENT)) \
|
if (!(fs->flags & FF_SILENT)) \
|
||||||
log_rl(&rl_runtime_err, L_ERR "filters, line %d: " fmt, what->lineno, ##__VA_ARGS__); \
|
log_rl(&rl_runtime_err, L_ERR "filters, line %d: " fmt, what->lineno, ##__VA_ARGS__); \
|
||||||
return F_ERROR; \
|
return F_ERROR; \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define ARG_ANY(n) INTERPRET(what->a##n.p, n)
|
#define ARG_ANY(n) INTERPRET(what->a##n.p, n)
|
||||||
|
|
||||||
#define ARG(n,t) ARG_ANY(n); \
|
#define ARG(n,t) do { \
|
||||||
if (v##n.type != t) \
|
ARG_ANY(n); \
|
||||||
runtime("Argument %d of instruction %s must be of type %02x, got %02x", \
|
if (v##n.type != t) \
|
||||||
n, f_instruction_name(what->fi_code), t, v##n.type);
|
runtime("Argument %d of instruction %s must be of type %02x, got %02x", \
|
||||||
|
n, f_instruction_name(what->fi_code), t, v##n.type); \
|
||||||
#define INTERPRET(what_, n) do { \
|
|
||||||
fs->stack_ptr += n; \
|
|
||||||
fret = interpret(fs, what_); \
|
|
||||||
fs->stack_ptr -= n; \
|
|
||||||
if (fret == F_RETURN) \
|
|
||||||
bug("This shall not happen"); \
|
|
||||||
if (fret > F_RETURN) \
|
|
||||||
return fret; \
|
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define ACCESS_RTE \
|
#define INTERPRET(what_, n) do { \
|
||||||
do { if (!fs->rte) runtime("No route to access"); } while (0)
|
fs->stack_ptr += n; \
|
||||||
|
fret = interpret(fs, what_); \
|
||||||
|
fs->stack_ptr -= n; \
|
||||||
|
if (fret == F_RETURN) \
|
||||||
|
bug("This shall not happen"); \
|
||||||
|
if (fret > F_RETURN) \
|
||||||
|
return fret; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define ACCESS_EATTRS \
|
#define ACCESS_RTE do { if (!fs->rte) runtime("No route to access"); } while (0)
|
||||||
do { if (!fs->eattrs) f_cache_eattrs(fs); } while (0)
|
|
||||||
|
#define ACCESS_EATTRS do { if (!fs->eattrs) f_cache_eattrs(fs); } while (0)
|
||||||
|
|
||||||
#define BITFIELD_MASK(what_) (1u << EA_BIT_GET(what_->a2.i))
|
#define BITFIELD_MASK(what_) (1u << EA_BIT_GET(what_->a2.i))
|
||||||
|
|
||||||
|
@ -684,7 +684,8 @@ interpret(struct filter_state *fs, struct f_inst *what)
|
||||||
#undef INTERPRET
|
#undef INTERPRET
|
||||||
#undef ACCESS_RTE
|
#undef ACCESS_RTE
|
||||||
#undef ACCESS_EATTRS
|
#undef ACCESS_EATTRS
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
return F_NOP;
|
return F_NOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue