Move to kernel style SPDX license identifiers
[babeltrace.git] / src / plugins / ctf / common / metadata / ctf-meta-warn-meaningless-header-fields.c
index ebd995f62ecf71a677ea3c5ee1d7dec7c1fd5154..d768f97c16957e55cfd0a85cbf51b3f9caf8f350 100644 (file)
@@ -1,15 +1,7 @@
 /*
- * Copyright 2018 - Philippe Proulx <pproulx@efficios.com>
+ * SPDX-License-Identifier: MIT
  *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
+ * Copyright 2018 Philippe Proulx <pproulx@efficios.com>
  */
 
 #define BT_COMP_LOG_SELF_COMP (log_cfg->self_comp)
@@ -32,6 +24,7 @@ static inline
 void warn_meaningless_field(const char *name, const char *scope_name,
                struct meta_log_config *log_cfg)
 {
+       BT_ASSERT(name);
        BT_COMP_LOGW("User field found in %s: ignoring: name=\"%s\"",
                scope_name, name);
 }
@@ -46,6 +39,11 @@ void warn_meaningless_fields(struct ctf_field_class *fc, const char *name,
                goto end;
        }
 
+       /*
+        * 'name' is guaranteed to be non-NULL whenever the field class is not a
+        * structure. In the case of a structure field class, its members' names
+        * are used.
+        */
        switch (fc->type) {
        case CTF_FIELD_CLASS_TYPE_FLOAT:
        case CTF_FIELD_CLASS_TYPE_STRING:
@@ -112,7 +110,7 @@ void warn_meaningless_fields(struct ctf_field_class *fc, const char *name,
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
 end:
This page took 0.025007 seconds and 4 git commands to generate.