Various fixes for prototype branch
[lttng-tools.git] / src / common / condition.c
index 4a24202fed6f851e309344471e3664d599045f42..6ee931ec6a4cdcade37e79aac68dd7790ed04f23 100644 (file)
@@ -87,6 +87,25 @@ end:
        return ret;
 }
 
+LTTNG_HIDDEN
+bool lttng_condition_is_equal(struct lttng_condition *a,
+               struct lttng_condition *b)
+{
+       bool is_equal = false;
+
+       if (!a || !b) {
+               goto end;
+       }
+
+       if (a->type != b->type) {
+               goto end;
+       }
+
+       is_equal = a->equal ? a->equal(a, b) : true;
+end:
+       return is_equal;
+}
+
 LTTNG_HIDDEN
 ssize_t lttng_condition_create_from_buffer(const char *buf,
                struct lttng_condition **condition)
@@ -104,7 +123,7 @@ ssize_t lttng_condition_create_from_buffer(const char *buf,
        condition_size += sizeof(*condition_comm);
        buf += condition_size;
 
-       switch (condition_comm->condition_type) {
+       switch ((enum lttng_condition_type) condition_comm->condition_type) {
        case LTTNG_CONDITION_TYPE_BUFFER_USAGE_LOW:
                ret = lttng_condition_buffer_usage_low_create_from_buffer(buf,
                                condition);
This page took 0.025582 seconds and 5 git commands to generate.