Skip to content

Commit 3eb8017

Browse files
Fix codacy warnings (#67)
* All initialization moved to the initializer list.
1 parent 8fc1361 commit 3eb8017

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/CachedTile.hpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,20 @@ struct CachedTile
3232
uint32_t x;
3333
uint32_t y;
3434
uint8_t z;
35-
bool valid = false;
36-
bool busy = false;
37-
uint16_t *buffer = nullptr;
38-
SemaphoreHandle_t mutex = nullptr;
35+
bool valid;
36+
bool busy;
37+
SemaphoreHandle_t mutex;
38+
uint16_t *buffer;
3939

4040
CachedTile()
41+
: x(0),
42+
y(0),
43+
z(0),
44+
valid(false),
45+
busy(false),
46+
mutex(xSemaphoreCreateMutex()),
47+
buffer(nullptr)
4148
{
42-
mutex = xSemaphoreCreateMutex();
4349
}
4450

4551
~CachedTile()
@@ -54,7 +60,7 @@ struct CachedTile
5460

5561
bool allocate()
5662
{
57-
buffer = (uint16_t *)heap_caps_malloc(256 * 256 * sizeof(uint16_t), MALLOC_CAP_SPIRAM);
63+
buffer = static_cast<uint16_t *>(heap_caps_malloc(256 * 256 * sizeof(uint16_t), MALLOC_CAP_SPIRAM));
5864
return buffer != nullptr;
5965
}
6066

0 commit comments

Comments
 (0)