From: siboud Date: Mon, 7 Feb 2005 14:14:03 +0000 (+0000) Subject: fixed some errors ! X-Git-Tag: v0.12.20~2621 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=74b3f7ee1bee56f82acb32d3fd299dcbeca29f58;p=lttv.git fixed some errors ! git-svn-id: http://ltt.polymtl.ca/svn@868 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/lttv/lttv/filter.c b/ltt/branches/poly/lttv/lttv/filter.c index 380cfe06..61422353 100644 --- a/ltt/branches/poly/lttv/lttv/filter.c +++ b/ltt/branches/poly/lttv/lttv/filter.c @@ -57,9 +57,9 @@ parse_simple_expression(GString* expression) { unsigned i; - for(i=0;i, <, =, >=, <=, !=) - * - value - */ + * in browsing that string + * 1. finding boolean ops ( &,|,^,! ) and parenthesis + * 2. finding simple expressions + * - field path + * - op ( >, <, =, >=, <=, !=) + * - value + */ + for(i=0;i': /* higher, higher or equal */ - if(expression[i+1] == '=') { /* >= */ - i++; - current_expression.op = LTTV_FIELD_GE; - } else current_expression.op = LTTV_FIELD_GT; - break; - case '=': /* equal */ - current_expression.op = LTTV_FIELD_EQ; - break; - case + + /* + * mathematic operators + */ + case '<': /* lower, lower or equal */ + if(expression[i+1] == '=') { /* <= */ + i++; + current_expression.op = LTTV_FIELD_LE; + } else current_expression.op = LTTV_FIELD_LT; + break; + case '>': /* higher, higher or equal */ + if(expression[i+1] == '=') { /* >= */ + i++; + current_expression.op = LTTV_FIELD_GE; + } else current_expression.op = LTTV_FIELD_GT; + break; + case '=': /* equal */ + current_expression.op = LTTV_FIELD_EQ; + break; default: /* concatening current string */ - g_string_append_c(currentOption,expression[i]); + g_string_append_c(current_option,expression[i]); } - - } if( p>0 ) {