- size += session_name_len + channel_name_len;
- if (buf) {
- struct lttng_condition_buffer_usage_comm usage_comm = {
- .threshold_set_in_bytes = usage->threshold_bytes.set ? 1 : 0,
- .session_name_len = session_name_len,
- .channel_name_len = channel_name_len,
- .domain_type = (int8_t) usage->domain.type,
- };
-
- if (usage->threshold_bytes.set) {
- usage_comm.threshold = usage->threshold_bytes.value;
- } else {
- uint64_t val = double_to_fixed(
- usage->threshold_ratio.value);
-
- if (val > UINT32_MAX) {
- /* overflow. */
- ret = -1;
- goto end;
- }
- usage_comm.threshold = val;
+
+ usage_comm.threshold_set_in_bytes = !!usage->threshold_bytes.set;
+ usage_comm.session_name_len = session_name_len;
+ usage_comm.channel_name_len = channel_name_len;
+ usage_comm.domain_type = (int8_t) usage->domain.type;
+
+ if (usage->threshold_bytes.set) {
+ usage_comm.threshold = usage->threshold_bytes.value;
+ } else {
+ uint64_t val = double_to_fixed(
+ usage->threshold_ratio.value);
+
+ if (val > UINT32_MAX) {
+ /* overflow. */
+ ret = -1;
+ goto end;