X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Ffilter%2Ffilter-visitor-ir-check-binary-comparator.cpp;fp=src%2Fcommon%2Ffilter%2Ffilter-visitor-ir-check-binary-comparator.cpp;h=1384ff551fc8b37482a33d7e39230c5d226ade7a;hp=2699abde8b5379d52f81673d1d0b12ba1affc0e3;hb=28ab034a2c3582d07d3423d2d746731f87d3969f;hpb=52e345b9ac912d033c2a2c25a170a01cf209839d 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 2699abde8..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 "filter-ast.hpp" -#include "filter-parser.hpp" -#include "filter-ir.hpp" +#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; } }