From: Simon Marchi Date: Sat, 5 Mar 2022 01:20:34 +0000 (-0500) Subject: Fix: src.text.details: use write_uint_prop_value to handle unsigned values in write_i... X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=3feba3d89aecffdf8c3f4edad75275d44b38f156;ds=sidebyside Fix: src.text.details: use write_uint_prop_value to handle unsigned values in write_int_range I tried creating an option field class with unsigned integer selector, with a [1, UINT64_MAX] range. The details field class shows it as: opt_with_uint_sel: Option (unsigned integer selector) (Selector field location [Event payload: uint_selector]): Selector ranges: [1, -1] The -1 is wrong. Fix two spots to call write_uint_prop_value instead of write_int_prop_value. After: opt_with_uint_sel: Option (unsigned integer selector) (Selector field location [Event payload: uint_selector]): Selector ranges: [1, 18,446,744,073,709,551,615] Change-Id: I83344b2a241f597da86c21da030b40eed2a4955f Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/7503 CI-Build: Philippe Proulx Tested-by: jenkins Reviewed-by: Philippe Proulx --- diff --git a/src/plugins/text/details/write.c b/src/plugins/text/details/write.c index 8409a96c..fbefd809 100644 --- a/src/plugins/text/details/write.c +++ b/src/plugins/text/details/write.c @@ -672,7 +672,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) { @@ -681,7 +681,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); } }