Standardize `strcmp(a, b) == 0` instead of `!strcmp(a, b)`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 10 Jul 2019 21:33:41 +0000 (17:33 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 10 Jul 2019 22:06:59 +0000 (18:06 -0400)
commit2242b43d4f50ebdeabb124154fb8ac602c563536
treec4ae1b98f4223b44a0ce25820d6a9bdf17391016
parent19bbdc9bfcbbfabb1f04dad12ff1df5d7075bf11
Standardize `strcmp(a, b) == 0` instead of `!strcmp(a, b)`

`!strcmp(a, b)` always looks like a negation to me (not equal), while
the `== 0` version clearly shows that we're after equality.

Semantic patch:

    @@
    expression a;
    expression b;
    @@

    - !strcmp(a, b)
    + strcmp(a, b) == 0

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I8e05b544c5cbd733e3d3e5b2c3554ee98669d1d5
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1685
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
12 files changed:
src/cli/babeltrace2-cfg-cli-args.c
src/cli/babeltrace2-cfg-cli-params-arg.c
src/cli/babeltrace2.c
src/ctf-writer/attributes.c
src/lib/graph/component.c
src/lib/trace-ir/attributes.c
src/plugins/ctf/common/metadata/visitor-generate-ir.c
src/plugins/ctf/fs-src/fs.c
src/plugins/ctf/lttng-live/viewer-connection.c
src/plugins/text/pretty/pretty.c
tests/ctf-writer/ctf_writer.c
tests/lib/test_bt_values.c
This page took 0.025993 seconds and 4 git commands to generate.