Use boolean for frozen and set field states
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 13 Sep 2017 15:47:05 +0000 (11:47 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 16 Sep 2017 02:17:43 +0000 (22:17 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/ctf-ir/fields-internal.h
lib/ctf-ir/fields.c

index b7375a459f226af7aecdc08927fe0274ae08dae4..22d551a59576fd8b939b24e6e7d1c61e4955200c 100644 (file)
@@ -33,6 +33,7 @@
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/types.h>
 #include <stdint.h>
+#include <stdbool.h>
 #include <glib.h>
 
 struct bt_ctf_stream_pos;
@@ -40,8 +41,8 @@ struct bt_ctf_stream_pos;
 struct bt_ctf_field {
        struct bt_object base;
        struct bt_ctf_field_type *type;
-       int payload_set;
-       int frozen;
+       bool payload_set;
+       bool frozen;
 };
 
 struct bt_ctf_field_integer {
index 1633c54cb436613f4dbb864b12719307e75cabc2..9c4297bcaa0f6052994c127428c2732b1f43cb18 100644 (file)
@@ -1264,7 +1264,7 @@ int bt_ctf_field_signed_integer_set_value(struct bt_ctf_field *field,
        }
 
        integer->payload.signd = value;
-       integer->parent.payload_set = 1;
+       integer->parent.payload_set = true;
 end:
        return ret;
 }
@@ -1374,7 +1374,7 @@ int bt_ctf_field_unsigned_integer_set_value(struct bt_ctf_field *field,
        }
 
        integer->payload.unsignd = value;
-       integer->parent.payload_set = 1;
+       integer->parent.payload_set = true;
 end:
        return ret;
 }
@@ -1452,7 +1452,7 @@ int bt_ctf_field_floating_point_set_value(struct bt_ctf_field *field,
        floating_point = container_of(field, struct bt_ctf_field_floating_point,
                parent);
        floating_point->payload = value;
-       floating_point->parent.payload_set = 1;
+       floating_point->parent.payload_set = true;
 end:
        return ret;
 }
@@ -1530,7 +1530,7 @@ int bt_ctf_field_string_set_value(struct bt_ctf_field *field,
                string->payload = g_string_new(value);
        }
 
-       string->parent.payload_set = 1;
+       string->parent.payload_set = true;
 end:
        return ret;
 }
@@ -1578,7 +1578,7 @@ int bt_ctf_field_string_append(struct bt_ctf_field *field,
                string_field->payload = g_string_new(value);
        }
 
-       string_field->parent.payload_set = 1;
+       string_field->parent.payload_set = true;
 
 end:
        return ret;
@@ -1639,7 +1639,7 @@ int bt_ctf_field_string_append_len(struct bt_ctf_field *field,
                        effective_length);
        }
 
-       string_field->parent.payload_set = 1;
+       string_field->parent.payload_set = true;
 
 end:
        return ret;
@@ -2269,7 +2269,7 @@ int bt_ctf_field_generic_reset(struct bt_ctf_field *field)
                goto end;
        }
 
-       field->payload_set = 0;
+       field->payload_set = false;
 end:
        return ret;
 }
@@ -3074,7 +3074,7 @@ end:
 static
 void generic_field_freeze(struct bt_ctf_field *field)
 {
-       field->frozen = 1;
+       field->frozen = true;
 }
 
 static
This page took 0.028944 seconds and 4 git commands to generate.