]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Filter refactoring: indentation fix
authorMaria Matejka <mq@ucw.cz>
Tue, 18 Dec 2018 16:10:05 +0000 (17:10 +0100)
committerMaria Matejka <mq@ucw.cz>
Wed, 20 Feb 2019 21:30:54 +0000 (22:30 +0100)
filter/filter.c

index 62804aec9fe9c678d14e466ed5459eff0bfd623f..b15ede8a78ed644446530a635d9fc17c3d9d1c3b 100644 (file)
@@ -641,37 +641,37 @@ interpret(struct filter_state *fs, struct f_inst *what)
   res = (struct f_val) { .type = T_VOID };
 
   for ( ; what; what = what->next) {
-  res = (struct f_val) { .type = T_VOID };
-  switch(what->fi_code) {
+    res = (struct f_val) { .type = T_VOID };
+    switch (what->fi_code) {
 
 #define runtime(fmt, ...) do { \
-    if (!(fs->flags & FF_SILENT)) \
-      log_rl(&rl_runtime_err, L_ERR "filters, line %d: " fmt, what->lineno, ##__VA_ARGS__); \
-    return F_ERROR; \
-  } while(0)
+  if (!(fs->flags & FF_SILENT)) \
+    log_rl(&rl_runtime_err, L_ERR "filters, line %d: " fmt, what->lineno, ##__VA_ARGS__); \
+  return F_ERROR; \
+} while(0)
 
 #define ARG_ANY(n) INTERPRET(what->a##n.p, n)
 
-#define ARG(n,t) ARG_ANY(n); \
-    if (v##n.type != t) \
-      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 ARG(n,t) do { \
+  ARG_ANY(n); \
+  if (v##n.type != t) \
+    runtime("Argument %d of instruction %s must be of type %02x, got %02x", \
+           n, f_instruction_name(what->fi_code), t, v##n.type); \
+} while (0)
 
 #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; \
+  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_RTE \
-  do { if (!fs->rte) runtime("No route to access"); } while (0)
+#define ACCESS_RTE do { if (!fs->rte) runtime("No route to access"); } while (0)
 
-#define ACCESS_EATTRS \
-  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))
 
@@ -684,7 +684,8 @@ interpret(struct filter_state *fs, struct f_inst *what)
 #undef INTERPRET
 #undef ACCESS_RTE
 #undef ACCESS_EATTRS
-  }}
+    }
+  }
   return F_NOP;
 }