From 167cfa283b2cd59d681d07503616942c28bfd542 Mon Sep 17 00:00:00 2001 From: Rick Watson Date: Tue, 23 Oct 2018 15:23:46 +0100 Subject: [PATCH] fix some basic type issues: use size_t for size as async web server uses this type internally use uint8_t for provision mode, we only have 3 values address warnings about ordering initializers --- src/APSettingsService.h | 2 +- src/AsyncJsonCallbackResponse.h | 2 +- src/AsyncJsonRequestWebHandler.h | 4 ++-- src/SettingsService.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/APSettingsService.h b/src/APSettingsService.h index 6f59ce3..6d9a1ba 100644 --- a/src/APSettingsService.h +++ b/src/APSettingsService.h @@ -37,7 +37,7 @@ class APSettingsService : public SettingsService { private: // access point settings - int _provisionMode; + uint8_t _provisionMode; String _ssid; String _password; diff --git a/src/AsyncJsonCallbackResponse.h b/src/AsyncJsonCallbackResponse.h index 4b520ed..0a3a868 100644 --- a/src/AsyncJsonCallbackResponse.h +++ b/src/AsyncJsonCallbackResponse.h @@ -21,7 +21,7 @@ class AsyncJsonCallbackResponse: public AsyncJsonResponse { public: - AsyncJsonCallbackResponse(AsyncJsonCallback callback, bool isArray=false) : _callback{callback}, AsyncJsonResponse(isArray) {} + AsyncJsonCallbackResponse(AsyncJsonCallback callback, bool isArray=false) : AsyncJsonResponse(isArray), _callback{callback} {} ~AsyncJsonCallbackResponse() { _callback(); } diff --git a/src/AsyncJsonRequestWebHandler.h b/src/AsyncJsonRequestWebHandler.h index e480378..7737b7f 100644 --- a/src/AsyncJsonRequestWebHandler.h +++ b/src/AsyncJsonRequestWebHandler.h @@ -22,7 +22,7 @@ class AsyncJsonRequestWebHandler: public AsyncWebHandler { String _uri; WebRequestMethodComposite _method; JsonRequestCallback _onRequest; - int _maxContentLength; + size_t _maxContentLength; public: @@ -36,7 +36,7 @@ class AsyncJsonRequestWebHandler: public AsyncWebHandler { void setUri(const String& uri) { _uri = uri; } void setMethod(WebRequestMethodComposite method) { _method = method; } - void setMaxContentLength(int maxContentLength) { _maxContentLength = maxContentLength; } + void setMaxContentLength(size_t maxContentLength) { _maxContentLength = maxContentLength; } void onRequest(JsonRequestCallback fn) { _onRequest = fn; } virtual bool canHandle(AsyncWebServerRequest *request) override final { diff --git a/src/SettingsService.h b/src/SettingsService.h index fb74eb6..4be1ff2 100644 --- a/src/SettingsService.h +++ b/src/SettingsService.h @@ -122,7 +122,7 @@ private: public: SettingsService(AsyncWebServer* server, FS* fs, char const* servicePath, char const* filePath): - _server(server), _fs(fs), _filePath(filePath) { + _filePath(filePath), _server(server), _fs(fs){ // configure fetch config handler _server->on(servicePath, HTTP_GET, std::bind(&SettingsService::fetchConfig, this, std::placeholders::_1));