Skip to content

Commit 3126124

Browse files
ci(pre-commit): Apply automatic fixes
1 parent 6bd80ae commit 3126124

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

libraries/ArduinoOTA/src/ArduinoOTA.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626

2727
// #define OTA_DEBUG Serial
2828

29-
ArduinoOTAClass::ArduinoOTAClass(UpdateClass* updater)
30-
: _updater(updater), _port(0), _initialized(false), _rebootOnSuccess(true), _mdnsEnabled(true), _state(OTA_IDLE), _size(0), _cmd(0), _ota_port(0), _ota_timeout(1000),
31-
_start_callback(NULL), _end_callback(NULL), _error_callback(NULL), _progress_callback(NULL) {}
29+
ArduinoOTAClass::ArduinoOTAClass(UpdateClass *updater)
30+
: _updater(updater), _port(0), _initialized(false), _rebootOnSuccess(true), _mdnsEnabled(true), _state(OTA_IDLE), _size(0), _cmd(0), _ota_port(0),
31+
_ota_timeout(1000), _start_callback(NULL), _end_callback(NULL), _error_callback(NULL), _progress_callback(NULL) {}
3232

3333
ArduinoOTAClass::~ArduinoOTAClass() {
3434
end();
@@ -297,7 +297,7 @@ void ArduinoOTAClass::_onRx() {
297297
}
298298

299299
void ArduinoOTAClass::_runUpdate() {
300-
if (!_updater){
300+
if (!_updater) {
301301
log_e("UpdateClass is NULL!");
302302
return;
303303
}
@@ -452,7 +452,7 @@ void ArduinoOTAClass::setTimeout(int timeoutInMillis) {
452452
_ota_timeout = timeoutInMillis;
453453
}
454454

455-
ArduinoOTAClass &ArduinoOTAClass::setUpdaterInstance(UpdateClass* updater){
455+
ArduinoOTAClass &ArduinoOTAClass::setUpdaterInstance(UpdateClass *updater) {
456456
_updater = updater;
457457
return *this;
458458
}

libraries/ArduinoOTA/src/ArduinoOTA.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ class ArduinoOTAClass {
4242
typedef std::function<void(unsigned int, unsigned int)> THandlerFunction_Progress;
4343

4444
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_UPDATE)
45-
ArduinoOTAClass(UpdateClass* updater = &Update);
45+
ArduinoOTAClass(UpdateClass *updater = &Update);
4646
#else
47-
ArduinoOTAClass(UpdateClass* updater = nullptr);
47+
ArduinoOTAClass(UpdateClass *updater = nullptr);
4848
#endif
4949
~ArduinoOTAClass();
5050

@@ -66,7 +66,7 @@ class ArduinoOTAClass {
6666
String getPartitionLabel();
6767

6868
//Sets instance of UpdateClass to perform updating operations
69-
ArduinoOTAClass &setUpdaterInstance(UpdateClass* updater);
69+
ArduinoOTAClass &setUpdaterInstance(UpdateClass *updater);
7070

7171
//Sets if the device should be rebooted after successful update. Default true
7272
ArduinoOTAClass &setRebootOnSuccess(bool reboot);

libraries/HTTPUpdate/src/HTTPUpdate.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@
3535
// To do extern "C" uint32_t _SPIFFS_start;
3636
// To do extern "C" uint32_t _SPIFFS_end;
3737

38-
HTTPUpdate::HTTPUpdate(int httpClientTimeout, UpdateClass* updater) :
39-
_httpClientTimeout(httpClientTimeout),
40-
_updater(updater),
41-
_followRedirects(HTTPC_DISABLE_FOLLOW_REDIRECTS) {}
38+
HTTPUpdate::HTTPUpdate(int httpClientTimeout, UpdateClass *updater)
39+
: _httpClientTimeout(httpClientTimeout), _updater(updater), _followRedirects(HTTPC_DISABLE_FOLLOW_REDIRECTS) {}
4240

4341
HTTPUpdate::~HTTPUpdate(void) {}
4442

@@ -124,8 +122,9 @@ int HTTPUpdate::getLastError(void) {
124122
* @return String error
125123
*/
126124
String HTTPUpdate::getLastErrorString(void) {
127-
if (!_updater)
125+
if (!_updater) {
128126
return {};
127+
}
129128

130129
if (_lastError == 0) {
131130
return String(); // no error
@@ -441,8 +440,9 @@ HTTPUpdateResult HTTPUpdate::handleUpdate(HTTPClient &http, const String &curren
441440
* @return true if Update ok
442441
*/
443442
bool HTTPUpdate::runUpdate(Stream &in, uint32_t size, String md5, int command) {
444-
if (!_updater)
443+
if (!_updater) {
445444
return false;
445+
}
446446

447447
StreamString error;
448448

libraries/HTTPUpdate/src/HTTPUpdate.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ using HTTPUpdateProgressCB = std::function<void(int, int)>;
5959
class HTTPUpdate {
6060
public:
6161
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_UPDATE)
62-
HTTPUpdate(UpdateClass* updater = &Update) : HTTPUpdate(8000, updater) {};
63-
HTTPUpdate(int httpClientTimeout, UpdateClass* updater = &Update);
62+
HTTPUpdate(UpdateClass *updater = &Update) : HTTPUpdate(8000, updater){};
63+
HTTPUpdate(int httpClientTimeout, UpdateClass *updater = &Update);
6464
#else
65-
HTTPUpdate(UpdateClass* updater = nullptr) : HTTPUpdate(8000, updater) {};
66-
HTTPUpdate(int httpClientTimeout, UpdateClass* updater = nullptr);
65+
HTTPUpdate(UpdateClass *updater = nullptr) : HTTPUpdate(8000, updater){};
66+
HTTPUpdate(int httpClientTimeout, UpdateClass *updater = nullptr);
6767
#endif
6868
~HTTPUpdate(void);
6969

@@ -98,7 +98,9 @@ class HTTPUpdate {
9898
}
9999

100100
//Sets instance of UpdateClass to perform updating operations
101-
void setUpdaterInstance(UpdateClass* updater){ _updater = updater; };
101+
void setUpdaterInstance(UpdateClass *updater) {
102+
_updater = updater;
103+
};
102104

103105
t_httpUpdate_return update(NetworkClient &client, const String &url, const String &currentVersion = "", HTTPUpdateRequestCB requestCB = NULL);
104106

0 commit comments

Comments
 (0)