warning fixes
[lttv.git] / ltt / branches / poly / lttv / lttv / filter.c
index e837068cb2bfc7ba8091a5ca4ac4932d463ba993..06c8370c8f8ce960bfcc7f18f1bcc05f947f9993 100644 (file)
@@ -74,6 +74,9 @@
 #endif
 
 #include <lttv/filter.h>
+#include <ltt/trace.h>
+#include <stdlib.h>
+#include <string.h>
 
 /**
  * @fn LttvSimpleExpression* lttv_simple_expression_new()
@@ -109,7 +112,7 @@ lttv_simple_expression_assign_field(GPtrArray* fp, LttvSimpleExpression* se) {
   GString* f = NULL;
   
   if(fp->len < 2) return FALSE;
-  g_assert(f=g_ptr_array_remove_index(fp,0)); 
+  g_assert((f=g_ptr_array_remove_index(fp,0))); 
   
   /*
    * Parse through the specified 
@@ -376,7 +379,6 @@ lttv_simple_expression_assign_value(LttvSimpleExpression* se, char* value) {
   gboolean is_double = FALSE;
   LttTime t = ltt_time_zero;
   GString* v;
-  GQuark quark;
   
   switch(se->field) {
      /* 
@@ -421,14 +423,14 @@ lttv_simple_expression_assign_value(LttvSimpleExpression* se, char* value) {
               /* cannot specify number with more than one '.' */
               if(is_double) return FALSE; 
               else is_double = TRUE;
-              t.tv_sec = atoi(v);
+              t.tv_sec = atoi(v->str);
               g_string_free(v,TRUE);
               v = g_string_new("");
           } else g_string_append_c(v,value[i]);
        }
        /* number can be integer or double */
-       if(is_double) t.tv_nsec = atoi(v);
-       else t.tv_sec = atoi(v);
+       if(is_double) t.tv_nsec = atoi(v->str);
+       else t.tv_sec = atoi(v->str);
        
        g_string_free(v,TRUE);
        
@@ -1537,6 +1539,7 @@ lttv_filter_append_expression(LttvFilter* filter, const char *expression) {
 
   if(expression == NULL) return FALSE;
   if(filter == NULL) return FALSE;
+  if(expression[0] == '\0') return FALSE;  /* Empty expression */
 
   GString* s = g_string_new("");
   if(filter->expression != NULL) {
This page took 0.02301 seconds and 4 git commands to generate.