plugin-dev.h: put selector (type) close to union in structures
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 26 Jan 2017 22:14:27 +0000 (17:14 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:37 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/plugin/plugin-dev.h

index d65ccce5d07ced2f67e69d3aa4b98374b80e9ab8..76e58e67ac26329c3a43fb7034d0a930f7672ee6 100644 (file)
@@ -99,12 +99,12 @@ struct __bt_plugin_descriptor_attribute {
        /* Plugin descriptor to which to associate this attribute */
        const struct __bt_plugin_descriptor *plugin_descriptor;
 
-       /* Attribute's type */
-       enum __bt_plugin_descriptor_attribute_type type;
-
        /* Name of the attribute's type for debug purposes */
        const char *type_name;
 
+       /* Attribute's type */
+       enum __bt_plugin_descriptor_attribute_type type;
+
        /* Attribute's value (depends on attribute's type) */
        union {
                /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT */
@@ -135,12 +135,12 @@ struct __bt_plugin_component_class_descriptor {
         */
        const struct __bt_plugin_descriptor *plugin_descriptor;
 
-       /* Component class type */
-       enum bt_component_class_type type;
-
        /* Component class name */
        const char *name;
 
+       /* Component class type */
+       enum bt_component_class_type type;
+
        /* Mandatory methods (depends on component class type) */
        union {
                /* BT_COMPONENT_CLASS_TYPE_SOURCE */
@@ -177,12 +177,12 @@ struct __bt_plugin_component_class_descriptor_attribute {
         */
        const struct __bt_plugin_component_class_descriptor *comp_class_descriptor;
 
-       /* Attribute's type */
-       enum __bt_plugin_component_class_descriptor_attribute_type type;
-
        /* Name of the attribute's type for debug purposes */
        const char *type_name;
 
+       /* Attribute's type */
+       enum __bt_plugin_component_class_descriptor_attribute_type type;
+
        /* Attribute's value (depends on attribute's type) */
        union {
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
@@ -265,8 +265,8 @@ struct __bt_plugin_component_class_descriptor_attribute {
 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _x) \
        static struct __bt_plugin_descriptor_attribute __bt_plugin_descriptor_attribute_##_id##_##_attr_name = { \
                .plugin_descriptor = &__bt_plugin_descriptor_##_id,     \
-               .type = _attr_type,                                     \
                .type_name = #_attr_name,                               \
+               .type = _attr_type,                                     \
                .value._attr_name = _x,                                 \
        };                                                              \
        static struct __bt_plugin_descriptor_attribute const * const __bt_plugin_descriptor_attribute_##_id##_##_attr_name##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS = &__bt_plugin_descriptor_attribute_##_id##_##_attr_name; \
@@ -356,8 +356,8 @@ struct __bt_plugin_component_class_descriptor_attribute {
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _init_iterator_method) \
        static struct __bt_plugin_component_class_descriptor __bt_plugin_source_component_class_descriptor_##_id##_##_comp_class_id = { \
                .plugin_descriptor = &__bt_plugin_descriptor_##_id,     \
-               .type = BT_COMPONENT_CLASS_TYPE_SOURCE,                 \
                .name = _name,                                          \
+               .type = BT_COMPONENT_CLASS_TYPE_SOURCE,                 \
                .methods.source = {                                     \
                        .init_iterator = _init_iterator_method,         \
                },                                                      \
@@ -377,8 +377,8 @@ struct __bt_plugin_component_class_descriptor_attribute {
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _init_iterator_method) \
        static struct __bt_plugin_component_class_descriptor __bt_plugin_filter_component_class_descriptor_##_id##_##_comp_class_id = { \
                .plugin_descriptor = &__bt_plugin_descriptor_##_id,     \
-               .type = BT_COMPONENT_CLASS_TYPE_FILTER,                 \
                .name = _name,                                          \
+               .type = BT_COMPONENT_CLASS_TYPE_FILTER,                 \
                .methods.filter = {                                     \
                        .init_iterator = _init_iterator_method,         \
                },                                                      \
@@ -398,8 +398,8 @@ struct __bt_plugin_component_class_descriptor_attribute {
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _consume_method) \
        static struct __bt_plugin_component_class_descriptor __bt_plugin_sink_component_class_descriptor_##_id##_##_comp_class_id = { \
                .plugin_descriptor = &__bt_plugin_descriptor_##_id,     \
-               .type = BT_COMPONENT_CLASS_TYPE_SINK,                   \
                .name = _name,                                          \
+               .type = BT_COMPONENT_CLASS_TYPE_SINK,                   \
                .methods.sink = {                                       \
                        .consume = _consume_method,                     \
                },                                                      \
@@ -422,8 +422,8 @@ struct __bt_plugin_component_class_descriptor_attribute {
 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _comp_class_id, _type, _x) \
        static struct __bt_plugin_component_class_descriptor_attribute __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_comp_class_id##_##_attr_name = { \
                .comp_class_descriptor = &__bt_plugin_##_type##_component_class_descriptor_##_id##_##_comp_class_id, \
-               .type = _attr_type,                                     \
                .type_name = #_attr_name,                               \
+               .type = _attr_type,                                     \
                .value._attr_name = _x,                                 \
        };                                                              \
        static struct __bt_plugin_component_class_descriptor_attribute const * const __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_comp_class_id##_##_attr_name##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS = &__bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_comp_class_id##_##_attr_name; \
This page took 0.026933 seconds and 4 git commands to generate.