Fix: print.c: remove extra `)` after `+????????????`
[babeltrace.git] / plugins / text / pretty / print.c
index be9b13e9b5a4bffbe87e31f5cd0e68041635e991..3f850b11b54b446602503eda7680bb5f744d7271 100644 (file)
@@ -213,22 +213,20 @@ int print_event_timestamp(struct pretty_component *pretty,
 {
        bool print_names = pretty->options.print_header_field_names;
        int ret = 0;
-       const bt_stream *stream = NULL;
-       const bt_stream_class *stream_class = NULL;
        const bt_clock_snapshot *clock_snapshot = NULL;
-       const bt_event *event = bt_message_event_borrow_event_const(event_msg);
-
-       stream = bt_event_borrow_stream_const(event);
-       stream_class = bt_stream_borrow_class_const(stream);
 
-       if (!bt_stream_class_borrow_default_clock_class_const(stream_class)) {
+       if (!bt_message_event_borrow_stream_class_default_clock_class_const(
+                       event_msg)) {
                /* No default clock class: skip the timestamp without an error */
                goto end;
        }
 
        if (bt_message_event_borrow_default_clock_snapshot_const(event_msg,
                        &clock_snapshot) != BT_CLOCK_SNAPSHOT_STATE_KNOWN) {
-               /* No default clock value: skip the timestamp without an error */
+               /*
+                * No known default clock value: skip the timestamp
+                * without an error.
+                */
                goto end;
        }
 
@@ -262,7 +260,7 @@ int print_event_timestamp(struct pretty_component *pretty,
                if (pretty->options.print_timestamp_cycles) {
                        if (pretty->delta_cycles == -1ULL) {
                                g_string_append(pretty->string,
-                                       "+??????????\?\?"); /* Not a trigraph. */
+                                       "+??????????\?\?"); /* Not a trigraph. */
                        } else {
                                g_string_append_printf(pretty->string,
                                        "+%012" PRIu64, pretty->delta_cycles);
@@ -1216,6 +1214,7 @@ int print_discarded_elements_msg(struct pretty_component *pretty,
        bt_uuid trace_uuid;
        int64_t stream_class_id;
        int64_t stream_id;
+       const char *init_msg;
 
        /* Stream name */
        stream_name = bt_stream_get_name(stream);
@@ -1245,16 +1244,22 @@ int print_discarded_elements_msg(struct pretty_component *pretty,
 
        /* Format message */
        g_string_assign(pretty->string, "");
+
+       if (count == UINT64_C(-1)) {
+               init_msg = "Tracer may have discarded";
+       } else {
+               init_msg = "Tracer discarded";
+       }
+
        g_string_append_printf(pretty->string,
-               "%s%sWARNING%s%s: Tracer discarded ",
+               "%s%sWARNING%s%s: %s ",
                bt_common_color_fg_yellow(),
                bt_common_color_bold(),
                bt_common_color_reset(),
-               bt_common_color_fg_yellow());
+               bt_common_color_fg_yellow(), init_msg);
 
        if (count == UINT64_C(-1)) {
-               g_string_append_printf(pretty->string, "a number of %ss",
-                       elem_type);
+               g_string_append_printf(pretty->string, "%ss", elem_type);
        } else {
                g_string_append_printf(pretty->string,
                        "%" PRIu64 " %s%s", count, elem_type,
This page took 0.037848 seconds and 4 git commands to generate.