*
*/
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <inttypes.h>
+#include "filter-ast.hpp"
+#include "filter-ir.hpp"
+#include "filter-parser.hpp"
-#include <common/compat/errno.h>
+#include <common/compat/errno.hpp>
-#include "filter-ast.h"
-#include "filter-parser.hpp"
-#include "filter-ir.h"
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
-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:
{
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;
}
}