Found by Coverity:
At condition nr_mappings, the value of nr_mappings must be at least 1.
The condition !nr_mappings cannot be true.
CID
1376163 (#1 of 1): Logically dead code
(DEADCODE) dead_error_line: Execution cannot reach this statement:
if (pretty->use_colors) {
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
iter = bt_ctf_field_type_enumeration_find_mappings_by_unsigned_value(
enumeration_field_type, value);
}
iter = bt_ctf_field_type_enumeration_find_mappings_by_unsigned_value(
enumeration_field_type, value);
}
+ g_string_append(pretty->string, "( ");
- ret = BT_COMPONENT_STATUS_ERROR;
- goto end;
+ if (pretty->use_colors) {
+ g_string_append(pretty->string, COLOR_UNKNOWN);
+ }
+ g_string_append(pretty->string, "<unknown>");
+ if (pretty->use_colors) {
+ g_string_append(pretty->string, COLOR_RST);
+ }
+ goto skip_loop;
- g_string_append(pretty->string, "( ");
for (;;) {
const char *mapping_name;
for (;;) {
const char *mapping_name;
- if (!nr_mappings) {
- if (pretty->use_colors) {
- g_string_append(pretty->string, COLOR_UNKNOWN);
- }
- g_string_append(pretty->string, "<unknown>");
- if (pretty->use_colors) {
- g_string_append(pretty->string, COLOR_RST);
- }
- }
g_string_append(pretty->string, " : container = ");
ret = print_integer(pretty, container_field);
if (ret != BT_COMPONENT_STATUS_OK) {
g_string_append(pretty->string, " : container = ");
ret = print_integer(pretty, container_field);
if (ret != BT_COMPONENT_STATUS_OK) {