From: Mathieu Desnoyers Date: Mon, 4 Jul 2016 22:46:16 +0000 (-0400) Subject: enumeration autoincrement: use if/else logic X-Git-Tag: v2.9.0-rc1~44 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7c559490ad4f9ab909493b17bb09a7495568fdcd;p=lttng-modules.git enumeration autoincrement: use if/else logic Use if/else logic rather than "continue" on loop for clarity. Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-events.c b/lttng-events.c index a706cbdb..455b790f 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -1963,36 +1963,38 @@ int _lttng_enum_statedump(struct lttng_session *session, ret = lttng_metadata_printf(session, ",\n"); if (ret) goto end; - continue; - } - - ret = lttng_metadata_printf(session, - " = "); - if (ret) - goto end; - if (entry->start.signedness) - ret = lttng_metadata_printf(session, - "%lld", (long long) entry->start.value); - else - ret = lttng_metadata_printf(session, - "%llu", entry->start.value); - if (ret) - goto end; - if (entry->start.signedness == entry->end.signedness && - entry->start.value == entry->end.value) { - ret = lttng_metadata_printf(session, - ",\n"); } else { - if (entry->end.signedness) { + ret = lttng_metadata_printf(session, + " = "); + if (ret) + goto end; + if (entry->start.signedness) ret = lttng_metadata_printf(session, - " ... %lld,\n", (long long) entry->end.value); - } else { + "%lld", (long long) entry->start.value); + else + ret = lttng_metadata_printf(session, + "%llu", entry->start.value); + if (ret) + goto end; + if (entry->start.signedness == entry->end.signedness && + entry->start.value + == entry->end.value) { ret = lttng_metadata_printf(session, - " ... %llu,\n", entry->end.value); + ",\n"); + } else { + if (entry->end.signedness) { + ret = lttng_metadata_printf(session, + " ... %lld,\n", + (long long) entry->end.value); + } else { + ret = lttng_metadata_printf(session, + " ... %llu,\n", + entry->end.value); + } } + if (ret) + goto end; } - if (ret) - goto end; } ret = print_tabs(session, nesting); if (ret)