diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-05-24 00:44:33 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-05-24 00:44:33 +0000 |
commit | 09ad8c8f73dbc64efada18e7ae2f9b64eb1be215 (patch) | |
tree | 58cbfec2928c0ff577927df4c7096d141069da4f /lldb/source/Utility | |
parent | 060f4b48d55c761de2722c0b7387966d1e8ede0c (diff) | |
download | bcm5719-llvm-09ad8c8f73dbc64efada18e7ae2f9b64eb1be215.tar.gz bcm5719-llvm-09ad8c8f73dbc64efada18e7ae2f9b64eb1be215.zip |
Fix integer literals which are cast to bool
This change replaces built-in types that are implicitly converted to
booleans.
Differential revision: https://reviews.llvm.org/D62284
llvm-svn: 361580
Diffstat (limited to 'lldb/source/Utility')
-rw-r--r-- | lldb/source/Utility/JSON.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Utility/SelectHelper.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Utility/StructuredData.cpp | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/Utility/JSON.cpp b/lldb/source/Utility/JSON.cpp index 54b87394505..2c3f6229eda 100644 --- a/lldb/source/Utility/JSON.cpp +++ b/lldb/source/Utility/JSON.cpp @@ -238,7 +238,7 @@ JSONParser::Token JSONParser::GetToken(std::string &value) { break; case '"': { - while (1) { + while (true) { bool was_escaped = false; int escaped_ch = GetEscapedChar(was_escaped); if (escaped_ch == -1) { @@ -453,7 +453,7 @@ JSONValue::SP JSONParser::ParseJSONObject() { std::string value; std::string key; - while (1) { + while (true) { JSONParser::Token token = GetToken(value); if (token == JSONParser::Token::String) { @@ -484,7 +484,7 @@ JSONValue::SP JSONParser::ParseJSONArray() { std::string value; std::string key; - while (1) { + while (true) { JSONValue::SP value_sp = ParseJSONValue(); if (value_sp) array_up->AppendObject(value_sp); diff --git a/lldb/source/Utility/SelectHelper.cpp b/lldb/source/Utility/SelectHelper.cpp index 5b60dea7184..ff21d99e400 100644 --- a/lldb/source/Utility/SelectHelper.cpp +++ b/lldb/source/Utility/SelectHelper.cpp @@ -192,7 +192,7 @@ lldb_private::Status SelectHelper::Select() { struct timeval *tv_ptr = nullptr; struct timeval tv = {0, 0}; - while (1) { + while (true) { using namespace std::chrono; // Setup out relative timeout based on the end time if we have one if (m_end_time.hasValue()) { diff --git a/lldb/source/Utility/StructuredData.cpp b/lldb/source/Utility/StructuredData.cpp index c486913d13d..0e203f9739d 100644 --- a/lldb/source/Utility/StructuredData.cpp +++ b/lldb/source/Utility/StructuredData.cpp @@ -51,7 +51,7 @@ static StructuredData::ObjectSP ParseJSONObject(JSONParser &json_parser) { std::string value; std::string key; - while (1) { + while (true) { JSONParser::Token token = json_parser.GetToken(value); if (token == JSONParser::Token::String) { @@ -82,7 +82,7 @@ static StructuredData::ObjectSP ParseJSONArray(JSONParser &json_parser) { std::string value; std::string key; - while (1) { + while (true) { StructuredData::ObjectSP value_sp = ParseJSONValue(json_parser); if (value_sp) array_up->AddItem(value_sp); |