-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix warnings #2881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix warnings #2881
Changes from 3 commits
e2d4836
586a9f8
3b9a3aa
ff81a7a
2fb9e62
c47667d
d55efd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ static int sCount = 0; | |
|
||
static void init_lists() | ||
{ | ||
(void) init_lists; | ||
if (sCount != 0) { | ||
return; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ class SPIFFSImpl : public FSImpl | |
{ | ||
public: | ||
SPIFFSImpl(uint32_t start, uint32_t size, uint32_t pageSize, uint32_t blockSize, uint32_t maxOpenFds) | ||
: _fs({0}) | ||
: _fs{{0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} | ||
, _start(start) | ||
, _size(size) | ||
, _pageSize(pageSize) | ||
|
@@ -176,7 +176,7 @@ class SPIFFSImpl : public FSImpl | |
|
||
bool _tryMount() | ||
{ | ||
spiffs_config config = {0}; | ||
spiffs_config config = {0, 0, 0, 0, 0, 0, 0, 0}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here — memset will look slightly cleaner |
||
|
||
config.hal_read_f = &spiffs_hal_read; | ||
config.hal_write_f = &spiffs_hal_write; | ||
|
@@ -242,6 +242,11 @@ class SPIFFSImpl : public FSImpl | |
static void _check_cb(spiffs_check_type type, spiffs_check_report report, | ||
uint32_t arg1, uint32_t arg2) | ||
{ | ||
(void) type; | ||
(void) report; | ||
(void) arg1; | ||
(void) arg2; | ||
|
||
// TODO: spiffs doesn't pass any context pointer along with _check_cb, | ||
// so we can't do anything useful here other than perhaps | ||
// feeding the watchdog | ||
|
@@ -268,7 +273,7 @@ class SPIFFSFileImpl : public FileImpl | |
SPIFFSFileImpl(SPIFFSImpl* fs, spiffs_file fd) | ||
: _fs(fs) | ||
, _fd(fd) | ||
, _stat({0}) | ||
, _stat{0, 0, 0, 0, {0}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. likewise |
||
, _written(false) | ||
{ | ||
_getStat(); | ||
|
@@ -376,7 +381,7 @@ class SPIFFSFileImpl : public FileImpl | |
auto rc = SPIFFS_fstat(_fs->getFs(), _fd, &_stat); | ||
if (rc != SPIFFS_OK) { | ||
DEBUGV("SPIFFS_fstat rc=%d\r\n", rc); | ||
_stat = {0}; | ||
_stat = {0, 0, 0, 0, {0}}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. likewise |
||
} | ||
_written = false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we remove this initializer and use memset instead?