Cleanup: Use a switch case instead of conditionals
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Feb 2015 20:43:39 +0000 (15:43 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Feb 2015 20:43:39 +0000 (15:43 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ir/event-types.c

index c24ef93fc5a7c33b88a5c23c155260d863811d70..e0df09bb96b6b9dd481658b5a69c2559b7bacb33 100644 (file)
@@ -336,12 +336,19 @@ int bt_ctf_field_type_validate(struct bt_ctf_field_type *type)
                goto end;
        }
 
-       if (type->declaration->id == CTF_TYPE_ENUM) {
+       switch (type->declaration->id) {
+       case CTF_TYPE_ENUM:
+       {
                struct bt_ctf_field_type_enumeration *enumeration =
                        container_of(type, struct bt_ctf_field_type_enumeration,
                        parent);
 
+               /* Ensure enum has entries */
                ret = enumeration->entries->len ? 0 : -1;
+               break;
+       }
+       default:
+               break;
        }
 end:
        return ret;
This page took 0.025891 seconds and 4 git commands to generate.