From 0db3aa8878993fff70b6128a3c8345f3b20a6332 Mon Sep 17 00:00:00 2001 From: Luc Date: Thu, 4 Jul 2019 12:26:36 +0200 Subject: [PATCH] Fix warnings in platformIO warning: suggest parentheses around '-' inside '<<' [-Wparentheses] warning: comparison between signed and unsigned integer expressions [-Wsign-compare] warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith] --- Extensions/Sprite.cpp | 4 ++-- TFT_eSPI.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Extensions/Sprite.cpp b/Extensions/Sprite.cpp index 832abb9..faeaae2 100644 --- a/Extensions/Sprite.cpp +++ b/Extensions/Sprite.cpp @@ -716,7 +716,7 @@ void TFT_eSprite::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const u uint32_t ww = (w+7) & 0xFFF8; for (int32_t yp = 0; yp2) && (font<9)) { // This is slower than above but is more convenient for the RLE fonts - flash_address = pgm_read_dword( (const void*)pgm_read_dword( &(fontdata[font].chartbl ) ) + uniCode*sizeof(void *) ); + flash_address = pgm_read_dword( (const void*)(pgm_read_dword( &(fontdata[font].chartbl ) ) + uniCode*sizeof(void *) )); width = pgm_read_byte( (uint8_t *)pgm_read_dword( &(fontdata[font].widthtbl ) ) + uniCode ); height= pgm_read_byte( &fontdata[font].height ); } diff --git a/TFT_eSPI.cpp b/TFT_eSPI.cpp index ad27dcb..85e814f 100644 --- a/TFT_eSPI.cpp +++ b/TFT_eSPI.cpp @@ -35,9 +35,9 @@ // If it is a 16bit serial display we must transfer 16 bits every time #ifdef RPI_ILI9486_DRIVER - #define CMD_BITS 16-1 + #define CMD_BITS (16-1) #else - #define CMD_BITS 8-1 + #define CMD_BITS (8-1) #endif // Fast block write prototype @@ -4270,7 +4270,7 @@ int16_t TFT_eSPI::drawChar(uint16_t uniCode, int32_t x, int32_t y, uint8_t font) { if ((font>2) && (font<9)) { - flash_address = pgm_read_dword( (const void*)pgm_read_dword( &(fontdata[font].chartbl ) ) + uniCode*sizeof(void *) ); + flash_address = pgm_read_dword( (const void*)(pgm_read_dword( &(fontdata[font].chartbl ) ) + uniCode*sizeof(void *))); width = pgm_read_byte( (uint8_t *)pgm_read_dword( &(fontdata[font].widthtbl ) ) + uniCode ); height= pgm_read_byte( &fontdata[font].height ); }