1
0
mirror of https://github.com/arduino-libraries/ArduinoHttpClient.git synced 2025-04-19 21:22:15 +03:00

Fix -Wlogical-not-parentheses warning (#79)

* Fix -Wlogical-not-parentheses warning

The warning occurs because `operator!()` has higher precedence than `operator>()`.

Alternatively, we can use:
```
iClient->connect(iServerAddress, iServerPort) <= 0
```
This commit is contained in:
Vaibhav Patel 2021-02-26 05:01:05 -05:00 committed by GitHub
parent 7f36561e0b
commit 9a5afdfc74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,7 @@ int HttpClient::startRequest(const char* aURLPath, const char* aHttpMethod,
{
if (iServerName)
{
if (!iClient->connect(iServerName, iServerPort) > 0)
if (!(iClient->connect(iServerName, iServerPort) > 0))
{
#ifdef LOGGING
Serial.println("Connection failed");
@ -94,7 +94,7 @@ int HttpClient::startRequest(const char* aURLPath, const char* aHttpMethod,
}
else
{
if (!iClient->connect(iServerAddress, iServerPort) > 0)
if (!(iClient->connect(iServerAddress, iServerPort) > 0))
{
#ifdef LOGGING
Serial.println("Connection failed");