replace C-style casts with C++ static_casts
This commit is contained in:
parent
386e6b8720
commit
d5d66ecfd5
2
.github/workflows/cpplint.yml
vendored
2
.github/workflows/cpplint.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install cpplint==1.6.1
|
||||
pip install cpplint
|
||||
- name: Linting
|
||||
run: |
|
||||
cpplint --repository=. --recursive \
|
||||
|
||||
@ -83,7 +83,7 @@ HttpRequestResult HttpGetter::performGetRequest()
|
||||
// depth at https://github.com/espressif/esp-idf/issues/2507#issuecomment-761836300
|
||||
// in conclusion: we cannot rely on _upHttpClient->begin(*wifiClient, url) to resolve
|
||||
// IP adresses. have to do it manually.
|
||||
IPAddress ipaddr((uint32_t)0);
|
||||
IPAddress ipaddr(static_cast<uint32_t>(0));
|
||||
|
||||
if (!ipaddr.fromString(_host)) {
|
||||
// host is not an IP address, so try to resolve the name to an address.
|
||||
|
||||
@ -245,7 +245,8 @@ bool SerialResponse::isValid() const {
|
||||
Status const actualStatus = getStatus();
|
||||
if (actualStatus != Status::Ok) {
|
||||
MessageOutput.printf("JbdBms::SerialMessage: invalid status 0x%02x, expected 0x%02x\r\n",
|
||||
(uint32_t) actualStatus, (uint32_t) Status::Ok);
|
||||
static_cast<uint32_t>(actualStatus),
|
||||
static_cast<uint32_t>(Status::Ok));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -259,7 +260,9 @@ bool SerialCommand::isValid() const {
|
||||
Status const actualStatus = getStatus();
|
||||
if (actualStatus != Status::Read || actualStatus != Status::Write) {
|
||||
MessageOutput.printf("JbdBms::SerialMessage: invalid status 0x%02x, expected 0x%02x or 0x%02x\r\n",
|
||||
(uint32_t) actualStatus, (uint32_t) Status::Read, (uint32_t) Status::Write);
|
||||
static_cast<uint32_t>(actualStatus),
|
||||
static_cast<uint32_t>(Status::Read),
|
||||
static_cast<uint32_t>(Status::Write));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user