From 2cb1ad5d0c1b2305b58503ec9363b753f48fd334 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Wed, 12 Dec 2018 13:39:59 -0600 Subject: [PATCH] STYLE: Replace integer literals which are cast to bool. Finds and replaces integer literals which are cast to bool. SRCDIR=/Users/johnsonhj/src/jsoncpp #My local SRC BLDDIR=/Users/johnsonhj/src/jsoncpp/cmake-build-debug/ #My local BLD cd /Users/johnsonhj/src/jsoncpp/cmake-build-debug/ run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-bool-literals -header-filter=.* -fix --- src/test_lib_json/main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp index 37dbdd6..32f424b 100644 --- a/src/test_lib_json/main.cpp +++ b/src/test_lib_json/main.cpp @@ -2350,14 +2350,14 @@ JSONTEST_FIXTURE(CharReaderAllowSpecialFloatsTest, issue209) { JSONCPP_STRING in; }; const TestData test_data[] = { - { __LINE__, 1, "{\"a\":9}" }, { __LINE__, 0, "{\"a\":0Infinity}" }, - { __LINE__, 0, "{\"a\":1Infinity}" }, { __LINE__, 0, "{\"a\":9Infinity}" }, - { __LINE__, 0, "{\"a\":0nfinity}" }, { __LINE__, 0, "{\"a\":1nfinity}" }, - { __LINE__, 0, "{\"a\":9nfinity}" }, { __LINE__, 0, "{\"a\":nfinity}" }, - { __LINE__, 0, "{\"a\":.nfinity}" }, { __LINE__, 0, "{\"a\":9nfinity}" }, - { __LINE__, 0, "{\"a\":-nfinity}" }, { __LINE__, 1, "{\"a\":Infinity}" }, - { __LINE__, 0, "{\"a\":.Infinity}" }, { __LINE__, 0, "{\"a\":_Infinity}" }, - { __LINE__, 0, "{\"a\":_nfinity}" }, { __LINE__, 1, "{\"a\":-Infinity}" } + { __LINE__, true, "{\"a\":9}" }, { __LINE__, false, "{\"a\":0Infinity}" }, + { __LINE__, false, "{\"a\":1Infinity}" }, { __LINE__, false, "{\"a\":9Infinity}" }, + { __LINE__, false, "{\"a\":0nfinity}" }, { __LINE__, false, "{\"a\":1nfinity}" }, + { __LINE__, false, "{\"a\":9nfinity}" }, { __LINE__, false, "{\"a\":nfinity}" }, + { __LINE__, false, "{\"a\":.nfinity}" }, { __LINE__, false, "{\"a\":9nfinity}" }, + { __LINE__, false, "{\"a\":-nfinity}" }, { __LINE__, true, "{\"a\":Infinity}" }, + { __LINE__, false, "{\"a\":.Infinity}" }, { __LINE__, false, "{\"a\":_Infinity}" }, + { __LINE__, false, "{\"a\":_nfinity}" }, { __LINE__, true, "{\"a\":-Infinity}" } }; for (size_t tdi = 0; tdi < sizeof(test_data) / sizeof(*test_data); ++tdi) { const TestData& td = test_data[tdi];