X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Ffilter%2Ffilter-visitor-ir-check-binary-comparator.cpp;h=2699abde8b5379d52f81673d1d0b12ba1affc0e3;hb=HEAD;hp=480100f25c535a83c2433e81bae202017d1ae7ea;hpb=348ddc5c9107149d48b1f12d31a7e75e9b73b4da;p=lttng-tools.git diff --git a/src/common/filter/filter-visitor-ir-check-binary-comparator.cpp b/src/common/filter/filter-visitor-ir-check-binary-comparator.cpp index 480100f25..1384ff551 100644 --- a/src/common/filter/filter-visitor-ir-check-binary-comparator.cpp +++ b/src/common/filter/filter-visitor-ir-check-binary-comparator.cpp @@ -9,20 +9,19 @@ * */ -#include -#include -#include -#include -#include +#include "filter-ast.hpp" +#include "filter-ir.hpp" +#include "filter-parser.hpp" -#include +#include -#include "filter-ast.h" -#include "filter-parser.hpp" -#include "filter-ir.h" +#include +#include +#include +#include +#include -static -int check_bin_comparator(struct ir_op *node) +static int check_bin_comparator(struct ir_op *node) { switch (node->op) { case IR_OP_UNKNOWN: @@ -40,12 +39,11 @@ int check_bin_comparator(struct ir_op *node) { int ret; - if (node->u.binary.left->data_type == IR_DATA_STRING - || node->u.binary.right->data_type - == IR_DATA_STRING) { - if (node->u.binary.type != AST_OP_EQ - && node->u.binary.type != AST_OP_NE) { - fprintf(stderr, "[error] Only '==' and '!=' comparators are allowed for strings\n"); + if (node->u.binary.left->data_type == IR_DATA_STRING || + node->u.binary.right->data_type == IR_DATA_STRING) { + if (node->u.binary.type != AST_OP_EQ && node->u.binary.type != AST_OP_NE) { + fprintf(stderr, + "[error] Only '==' and '!=' comparators are allowed for strings\n"); return -EINVAL; } }