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]
This commit is contained in:
Luc 2019-07-04 12:26:36 +02:00
parent ab5e407e2e
commit 0db3aa8878
2 changed files with 5 additions and 5 deletions

View File

@ -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; yp<h; yp++)
{
for (int32_t xp = 0; xp<ww; xp+=8)
for (int32_t xp = 0; (uint32_t)xp < ww; xp+=8)
{
uint8_t pbyte = pgm_read_byte(pdata++);
for (uint8_t xc = 0; xc < 8; xc++)
@ -1679,7 +1679,7 @@ int16_t TFT_eSprite::drawChar(uint16_t uniCode, int32_t x, int32_t y, uint8_t fo
if ((font>2) && (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 );
}

View File

@ -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 );
}