configure: re-enable '-Wunused-parameter'
[babeltrace.git] / src / plugins / text / details / write.c
index b98efb78c4d55e0afb42816ff719feecfccd7553..1962f5dfe3506a775c754370e2a7b1cfd96c9326 100644 (file)
@@ -1,23 +1,7 @@
 /*
- * Copyright 2019 Philippe Proulx <pproulx@efficios.com>
- *
- * 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:
+ * SPDX-License-Identifier: MIT
  *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Copyright 2019 Philippe Proulx <pproulx@efficios.com>
  */
 
 #include <babeltrace2/babeltrace.h>
@@ -105,7 +89,10 @@ void format_uint(char *buf, uint64_t value, unsigned int base)
                bt_common_abort();
        }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
        sprintf(buf_start, spec, value);
+#pragma GCC diagnostic pop
 
        if (sep_digits) {
                bt_common_sep_digits(buf_start, digits_per_group, sep);
@@ -158,7 +145,10 @@ void format_int(char *buf, int64_t value, unsigned int base)
                bt_common_abort();
        }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
        sprintf(buf_start, spec, abs_value);
+#pragma GCC diagnostic pop
 
        if (sep_digits) {
                bt_common_sep_digits(buf_start, digits_per_group, sep);
@@ -371,7 +361,9 @@ gint compare_strings(const char **a, const char **b)
 
 static
 bt_value_map_foreach_entry_const_func_status map_value_foreach_add_key_to_array(
-               const char *key, const bt_value *object, void *data)
+               const char *key,
+               const bt_value *object __attribute__((unused)),
+               void *data)
 {
        GPtrArray *keys = data;
 
@@ -670,7 +662,7 @@ void destroy_enum_field_class_mapping(struct enum_field_class_mapping *mapping)
 static
 struct int_range *int_range_at(GArray *ranges, uint64_t index)
 {
-       return &g_array_index(ranges, struct int_range, index);
+       return &bt_g_array_index(ranges, struct int_range, index);
 }
 
 static
@@ -682,7 +674,7 @@ void write_int_range(struct details_write_ctx *ctx,
        if (is_signed) {
                write_int_prop_value(ctx, range->lower.i);
        } else {
-               write_int_prop_value(ctx, range->lower.u);
+               write_uint_prop_value(ctx, range->lower.u);
        }
 
        if (range->lower.u != range->upper.u) {
@@ -691,7 +683,7 @@ void write_int_range(struct details_write_ctx *ctx,
                if (is_signed) {
                        write_int_prop_value(ctx, range->upper.i);
                } else {
-                       write_int_prop_value(ctx, range->upper.u);
+                       write_uint_prop_value(ctx, range->upper.u);
                }
        }
 
@@ -2512,7 +2504,7 @@ int write_message_iterator_inactivity_message(struct details_write_ctx *ctx,
 {
        int ret = 0;
        const bt_clock_snapshot *cs =
-               bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
+               bt_message_message_iterator_inactivity_borrow_clock_snapshot_const(
                        msg);
 
        /* Write time */
@@ -2540,7 +2532,6 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 int details_write_message(struct details_comp *details_comp,
                const bt_message *msg)
 {
This page took 0.027419 seconds and 4 git commands to generate.