*
*/
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include "filter-ast.h"
+#include "filter-ast.hpp"
+#include "filter-ir.hpp"
#include "filter-parser.hpp"
-#include "filter-ir.h"
-#include <common/compat/errno.h>
-#include <common/macros.h>
+#include <common/compat/errno.hpp>
+#include <common/macros.hpp>
+
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
-static
-int check_bin_op_nesting_recursive(struct ir_op *node, int nesting)
+static int check_bin_op_nesting_recursive(struct ir_op *node, int nesting)
{
switch (node->op) {
case IR_OP_UNKNOWN:
return -EINVAL;
case IR_OP_ROOT:
- return check_bin_op_nesting_recursive(node->u.root.child,
- nesting);
+ return check_bin_op_nesting_recursive(node->u.root.child, nesting);
case IR_OP_LOAD:
return 0;
case IR_OP_UNARY:
- return check_bin_op_nesting_recursive(node->u.unary.child,
- nesting);
+ return check_bin_op_nesting_recursive(node->u.unary.child, nesting);
case IR_OP_BINARY:
{
int ret;
- ret = check_bin_op_nesting_recursive(node->u.binary.left,
- nesting + 1);
+ ret = check_bin_op_nesting_recursive(node->u.binary.left, nesting + 1);
if (ret)
return ret;
- return check_bin_op_nesting_recursive(node->u.binary.right,
- nesting + 1);
+ return check_bin_op_nesting_recursive(node->u.binary.right, nesting + 1);
}
case IR_OP_LOGICAL:
{
int ret;
- ret = check_bin_op_nesting_recursive(node->u.logical.left,
- nesting);
+ ret = check_bin_op_nesting_recursive(node->u.logical.left, nesting);
if (ret)
return ret;
- return check_bin_op_nesting_recursive(node->u.logical.right,
- nesting);
+ return check_bin_op_nesting_recursive(node->u.logical.right, nesting);
}
}
}