Commit 2988abd9 authored by Daniel Pfeifer's avatar Daniel Pfeifer Committed by Brad King
Browse files

clang-tidy: apply modernize-use-bool-literals fixes

parent a74e6893
......@@ -28,7 +28,7 @@
Generator->Logger->Log(logType, __FILE__, __LINE__, \
cmCPackLog_msg.str().c_str()); \
} \
} while (0)
} while (false)
cmCPackIFWInstaller::cmCPackIFWInstaller()
: Generator(CM_NULLPTR)
......
......@@ -29,7 +29,7 @@
Generator->Logger->Log(logType, __FILE__, __LINE__, \
cmCPackLog_msg.str().c_str()); \
} \
} while (0)
} while (false)
//---------------------------------------------------------- CompareStruct ---
cmCPackIFWPackage::CompareStruct::CompareStruct()
......
......@@ -23,7 +23,7 @@
Generator->Logger->Log(logType, __FILE__, __LINE__, \
cmCPackLog_msg.str().c_str()); \
} \
} while (0)
} while (false)
cmCPackIFWRepository::cmCPackIFWRepository()
: Update(None)
......
......@@ -30,7 +30,7 @@ class cmMakefile;
cmCPackLog_msg << msg; \
this->Logger->Log(logType, __FILE__, __LINE__, \
cmCPackLog_msg.str().c_str()); \
} while (0)
} while (false)
/** \class cmCPackGenerator
* \brief A superclass of all CPack Generators
......
......@@ -14,7 +14,7 @@
std::ostringstream cmCPackLog_msg; \
cmCPackLog_msg << msg; \
(ctSelf)->Log(logType, __FILE__, __LINE__, cmCPackLog_msg.str().c_str()); \
} while (0)
} while (false)
/** \class cmCPackLog
* \brief A container for CPack generators
......
......@@ -948,7 +948,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length,
this->BuildOutputLogSize += length;
// until there are any lines left in the buffer
while (1) {
while (true) {
// Find the end of line
t_BuildProcessingQueueType::iterator it;
for (it = queue->begin(); it != queue->end(); ++it) {
......
......@@ -748,7 +748,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command,
{
if (scp_command.empty() || localprefix.empty() || files.empty() ||
remoteprefix.empty() || url.empty()) {
return 0;
return false;
}
std::vector<const char*> argv;
......@@ -852,7 +852,7 @@ bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix,
<< "\tremoteprefix: " << remoteprefix << "\n"
<< "\tdestination: " << destination << std::endl);
/* clang-format on */
return 0;
return false;
}
cmCTest::SetOfStrings::const_iterator file;
......
......@@ -52,8 +52,7 @@ void onsig(int /*unused*/)
initscr(); /* Initialization */
noecho(); /* Echo off */
cbreak(); /* nl- or cr not needed */
keypad(stdscr, TRUE); /* Use key symbols as
KEY_DOWN*/
keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
refresh();
int x, y;
getmaxyx(stdscr, y, x);
......@@ -128,8 +127,7 @@ int main(int argc, char const* const* argv)
initscr(); /* Initialization */
noecho(); /* Echo off */
cbreak(); /* nl- or cr not needed */
keypad(stdscr, TRUE); /* Use key symbols as
KEY_DOWN*/
keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
signal(SIGWINCH, onsig);
......
......@@ -576,8 +576,7 @@ int cmCursesMainForm::Configure(int noconfigure)
}
this->CMakeInstance->SetProgressCallback(CM_NULLPTR, CM_NULLPTR);
keypad(stdscr, TRUE); /* Use key symbols as
KEY_DOWN*/
keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
if (retVal != 0 || !this->Errors.empty()) {
// see if there was an error
......@@ -630,8 +629,7 @@ int cmCursesMainForm::Generate()
int retVal = this->CMakeInstance->Generate();
this->CMakeInstance->SetProgressCallback(CM_NULLPTR, CM_NULLPTR);
keypad(stdscr, TRUE); /* Use key symbols as
KEY_DOWN*/
keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
if (retVal != 0 || !this->Errors.empty()) {
// see if there was an error
......
......@@ -28,9 +28,9 @@ void cmCursesWidget::Move(int x, int y, bool isNewPage)
move_field(this->Field, y, x);
if (isNewPage) {
set_new_page(this->Field, TRUE);
set_new_page(this->Field, true);
} else {
set_new_page(this->Field, FALSE);
set_new_page(this->Field, false);
}
}
......
......@@ -1509,7 +1509,7 @@ bool cmCTest::SubmitExtraFiles(const VectorOfStrings& files)
bool cmCTest::SubmitExtraFiles(const char* cfiles)
{
if (!cfiles) {
return 1;
return true;
}
VectorOfStrings files;
......@@ -1518,7 +1518,7 @@ bool cmCTest::SubmitExtraFiles(const char* cfiles)
files = cmSystemTools::SplitString(cfiles, ';');
if (files.empty()) {
return 1;
return true;
}
return this->SubmitExtraFiles(files);
......
......@@ -27,7 +27,7 @@ class cmXMLWriter;
cmCTestLog_msg << msg; \
(ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__, \
cmCTestLog_msg.str().c_str()); \
} while (0)
} while (false)
#define cmCTestOptionalLog(ctSelf, logType, msg, suppress) \
do { \
......@@ -35,7 +35,7 @@ class cmXMLWriter;
cmCTestLog_msg << msg; \
(ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__, \
cmCTestLog_msg.str().c_str(), suppress); \
} while (0)
} while (false)
/** \class cmCTest
* \brief Represents a ctest invocation.
......
......@@ -52,7 +52,7 @@ cmFortranParser_s::cmFortranParser_s(std::vector<std::string> const& includes,
, PPDefinitions(defines)
, Info(info)
{
this->InInterface = 0;
this->InInterface = false;
this->InPPFalseBranch = 0;
// Initialize the lexical scanner.
......@@ -83,9 +83,9 @@ bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname)
cmFortran_yy_create_buffer(CM_NULLPTR, 16384, parser->Scanner);
cmFortran_yy_switch_to_buffer(buffer, parser->Scanner);
parser->FileStack.push(f);
return 1;
return true;
}
return 0;
return false;
}
bool cmFortranParser_FilePop(cmFortranParser* parser)
......@@ -93,7 +93,7 @@ bool cmFortranParser_FilePop(cmFortranParser* parser)
// Pop one file off the stack and close it. Switch the lexer back
// to the next one on the stack.
if (parser->FileStack.empty()) {
return 0;
return false;
}
cmFortranFile f = parser->FileStack.top();
parser->FileStack.pop();
......@@ -101,7 +101,7 @@ bool cmFortranParser_FilePop(cmFortranParser* parser)
YY_BUFFER_STATE current = cmFortranLexer_GetCurrentBuffer(parser->Scanner);
cmFortran_yy_delete_buffer(current, parser->Scanner);
cmFortran_yy_switch_to_buffer(f.Buffer, parser->Scanner);
return 1;
return true;
}
int cmFortranParser_Input(cmFortranParser* parser, char* buffer,
......
......@@ -351,7 +351,8 @@ std::string cmGeneratorExpression::Preprocess(const std::string& input,
return stripExportInterface(input, context, resolveRelative);
}
assert(0 && "cmGeneratorExpression::Preprocess called with invalid args");
assert(false &&
"cmGeneratorExpression::Preprocess called with invalid args");
return std::string();
}
......
......@@ -1377,7 +1377,7 @@ cmPolicies::PolicyStatus statusForTarget(cmGeneratorTarget const* tgt,
#undef RETURN_POLICY
assert(0 && "Unreachable code. Not a valid policy");
assert(false && "Unreachable code. Not a valid policy");
return cmPolicies::WARN;
}
......@@ -1392,7 +1392,7 @@ cmPolicies::PolicyID policyForString(const char* policy_id)
#undef RETURN_POLICY_ID
assert(0 && "Unreachable code. Not a valid policy");
assert(false && "Unreachable code. Not a valid policy");
return cmPolicies::CMP0002;
}
......
......@@ -242,11 +242,11 @@ void cmGeneratorExpressionParser::ParseContent(
if (this->NestingLevel == 0) {
extendText(result, this->it);
} else {
assert(0 && "Got unexpected syntax token.");
assert(false && "Got unexpected syntax token.");
}
assert(this->it != this->Tokens.end());
++this->it;
return;
}
assert(0 && "Unhandled token in generator expression.");
assert(false && "Unhandled token in generator expression.");
}
......@@ -3389,7 +3389,8 @@ const char* getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
{
switch (t) {
case BoolType:
assert(0 && "String compatibility check function called for boolean");
assert(false &&
"String compatibility check function called for boolean");
return CM_NULLPTR;
case StringType:
return tgt->GetLinkInterfaceDependentStringProperty(prop, config);
......@@ -3398,7 +3399,7 @@ const char* getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
case NumberMaxType:
return tgt->GetLinkInterfaceDependentNumberMaxProperty(prop, config);
}
assert(0 && "Unreachable!");
assert(false && "Unreachable!");
return CM_NULLPTR;
}
......@@ -3589,7 +3590,7 @@ std::string compatibilityType(CompatibleType t)
case NumberMinType:
return "Numeric minimum compatibility";
}
assert(0 && "Unreachable!");
assert(false && "Unreachable!");
return "";
}
......@@ -3603,7 +3604,7 @@ std::string compatibilityAgree(CompatibleType t, bool dominant)
case NumberMinType:
return dominant ? "(Dominant)\n" : "(Ignored)\n";
}
assert(0 && "Unreachable!");
assert(false && "Unreachable!");
return "";
}
......@@ -3713,7 +3714,7 @@ std::pair<bool, const char*> consistentProperty(const char* lhs,
switch (t) {
case BoolType:
assert(0 && "consistentProperty for strings called with BoolType");
assert(false && "consistentProperty for strings called with BoolType");
return std::pair<bool, const char*>(false, null_ptr);
case StringType:
return consistentStringProperty(lhs, rhs);
......@@ -3721,7 +3722,7 @@ std::pair<bool, const char*> consistentProperty(const char* lhs,
case NumberMaxType:
return consistentNumberProperty(lhs, rhs, t);
}
assert(0 && "Unreachable!");
assert(false && "Unreachable!");
return std::pair<bool, const char*>(false, null_ptr);
}
......
......@@ -97,7 +97,8 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
case cmStateEnums::INTERFACE_LIBRARY:
// Not reachable. We never create a cmInstallTargetGenerator for
// an INTERFACE_LIBRARY.
assert(0 && "INTERFACE_LIBRARY targets have no installable outputs.");
assert(false &&
"INTERFACE_LIBRARY targets have no installable outputs.");
break;
case cmStateEnums::OBJECT_LIBRARY:
case cmStateEnums::UTILITY:
......
......@@ -538,7 +538,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
case cmStateEnums::EXECUTABLE:
break;
default:
assert(0 && "Unexpected target type");
assert(false && "Unexpected target type");
}
return std::vector<std::string>();
}
......
......@@ -58,7 +58,7 @@ const char* cmState::GetTargetTypeName(cmStateEnums::TargetType targetType)
case cmStateEnums::UNKNOWN_LIBRARY:
return "UNKNOWN_LIBRARY";
}
assert(0 && "Unexpected target type");
assert(false && "Unexpected target type");
return CM_NULLPTR;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment