Cleanup: use ctf_scope_string function to print `enum ctf_scope` vars
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 18 Dec 2018 21:02:57 +0000 (16:02 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:37 +0000 (18:19 -0400)
This fixes the following Clang warning:
  ctf-meta-resolve.c:278:28: error: implicit conversion from enumeration type 'enum ctf_scope' to different enumeration type 'enum bt_scope' [-Werror,-Wenum-conversion]
                                  bt_common_scope_string(scope));
                                  ~~~~~~~~~~~~~~~~~~~~~~ ^~~~~
  ../../../../include/babeltrace/logging-internal.h:854:46: note: expanded from macro 'BT_LOGV'
                          BT_LOG_WRITE(BT_LOG_VERBOSE, _BT_LOG_TAG, __VA_ARGS__)
                                                                    ^~~~~~~~~~~
  ../../../../include/babeltrace/logging-internal.h:818:18: note: expanded from macro 'BT_LOG_WRITE'
                                                          lvl, tag, __VA_ARGS__); \

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
plugins/ctf/common/metadata/ctf-meta-resolve.c

index a8e4746ed6e08c0e5889298201c4d246e87f2df2..03637f964e02f372cd527fcf70d61643f601e541 100644 (file)
@@ -275,7 +275,7 @@ enum ctf_scope get_root_scope_from_absolute_pathstr(const char *pathstr)
                        BT_LOGV("Prefix does not match: trying the next one: "
                                "path=\"%s\", path-prefix=\"%s\", scope=%s",
                                pathstr, absolute_path_prefixes[scope],
-                               bt_common_scope_string(scope));
+                               ctf_scope_string(scope));
                        continue;
                }
 
@@ -283,7 +283,7 @@ enum ctf_scope get_root_scope_from_absolute_pathstr(const char *pathstr)
                ret = scope;
                BT_LOGV("Found root scope from absolute path: "
                        "path=\"%s\", scope=%s", pathstr,
-                       bt_common_scope_string(scope));
+                       ctf_scope_string(scope));
                goto end;
        }
 
@@ -474,7 +474,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
                if (ctx->tc->is_translated) {
                        BT_LOGE("Trace class is already translated: "
                                "root-scope=%s",
-                               bt_common_scope_string(field_path->root));
+                               ctf_scope_string(field_path->root));
                        ret = -1;
                        goto end;
                }
@@ -486,7 +486,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
                if (!ctx->sc) {
                        BT_LOGE("No current stream class: "
                                "root-scope=%s",
-                               bt_common_scope_string(field_path->root));
+                               ctf_scope_string(field_path->root));
                        ret = -1;
                        goto end;
                }
@@ -494,7 +494,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
                if (ctx->sc->is_translated) {
                        BT_LOGE("Stream class is already translated: "
                                "root-scope=%s",
-                               bt_common_scope_string(field_path->root));
+                               ctf_scope_string(field_path->root));
                        ret = -1;
                        goto end;
                }
@@ -505,7 +505,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
                if (!ctx->ec) {
                        BT_LOGE("No current event class: "
                                "root-scope=%s",
-                               bt_common_scope_string(field_path->root));
+                               ctf_scope_string(field_path->root));
                        ret = -1;
                        goto end;
                }
@@ -513,7 +513,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
                if (ctx->ec->is_translated) {
                        BT_LOGE("Event class is already translated: "
                                "root-scope=%s",
-                               bt_common_scope_string(field_path->root));
+                               ctf_scope_string(field_path->root));
                        ret = -1;
                        goto end;
                }
@@ -534,7 +534,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
                /* Error: root class is not available */
                BT_LOGE("Root field class is not available: "
                        "root-scope=%s",
-                       bt_common_scope_string(field_path->root));
+                       ctf_scope_string(field_path->root));
                ret = -1;
                goto end;
        }
@@ -656,25 +656,25 @@ int pathstr_to_field_path(const char *pathstr,
                /* Relative path: start with current root scope */
                field_path->root = ctx->root_scope;
                BT_LOGV("Detected relative path: starting with current root scope: "
-                       "scope=%s", bt_common_scope_string(field_path->root));
+                       "scope=%s", ctf_scope_string(field_path->root));
                ret = relative_ptokens_to_field_path(ptokens, field_path, ctx);
                if (ret) {
                        BT_LOGE("Cannot get relative field path of path string: "
                                "path=\"%s\", start-scope=%s, end-scope=%s",
-                               pathstr, bt_common_scope_string(ctx->root_scope),
-                               bt_common_scope_string(field_path->root));
+                               pathstr, ctf_scope_string(ctx->root_scope),
+                               ctf_scope_string(field_path->root));
                        goto end;
                }
        } else {
                /* Absolute path: use found root scope */
                field_path->root = root_scope;
                BT_LOGV("Detected absolute path: using root scope: "
-                       "scope=%s", bt_common_scope_string(field_path->root));
+                       "scope=%s", ctf_scope_string(field_path->root));
                ret = absolute_ptokens_to_field_path(ptokens, field_path, ctx);
                if (ret) {
                        BT_LOGE("Cannot get absolute field path of path string: "
                                "path=\"%s\", root-scope=%s",
-                               pathstr, bt_common_scope_string(root_scope));
+                               pathstr, ctf_scope_string(root_scope));
                        goto end;
                }
        }
@@ -713,7 +713,7 @@ struct ctf_field_class *field_path_to_field_class(
        if (!fc) {
                /* Error: root class is not available */
                BT_LOGE("Root field class is not available: root-scope=%s",
-                       bt_common_scope_string(field_path->root));
+                       ctf_scope_string(field_path->root));
                goto end;
        }
 
@@ -866,8 +866,8 @@ int validate_target_field_path(struct ctf_field_path *target_field_path,
        if (target_field_path->root > ctx_field_path.root) {
                BT_LOGE("Target field class is located after source field class: "
                        "target-root=%s, source-root=%s",
-                       bt_common_scope_string(target_field_path->root),
-                       bt_common_scope_string(ctx_field_path.root));
+                       ctf_scope_string(target_field_path->root),
+                       ctf_scope_string(ctx_field_path.root));
                ret = -1;
                goto end;
        }
This page took 0.03029 seconds and 4 git commands to generate.