From de87419df92326a85910b2211975855e0bcf6b8a Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Thu, 3 Nov 2016 16:37:26 -0700 Subject: [PATCH] lint: multiple unary operator --- src/builtin.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/builtin.cpp b/src/builtin.cpp index a3a167963..caca9928d 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -908,7 +908,7 @@ static int builtin_generic(parser_t &parser, io_streams_t &streams, wchar_t **ar /// Return a definition of the specified function. Used by the functions builtin. static wcstring functions_def(const wcstring &name) { - CHECK(!name.empty(), L""); + CHECK(!name.empty(), L""); //!OCLINT(multiple unary operator) wcstring out; wcstring desc, def; function_get_desc(name, &desc); @@ -1090,7 +1090,8 @@ static int builtin_functions(parser_t &parser, io_streams_t &streams, wchar_t ** } // Erase, desc, query, copy and list are mutually exclusive. - if ((erase + (!!desc) + list + query + copy) > 1) { + int describe = desc ? 1 : 0; + if (erase + describe + list + query + copy > 1) { streams.err.append_format(_(L"%ls: Invalid combination of options\n"), argv[0]); builtin_print_help(parser, streams, argv[0], streams.err);