1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-25 13:41:23 +01:00

less warnings

This commit is contained in:
Harald Barth 2021-10-03 19:39:43 +02:00
parent 0bb6b577fa
commit 50bb1c950b

View File

@ -36,10 +36,12 @@ static AsyncServer *server;
static RingStream *outboundRing = new RingStream(2048); static RingStream *outboundRing = new RingStream(2048);
static void handleError(void* arg, AsyncClient* client, int8_t error) { static void handleError(void* arg, AsyncClient* client, int8_t error) {
(void)arg;
DIAG(F("connection error %s from client %s"), client->errorToString(error), client->remoteIP().toString().c_str()); DIAG(F("connection error %s from client %s"), client->errorToString(error), client->remoteIP().toString().c_str());
} }
static void handleData(void* arg, AsyncClient* client, void *data, size_t len) { static void handleData(void* arg, AsyncClient* client, void *data, size_t len) {
(void)arg;
//DIAG(F("data received from client %s"), client->remoteIP().toString().c_str()); //DIAG(F("data received from client %s"), client->remoteIP().toString().c_str());
uint8_t clientId; uint8_t clientId;
for (clientId=0; clientId<clients.size(); clientId++){ for (clientId=0; clientId<clients.size(); clientId++){
@ -95,17 +97,21 @@ static void deleteClient(AsyncClient* client) {
} }
} }
static void handleDisconnect(void* arg, AsyncClient* client) { static void handleDisconnect(void* arg, AsyncClient* client) {
(void)arg;
DIAG(F("Client disconnected")); DIAG(F("Client disconnected"));
deleteClient(client); deleteClient(client);
} }
static void handleTimeOut(void* arg, AsyncClient* client, uint32_t time) { static void handleTimeOut(void* arg, AsyncClient* client, uint32_t time) {
(void)arg;
(void)time;
DIAG(F("client ACK timeout ip: %s"), client->remoteIP().toString().c_str()); DIAG(F("client ACK timeout ip: %s"), client->remoteIP().toString().c_str());
deleteClient(client); deleteClient(client);
} }
static void handleNewClient(void* arg, AsyncClient* client) { static void handleNewClient(void* arg, AsyncClient* client) {
(void)arg;
DIAG(F("New client %s"), client->remoteIP().toString().c_str()); DIAG(F("New client %s"), client->remoteIP().toString().c_str());
// add to list // add to list
@ -213,7 +219,7 @@ void WifiESP::loop() {
// call sendData // call sendData
int clientId=outboundRing->peek(); int clientId=outboundRing->peek();
if (clientId >= 0) { if (clientId >= 0) {
if (clientId > clients.size()) { if ((unsigned int)clientId > clients.size()) {
// something is wrong with the ringbuffer position // something is wrong with the ringbuffer position
outboundRing->info(); outboundRing->info();
client = NULL; client = NULL;