1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-27 21:16:50 +03:00

Remove warnings when NDEBUG build option used (#4196)

When building using the new NDEBUG option recently added, the assert()
macro is defined to nothing. This leaves a few variables unused in the
WiFi stack causing compiler warnings. Add in empty casts to remove
these warnings. Does not affect actual assert use when NDEBUG is not
defined.
This commit is contained in:
Earle F. Philhower, III 2018-02-04 20:59:31 -08:00 committed by GitHub
parent 4e115917ae
commit e38f19e008
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -545,6 +545,7 @@ protected:
err_t _connected(struct tcp_pcb *pcb, err_t err)
{
(void) err;
(void) pcb;
assert(pcb == _pcb);
assert(_connect_pending);
esp_schedule();

View File

@ -31,12 +31,14 @@ public:
const uint8_t* get_buffer(size_t size) override
{
(void) size;
assert(_pos + size <= _size);
return _data + _pos;
}
void release_buffer(const uint8_t* buffer, size_t size) override
{
(void) buffer;
assert(buffer == _data + _pos);
_pos += size;
}
@ -70,6 +72,7 @@ public:
}
size_t cb = _stream.readBytes(reinterpret_cast<char*>(_buffer.get()), size);
assert(cb == size);
(void) cb;
return _buffer.get();
}